diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e319384..33af5b4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: @@ -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 diff --git a/tests/test_external_tests.py b/tests/test_external_tests.py index c51d2f2..91999f7 100644 --- a/tests/test_external_tests.py +++ b/tests/test_external_tests.py @@ -181,20 +181,27 @@ 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: @@ -202,31 +209,31 @@ def test_that_the_bioformats_info_test_command_is_produced(test_targets): # 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: @@ -234,31 +241,34 @@ def test_that_the_bioformats_info_test_command_is_produced(test_targets): # 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: @@ -266,31 +276,41 @@ def test_that_the_bioformats_info_test_command_is_produced(test_targets): # 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: @@ -298,15 +318,15 @@ def test_that_the_bioformats_info_test_command_is_produced(test_targets): # 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