-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #51 from common-workflow-language/short-names
Add short names to cwltest and junit-xml
- Loading branch information
Showing
6 changed files
with
97 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
- job: v1.0/cat-job.json | ||
output: {} | ||
tool: return-0.cwl | ||
doc: Test with a short name | ||
short_name: opt-error | ||
tags: [ js, init_work_dir ] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
- job: v1.0/cat1-job.json | ||
output: {} | ||
tool: return-0.cwl | ||
doc: Test without a short name | ||
- job: v1.0/cat2-job.json | ||
output: {} | ||
tool: return-0.cwl | ||
doc: Test with a short name | ||
short_name: opt-error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import unittest | ||
|
||
import os | ||
|
||
from .util import run_with_mock_cwl_runner, get_data | ||
import xml.etree.ElementTree as ET | ||
|
||
|
||
class TestShortNames(unittest.TestCase): | ||
|
||
def test_stderr_output(self): | ||
args = ["--test", get_data("tests/test-data/short-names.yml")] | ||
error_code, stdout, stderr = run_with_mock_cwl_runner(args) | ||
self.assertIn("Test [1/1] opt-error: Test with a short name\n", stderr) | ||
|
||
def test_run_by_short_name(self): | ||
short_name = "opt-error" | ||
args = ["--test", get_data("tests/test-data/with-and-without-short-names.yml"), "-s", short_name] | ||
error_code, stdout, stderr = run_with_mock_cwl_runner(args) | ||
self.assertIn("Test [2/2] opt-error: Test with a short name", stderr) | ||
self.assertNotIn("Test [1/2]", stderr) | ||
|
||
def test_list_tests(self): | ||
args = ["--test", get_data("tests/test-data/with-and-without-short-names.yml"), "-l"] | ||
error_code, stdout, stderr = run_with_mock_cwl_runner(args) | ||
self.assertEquals("[1] Test without a short name\n" | ||
"[2] opt-error: Test with a short name\n", stdout) | ||
|
||
def test_short_name_in_junit_xml(self): | ||
junit_xml_report = get_data("tests/test-data/junit-report.xml") | ||
args = ["--test", get_data("tests/test-data/short-names.yml"), "--junit-xml", junit_xml_report] | ||
run_with_mock_cwl_runner(args) | ||
tree = ET.parse(junit_xml_report) | ||
root = tree.getroot() | ||
category = root.find("testsuite").find("testcase").attrib['file'] | ||
self.assertEquals(category, "opt-error") | ||
os.remove(junit_xml_report) |