diff options
author | Lovett, Trevor <trevor.lovett@att.com> | 2019-02-21 11:28:13 -0600 |
---|---|---|
committer | Lovett, Trevor (tl2972) <tl2972@att.com> | 2019-02-21 11:28:13 -0600 |
commit | ed9ad702cff64e3098ac54286bf0f40cdf277a44 (patch) | |
tree | cd7fcda48fd1180a379199c605986b29c85c7300 | |
parent | 6514c64020adb013ad383521391576bc5495cca7 (diff) |
[VVP] JSON report shows relative paths for "files"
Template path is also normalized to Unix style path separators.
Change-Id: I2961e09300ed5ab8487bb21b8a302c7b55594474
Issue-ID: VVP-169
Signed-off-by: Lovett, Trevor (tl2972) <tl2972@att.com>
-rw-r--r-- | ice_validator/tests/conftest.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ice_validator/tests/conftest.py b/ice_validator/tests/conftest.py index 3ab1aba..2c88ece 100644 --- a/ice_validator/tests/conftest.py +++ b/ice_validator/tests/conftest.py @@ -714,6 +714,10 @@ def collect_errors(r_id, collection_failures, test_result): return [e for e in errors if e] +def relative_paths(base_dir, paths): + return [os.path.relpath(p, base_dir) for p in paths] + + def generate_json(outpath, template_path, categories): """ Creates a JSON summary of the entire test run. @@ -721,7 +725,9 @@ def generate_json(outpath, template_path, categories): reqs = load_current_requirements() data = { "version": "dublin", - "template_directory": template_path, + "template_directory": os.path.splitdrive(template_path)[1].replace( + os.path.sep, "/" + ), "timestamp": make_iso_timestamp(), "checksum": hash_directory(template_path), "categories": categories, @@ -745,7 +751,7 @@ def generate_json(outpath, template_path, categories): for result in ALL_RESULTS: results.append( { - "files": result.files, + "files": relative_paths(template_path, result.files), "test_module": result.test_module, "test_case": result.test_case, "result": result.outcome, |