Skip to content

Commit a1f94d6

Browse files
committed
changed docker image to one in GHCR
1 parent 27bd496 commit a1f94d6

File tree

2 files changed

+44
-6
lines changed

2 files changed

+44
-6
lines changed

src/dcqc/tests/h5ad_htan_validator_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ class H5adHtanValidatorTest(ExternalBaseTest):
99
"""
1010

1111
tier = TestTier.INTERNAL_CONFORMANCE
12-
pass_code = 1
13-
fail_code = 0
12+
pass_code = 0
13+
fail_code = 1
1414
failure_reason_location = "std_out"
1515
target: SingleTarget
1616

@@ -22,7 +22,7 @@ def generate_process(self) -> Process:
2222
f"'{path.name}'",
2323
]
2424
process = Process(
25-
container="h5ad:latest",
25+
container="ghcr.io/sage-bionetworks-workflows/htan-h5ad-validator:0.1",
2626
command_args=command_args,
2727
)
2828
return process

tests/test_external_tests.py

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -446,27 +446,65 @@ def setup_method(self, test_targets):
446446
self.good_h5ad_test = tests.H5adHtanValidatorTest(self.good_h5ad_target)
447447
self.bad_h5ad_target = test_targets["htan_bad_h5ad"]
448448
self.bad_h5ad_test = tests.H5adHtanValidatorTest(self.bad_h5ad_target)
449+
self.txt_target = test_targets["good_txt"]
450+
self.txt_test = tests.H5adHtanValidatorTest(self.txt_target)
449451

450452
def test_that_the_command_is_produced(self):
451453
process = self.good_h5ad_test.generate_process()
452454
assert "/usr/local/bin/h5ad.py" in process.command
453455

454456
@docker_enabled_test
455-
def test_that_the_exit_code_is_0_when_it_should_be(self):
457+
def test_that_the_exit_code_is_1_when_it_should_be(self):
456458
process = self.bad_h5ad_test.generate_process()
457459
executor = DockerExecutor(
458460
process.container, process.command, self.bad_h5ad_target.file.url
459461
)
460462
executor.execute()
461-
assert executor.exit_code == "0"
463+
assert executor.std_out == (
464+
"HTAN h5ad File Validator\n"
465+
"File: htan_bad.h5ad\n"
466+
"Running cellxgene-schema\n"
467+
"Cellxgene run has errors. Please note errors or warnings in the output file.\n"
468+
"Running HTAN-specific validation\n"
469+
"HTAN Validation Failed.\n"
470+
"Please check output file for errors.\n"
471+
"\n"
472+
)
473+
assert executor.exit_code == "1"
462474

463475
@docker_enabled_test
464-
def test_that_the_exit_code_is_1_when_it_should_be(self):
476+
def test_that_the_exit_code_is_0_when_it_should_be(self):
465477
process = self.good_h5ad_test.generate_process()
466478
executor = DockerExecutor(
467479
process.container, process.command, self.good_h5ad_target.file.url
468480
)
469481
executor.execute()
482+
assert executor.std_out == (
483+
"HTAN h5ad File Validator\n"
484+
"File: htan_good.h5ad\n"
485+
"Running cellxgene-schema\n"
486+
"Cellxgene run successful. Please check the output file to see if warnings exist.\n"
487+
"Running HTAN-specific validation\n"
488+
"Validation Passed!\n"
489+
"\n"
490+
)
491+
assert executor.exit_code == "0"
492+
493+
@docker_enabled_test
494+
def test_that_wrong_file_type_has_1_exit_code(self):
495+
process = self.txt_test.generate_process()
496+
executor = DockerExecutor(
497+
process.container, process.command, self.txt_target.file.url
498+
)
499+
executor.execute()
500+
print(executor.std_out)
501+
assert executor.std_out == (
502+
"HTAN h5ad File Validator\n"
503+
"File: test.txt\n"
504+
"An error occurred while trying to open test.txt\n"
505+
"Unable to synchronously open file (file signature not found)\n"
506+
"\n"
507+
)
470508
assert executor.exit_code == "1"
471509

472510
def test_that_the_test_correctly_interprets_exit_code_0_and_1(

0 commit comments

Comments
 (0)