diff options
Diffstat (limited to '.gitlab/ci/frontend.gitlab-ci.yml')
-rw-r--r-- | .gitlab/ci/frontend.gitlab-ci.yml | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/.gitlab/ci/frontend.gitlab-ci.yml b/.gitlab/ci/frontend.gitlab-ci.yml index 2afa69bbff8..9d78fb102f9 100644 --- a/.gitlab/ci/frontend.gitlab-ci.yml +++ b/.gitlab/ci/frontend.gitlab-ci.yml @@ -153,7 +153,7 @@ retrieve-frontend-fixtures: - run_timed_command "gem install knapsack --no-document" - section_start "gitaly-test-spawn" "Spawning Gitaly"; scripts/gitaly-test-spawn; section_end "gitaly-test-spawn"; # Do not use 'bundle exec' here - source ./scripts/rspec_helpers.sh - - rspec_paralellized_job + - rspec_parallelized_job artifacts: name: frontend-fixtures expire_in: 31d @@ -306,6 +306,42 @@ jest-integration: - run_timed_command "yarn jest:integration --ci" needs: ["rspec-all frontend_fixture", "graphql-schema-dump"] +jest-snapshot-vue3: + extends: + - .jest-base + - .frontend:rules:jest-snapshot + needs: ["rspec-all frontend_fixture"] + variables: + VUE_VERSION: 3 + JEST_REPORT: jest-test-report.json + SNAPSHOT_TEST_REPORT: jest-snapshot-test-report.json + script: + - | + yarn jest:snapshots --ci --json --outputFile="${JEST_REPORT}" || echo 'Proceed to parsing test report...' + echo $(ruby -rjson -e 'puts JSON.generate(JSON.parse(File.read(ENV["JEST_REPORT"])).dig("snapshot"))') > "${SNAPSHOT_TEST_REPORT}" + + echo " ============= snapshot test report start ==============" + cat "${SNAPSHOT_TEST_REPORT}" + echo " ============= snapshot test report end ================" + + snapshot_test_failed=$(ruby -rjson -e 'puts JSON.parse(File.read(ENV["SNAPSHOT_TEST_REPORT"])).dig("failure")') + if [[ "${snapshot_test_failed}" == "true" ]] + then + echo "You have failed snapshot tests! Exiting 1..." + exit 1 + else + echo 'All snapshot tests passed! Exiting 0...' + exit 0 + fi + + artifacts: + name: snapshot_tests + expire_in: 31d + when: always + paths: + - jest-snapshot-test-match.json + - jest-snapshot-test-report.json + coverage-frontend: extends: - .default-retry |