From e3b674a42eff5038dc8f9aee249ad03b71e36d0c Mon Sep 17 00:00:00 2001 From: Tomas Susanka Date: Wed, 4 Mar 2020 12:33:34 +0000 Subject: [PATCH] ci: move ui reports to the root to simplify artifacts browsing I wanted to use a symlink but that does not seem to work on GitLab https://gitlab.com/gitlab-org/gitlab-runner/issues/4241. --- ci/posttest.yml | 3 ++- ci/prepare_ui_artifacts.py | 8 ++++---- ci/test.yml | 7 ++++--- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/ci/posttest.yml b/ci/posttest.yml index 7e3456e2e0..ba81f49852 100644 --- a/ci/posttest.yml +++ b/ci/posttest.yml @@ -30,8 +30,9 @@ core unix ui changes: script: - cd tests/ui_tests - pipenv run python reporting/report_master_diff.py + - mv reporting/reports/master_diff/ ../.. artifacts: name: core-unix-ui-changes paths: - - tests/ui_tests/reporting/reports/master_diff + - master_diff expire_in: 1 week diff --git a/ci/prepare_ui_artifacts.py b/ci/prepare_ui_artifacts.py index 9f484ab363..c969080185 100644 --- a/ci/prepare_ui_artifacts.py +++ b/ci/prepare_ui_artifacts.py @@ -13,9 +13,9 @@ def _hash_files(path): return hasher.digest().hex() -root = Path().cwd() / "../tests/ui_tests" -screens = root / "screens" -fixtures = root / "fixtures.json" +root = Path(__file__).parent / ".." +screens = root / "tests/ui_tests/screens" +fixtures = root / "tests/ui_tests/fixtures.json" hashes = json.loads(fixtures.read_text()) @@ -24,4 +24,4 @@ for test_case in hashes.keys(): expected_hash = hashes[test_case] actual_hash = _hash_files(recorded_dir) assert expected_hash == actual_hash - shutil.make_archive("ui_test_records/" + actual_hash, "zip", recorded_dir) + shutil.make_archive(root / "ci/ui_test_records" / actual_hash, "zip", recorded_dir) diff --git a/ci/test.yml b/ci/test.yml index 1bdd97ac02..1023a503ea 100644 --- a/ci/test.yml +++ b/ci/test.yml @@ -19,13 +19,14 @@ core device ui test: script: - cd core - pipenv run make test_emu_ui - - cd ../ci - - pipenv run python prepare_ui_artifacts.py + - cd .. + - mv tests/ui_tests/reporting/reports/test/ test_ui_report + - pipenv run python ci/prepare_ui_artifacts.py artifacts: name: core-device-ui-test paths: - ci/ui_test_records/ - - tests/ui_tests/reporting/reports/test/ + - test_ui_report - tests/ui_tests/screens/ - tests/junit.xml - tests/trezor.log