cwltest.utils ============= .. py:module:: cwltest.utils Classes ------- .. autoapisummary:: cwltest.utils.CWLTestConfig cwltest.utils.CWLTestReport cwltest.utils.TestResult Functions --------- .. autoapisummary:: cwltest.utils.generate_badges cwltest.utils.get_test_number_by_key cwltest.utils.load_and_validate_tests cwltest.utils.parse_results cwltest.utils.prepare_test_command cwltest.utils.prepare_test_paths cwltest.utils.run_test_plain cwltest.utils.shortname cwltest.utils.absuri cwltest.utils.load_optional_fsaccess_plugin Module Contents --------------- .. py:class:: CWLTestConfig(entry, entry_line, basedir = None, test_baseuri = None, test_basedir = None, outdir = None, classname = None, tool = None, args = None, testargs = None, timeout = None, verbose = None, runner_quiet = None) Store configuration values for cwltest. .. py:attribute:: basedir :type: str .. py:attribute:: test_baseuri :type: str .. py:attribute:: test_basedir :type: str .. py:attribute:: outdir :type: str | None :value: None .. py:attribute:: classname :type: str :value: '' .. py:attribute:: entry .. py:attribute:: tool :type: str :value: 'cwl-runner' .. py:attribute:: args :type: list[str] :value: [] .. py:attribute:: testargs :type: list[str] :value: [] .. py:attribute:: timeout :type: int | None :value: None .. py:attribute:: verbose :type: bool :value: False .. py:attribute:: runner_quiet :type: bool :value: True .. py:class:: CWLTestReport(id, category, entry, tool, job) Encapsulate relevant test result data for a markdown report. .. py:attribute:: id .. py:attribute:: category .. py:attribute:: entry .. py:attribute:: tool .. py:attribute:: job .. py:class:: TestResult(return_code, standard_output, error_output, duration, classname, entry, tool, job, message = '') Encapsulate relevant test result data. .. py:attribute:: return_code .. py:attribute:: standard_output .. py:attribute:: error_output .. py:attribute:: duration .. py:attribute:: message :value: '' .. py:attribute:: classname .. py:attribute:: entry .. py:attribute:: tool .. py:attribute:: job .. py:method:: create_test_case(test) Create a jUnit XML test case from this test result. .. py:method:: create_report_entry(test) Package test result into a CWLTestReport. .. py:function:: generate_badges(badgedir, ntotal, npassed, nfailures, nunsupported) Generate badges with conformance levels. .. py:function:: get_test_number_by_key(tests, key, value) Retrieve the test index from its name. .. py:function:: load_and_validate_tests(path) Load and validate the given test file against the cwltest schema. This also processes $import directives. .. py:function:: parse_results(results, tests, suite_name = None, report = None) Parse the results and return statistics and an optional report. An additional tag named "all" will be computed, containing all the test results. Returns the total number of tests, dictionary of test counts (total, passed, failed, unsupported) by tag, and a jUnit XML report. .. py:function:: prepare_test_command(tool, args, testargs, test, cwd, quiet = True) Turn the test into a command line. .. py:function:: prepare_test_paths(test, cwd) Determine the test path and the tool path. .. py:function:: run_test_plain(config, test, test_number = None) Plain test runner. .. py:function:: shortname(name) Return the short name of a given name. It is a workaround of https://github.com/common-workflow-language/schema_salad/issues/511. .. py:function:: absuri(path) Return an absolute URI. .. py:function:: load_optional_fsaccess_plugin() Load optional fsaccess plugin. Looks for a package with cwltest.fsaccess entry point and if so, use that to get a filesystem access object that will be used for checking test output.