Skip to content

Commit

Permalink
switch to ubuntu only for test
Browse files Browse the repository at this point in the history
  • Loading branch information
BWMac committed Oct 30, 2023
1 parent 5492955 commit 2cda95c
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 50 deletions.
15 changes: 3 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ jobs:
- "3.8"
- "3.11" # newest Python that is stable
platform:
#- ubuntu-latest
- macos-latest
- ubuntu-latest
# - macos-latest
# TODO: Debug the Windows issues
# - windows-latest
env:
Expand All @@ -79,16 +79,7 @@ jobs:
- name: Run tests
env:
SYNAPSE_AUTH_TOKEN: ${{ secrets.SYNAPSE_AUTH_TOKEN }}
run: |
codesign --sign - --entitlements entitlements.xml \
--force /usr/local/bin/qemu-system-x86_64
brew install docker colima
colima start
while ! docker info > /dev/null 2>&1; do
echo "Waiting for docker daemon to start..."
sleep 5
done
echo "Docker daemon is running"
run: >-
pipx run --spec 'tox~=3.0' tox \
--installpkg '${{ needs.prepare.outputs.wheel-path }}' \
-- -rFEx --durations 10 --color yes
Expand Down
96 changes: 58 additions & 38 deletions tests/test_external_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,132 +181,152 @@ def test_that_the_bioformats_info_test_command_is_produced(test_targets):
assert "showinf" in process.command


# def test_that_the_bioformats_info_test_exit_code_is_0_when_it_should_be(test_files):
# one_tiff_file = test_files["ome_tiff"]
# target = SingleTarget(one_tiff_file)
# test = tests.BioFormatsInfoTest(target)
# def test_that_the_tifftag306datetimetest_command_is_produced(test_targets):
# target = test_targets["tiff"]
# test = tests.TiffTag306DateTimeTest(target)
# process = test.generate_process()
# assert "jq" in process.command


# def test_that_the_tifftag306datetimetest_exit_code_is_0_when_it_should_be(test_files):
# tiff_file = test_files["tiff"]
# target = SingleTarget(tiff_file)
# test = tests.TiffTag306DateTimeTest(target)
# process = test.generate_process()
# executor = DockerExecutor(process.container, process.command, target.file.url)
# executor.execute()
# assert executor.exit_code == "0"


# def test_that_the_bioformats_info_test_correctly_interprets_exit_code_0_and_1(
# def test_that_the_tifftag306datetimetest_correctly_interprets_exit_code_0_and_1(
# test_files, mocker
# ):
# # 0 is pass, 1 is fail
# # 1 is pass, 0 is fail
# tiff_file = test_files["tiff"]
# target = SingleTarget(tiff_file)
# with TemporaryDirectory() as tmp_dir:
# path_0 = Path(tmp_dir, "code_0.txt")
# path_1 = Path(tmp_dir, "code_1.txt")
# path_0.write_text("0")
# path_1.write_text("1")
# pass_outputs = {"std_out": path_1, "std_err": path_1, "exit_code": path_0}
# fail_outputs = {"std_out": path_0, "std_err": path_0, "exit_code": path_1}
# fail_outputs = {"std_out": path_1, "std_err": path_1, "exit_code": path_0}
# pass_outputs = {"std_out": path_0, "std_err": path_0, "exit_code": path_1}

# test = tests.BioFormatsInfoTest(target)
# test = tests.TiffTag306DateTimeTest(target)
# mocker.patch.object(test, "_find_process_outputs", return_value=pass_outputs)
# test_status = test.get_status()
# assert test_status == TestStatus.PASS

# test = tests.BioFormatsInfoTest(target)
# test = tests.TiffTag306DateTimeTest(target)
# mocker.patch.object(test, "_find_process_outputs", return_value=fail_outputs)
# test_status = test.get_status()
# assert test_status == TestStatus.FAIL


# def test_that_the_ome_xml_schema_test_command_is_produced(test_targets):
# def test_that_the_tiffdatetimetest_command_is_produced(test_targets):
# target = test_targets["tiff"]
# test = tests.OmeXmlSchemaTest(target)
# test = tests.TiffDateTimeTest(target)
# process = test.generate_process()
# assert "xmlvalid" in process.command
# assert "grep" in process.command


# def test_that_the_ome_xml_info_test_correctly_interprets_exit_code_0_and_1(
# def test_that_the_tiffdatetimetest_correctly_interprets_exit_code_0_and_1(
# test_files, mocker
# ):
# # 0 is pass, 1 is fail
# # 1 is pass, 0 is fail
# tiff_file = test_files["tiff"]
# target = SingleTarget(tiff_file)
# with TemporaryDirectory() as tmp_dir:
# path_0 = Path(tmp_dir, "code_0.txt")
# path_1 = Path(tmp_dir, "code_1.txt")
# path_0.write_text("0")
# path_1.write_text("1")
# pass_outputs = {"std_out": path_1, "std_err": path_1, "exit_code": path_0}
# fail_outputs = {"std_out": path_0, "std_err": path_0, "exit_code": path_1}
# fail_outputs = {"std_out": path_1, "std_err": path_1, "exit_code": path_0}
# pass_outputs = {"std_out": path_0, "std_err": path_0, "exit_code": path_1}

