print >> sys.stderr, 'Launched job contains tasks.' print >> sys.stderr, launched_job['task-id'] sys.exit(1) print 'Launched job: %s' % launched_job['job-id'] print print 'Checking output...' # Check the results RESULT_EXPECTED = """ VAR1=VAL1 VAR2=VAL2 VAR3=VAL3 VAR4=VAL4 VAR5=VAL5 """.lstrip() RESULT = test_util.gsutil_cat(test.STDOUT_LOG) if not test_util.diff(RESULT_EXPECTED, RESULT): print 'Output file does not match expected' sys.exit(1) print print 'Output file matches expected:' print '*****************************' print RESULT print '*****************************' print 'SUCCESS'
INPUT_BAMS = ('NA06986.chromY.ILLUMINA.bwa.CEU.exon_targetted.20100311.bam', 'NA06986.chrom21.ILLUMINA.bwa.CEU.exon_targetted.20100311.bam', 'NA06986.chrom18.ILLUMINA.bwa.CEU.exon_targetted.20100311.bam') RESULTS_EXPECTED = ('4afb9b8908959dbd4e2d5c54bf254c93', '0dc006ed39ddad2790034ca497631234', '36e37a0dab5926dbf5a1b8afc0cdac8b') for i in range(len(INPUT_BAMS)): INPUT_BAM = INPUT_BAMS[i] RESULT_EXPECTED = RESULTS_EXPECTED[i] OUTPUT_PATH = test_util.get_field_from_tsv( test.TASKS_FILE, '--input INPUT_PATH', r'^.*/%s$' % INPUT_BAM, '--output OUTPUT_PATH') OUTPUT_FILE = '%s/%s.md5' % (OUTPUT_PATH[:-len('/*.md5')], INPUT_BAM) RESULT = test_util.gsutil_cat(OUTPUT_FILE) if not test_util.diff(RESULT_EXPECTED.strip(), RESULT.strip()): print 'Output file does not match expected' sys.exit(1) print print 'Output file matches expected:' print '*****************************' print 'RESULT' print '*****************************' print 'SUCCESS'
# pyformat: disable job_after = test.run_dsub([ '--command', 'echo "does not matter"', '--after', bad_job_previous['job-id'] ]) # pyformat: enable print >> sys.stderr, 'Expected to throw a PredecessorJobFailureError' sys.exit(1) except dsub_errors.PredecessorJobFailureError as e: if len(e.error_list) != 1: print >> sys.stderr, 'Expected 1 error from previous job, got: %s' % ( e.error_list) sys.exit(1) print print 'Checking output...' RESULT = test_util.gsutil_cat(TEST_FILE_PATH_2) if 'hello world' not in RESULT: print 'Output file does not match expected' sys.exit(1) print print 'Output file matches expected:' print '*****************************' print RESULT print '*****************************' print 'SUCCESS'