-
-
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.
- Loading branch information
Showing
10 changed files
with
85 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[run] | ||
branch = True | ||
source = cwltest | ||
omit = cwltest/tests/* | ||
|
||
[report] | ||
exclude_lines = | ||
if self.debug: | ||
pragma: no cover | ||
raise NotImplementedError | ||
if __name__ == .__main__.: | ||
ignore_errors = True | ||
omit = | ||
cwltest/tests/* |
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,5 @@ | ||
class: CommandLineTool | ||
cwlVersion: v1.0 | ||
inputs: [] | ||
outputs: [] | ||
baseCommand: [sleep, "15"] |
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/empty.json | ||
output: | ||
output_txt: | ||
class: File | ||
checksum: sha1$47a013e660d408619d894b20806b1d5086aab03b | ||
location: output.txt | ||
size: 13 | ||
tool: timeout.cwl | ||
doc: Test of timeout stdout and stderr capture |
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 @@ | ||
{} |
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,42 @@ | ||
import re | ||
import os | ||
from os import linesep as n | ||
from os import sep as p | ||
from pathlib import Path | ||
|
||
import defusedxml.ElementTree as ET | ||
|
||
from .util import run_with_mock_cwl_runner, get_data | ||
import schema_salad.ref_resolver | ||
|
||
|
||
def test_timeout_stderr_stdout(tmp_path): | ||
junit_xml_report = tmp_path / "junit-report.xml" | ||
|
||
args = [ | ||
"--test", | ||
schema_salad.ref_resolver.file_uri(get_data("tests/test-data/timeout.yml")), | ||
"--timeout", | ||
"5", | ||
"--junit-xml", | ||
str(junit_xml_report), | ||
] | ||
try: | ||
cwd = os.getcwd() | ||
os.chdir(get_data("tests/test-data/")) | ||
error_code, stdout, stderr = run_with_mock_cwl_runner(args) | ||
finally: | ||
os.chdir(cwd) | ||
|
||
assert error_code == 1 | ||
assert "Test 1 timed out" in stderr | ||
tree = ET.parse(junit_xml_report) | ||
try: | ||
root = tree.getroot() | ||
timeout_text = root.find("testsuite").find("testcase").find("failure").text | ||
timeout_stderr = root.find("testsuite").find("testcase").find("system-err").text | ||
assert "Test timed out" in timeout_text | ||
assert "timeout stderr" in timeout_stderr | ||
except AttributeError as e: | ||
print(junit_xml_report.read_text()) | ||
raise e |
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 |
---|---|---|
@@ -1,3 +1,2 @@ | ||
pytest >= 6.2, < 6.3 | ||
pytest-cov | ||
pytest-xdist |
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