# test = tests.OmeXmlSchemaTest(target)
# test = tests.TiffDateTimeTest(target)
# mocker.patch.object(test, "_find_process_outputs", return_value=pass_outputs)
# test_status = test.get_status()
# assert test_status == TestStatus.PASS

# test = tests.OmeXmlSchemaTest(target)
# test = tests.TiffDateTimeTest(target)
# mocker.patch.object(test, "_find_process_outputs", return_value=fail_outputs)
# test_status = test.get_status()
# assert test_status == TestStatus.FAIL


# def test_that_the_tifftag306datetimetest_command_is_produced(test_targets):
# target = test_targets["tiff"]
# test = tests.TiffTag306DateTimeTest(target)
# def test_that_the_bioformats_info_test_exit_code_is_0_when_it_should_be(test_files):
# one_tiff_file = test_files["ome_tiff"]
# target = SingleTarget(one_tiff_file)
# test = tests.BioFormatsInfoTest(target)
# process = test.generate_process()
# assert "jq" in process.command
# executor = DockerExecutor(process.container, process.command, target.file.url)
# executor.execute()
# assert executor.exit_code == "0"


# def test_that_the_tifftag306datetimetest_correctly_interprets_exit_code_0_and_1(
# def test_that_the_bioformats_info_test_correctly_interprets_exit_code_0_and_1(
# test_files, mocker
# ):
# # 1 is pass, 0 is fail
# # 0 is pass, 1 is fail
# tiff_file = test_files["tiff"]
# target = SingleTarget(tiff_file)
# with TemporaryDirectory() as tmp_dir:
# path_0 = Path(tmp_dir, "code_0.txt")
# path_1 = Path(tmp_dir, "code_1.txt")
# path_0.write_text("0")
# path_1.write_text("1")
# fail_outputs = {"std_out": path_1, "std_err": path_1, "exit_code": path_0}
# pass_outputs = {"std_out": path_0, "std_err": path_0, "exit_code": path_1}
# pass_outputs = {"std_out": path_1, "std_err": path_1, "exit_code": path_0}
# fail_outputs = {"std_out": path_0, "std_err": path_0, "exit_code": path_1}

# test = tests.TiffTag306DateTimeTest(target)
# test = tests.BioFormatsInfoTest(target)
# mocker.patch.object(test, "_find_process_outputs", return_value=pass_outputs)
# test_status = test.get_status()
# assert test_status == TestStatus.PASS

# test = tests.TiffTag306DateTimeTest(target)
# test = tests.BioFormatsInfoTest(target)
# mocker.patch.object(test, "_find_process_outputs", return_value=fail_outputs)
# test_status = test.get_status()
# assert test_status == TestStatus.FAIL


# def test_that_the_tiffdatetimetest_command_is_produced(test_targets):
# def test_that_the_ome_xml_schema_test_command_is_produced(test_targets):
# target = test_targets["tiff"]
# test = tests.TiffDateTimeTest(target)
# test = tests.OmeXmlSchemaTest(target)
# process = test.generate_process()
# assert "grep" in process.command
# assert "xmlvalid" in process.command


# def test_that_the_tiffdatetimetest_correctly_interprets_exit_code_0_and_1(
# def test_that_the_ome_xml_schema_test_exit_code_is_0_when_it_should_be(test_files):
# tiff_file = test_files["ome_tiff"]
# target = SingleTarget(tiff_file)
# test = tests.OmeXmlSchemaTest(target)
# process = test.generate_process()
# executor = DockerExecutor(process.container, process.command, target.file.url)
# executor.execute()
# assert executor.exit_code == "0"


# def test_that_the_ome_xml_info_test_correctly_interprets_exit_code_0_and_1(
# test_files, mocker
# ):
# # 1 is pass, 0 is fail
# # 0 is pass, 1 is fail
# tiff_file = test_files["tiff"]
# target = SingleTarget(tiff_file)
# with TemporaryDirectory() as tmp_dir:
# path_0 = Path(tmp_dir, "code_0.txt")
# path_1 = Path(tmp_dir, "code_1.txt")
# path_0.write_text("0")
# path_1.write_text("1")
# fail_outputs = {"std_out": path_1, "std_err": path_1, "exit_code": path_0}
# pass_outputs = {"std_out": path_0, "std_err": path_0, "exit_code": path_1}
# pass_outputs = {"std_out": path_1, "std_err": path_1, "exit_code": path_0}
# fail_outputs = {"std_out": path_0, "std_err": path_0, "exit_code": path_1}

# test = tests.TiffDateTimeTest(target)
# test = tests.OmeXmlSchemaTest(target)
# mocker.patch.object(test, "_find_process_outputs", return_value=pass_outputs)
# test_status = test.get_status()
# assert test_status == TestStatus.PASS

# test = tests.TiffDateTimeTest(target)
# test = tests.OmeXmlSchemaTest(target)
# mocker.patch.object(test, "_find_process_outputs", return_value=fail_outputs)
# test_status = test.get_status()
# assert test_status == TestStatus.FAIL

0 comments on commit 2cda95c

Please sign in to comment.