From 9108acb35ebdfa377b9889feaa20b91d677398fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Chrz=C4=85szcz?= Date: Thu, 15 Dec 2022 08:18:59 +0100 Subject: [PATCH] Store test results for CircleCI Test Insights The Insights need results in the JUnit XML format. This can be achieved by using the 'cth_surefire' hook. It is enabled for OTP 25, and not for OTP 24, because on the latter the test would become so slow, that the build would take more than an hour. There is no such issue on Erlang/OTP 25. --- .circleci/template.yml | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/.circleci/template.yml b/.circleci/template.yml index 6a91c59d36..3f8d30643a 100644 --- a/.circleci/template.yml +++ b/.circleci/template.yml @@ -560,11 +560,16 @@ jobs: type: boolean description: Erlang distribution with TLS enabled default: false + store_results: + type: boolean + description: Collect and store test results in JUnit XML format for Insights + default: false environment: TESTSPEC: <> PRESET: <> DB: <> TLS_DIST: <> + STORE_RESULTS: <> SKIP_AUTO_COMPILE: true KEEP_COVER_RUNNING: 1 steps: @@ -581,8 +586,23 @@ jobs: - run: name: Run Big Tests command: | - ./tools/test.sh -p $PRESET -s false + if $STORE_RESULTS; then + ./tools/test.sh -p $PRESET -h cth_surefire -s false + else + ./tools/test.sh -p $PRESET -s false + fi no_output_timeout: 40m + - when: + condition: <> + steps: + - run: + when: always + name: Copy test results for Insights + command: | + cp big_tests/ct_report/*/junit_report.xml . + - store_test_results: + when: always + path: junit_report.xml - run_coverage_analysis - run: name: Build Failed - Logs @@ -756,6 +776,7 @@ workflows: requires: - otp_25_docker filters: *all_tags + store_results: true - big_tests_in_docker: name: mysql_redis_25 executor: otp_25_mysql_redis @@ -764,6 +785,7 @@ workflows: requires: - otp_25_docker filters: *all_tags + store_results: true - big_tests_in_docker: name: dynamic_domains_mysql_redis_25 spec: dynamic_domains.spec @@ -773,6 +795,7 @@ workflows: requires: - otp_25_docker filters: *all_tags + store_results: true - big_tests_in_docker: name: pgsql_mnesia_24 executor: otp_24_pgsql_redis @@ -789,6 +812,7 @@ workflows: requires: - otp_25_docker filters: *all_tags + store_results: true - big_tests_in_docker: name: dynamic_domains_pgsql_mnesia_25 spec: dynamic_domains.spec @@ -798,6 +822,7 @@ workflows: requires: - otp_25_docker filters: *all_tags + store_results: true - big_tests_in_docker: name: dynamic_domains_pgsql_mnesia_24 spec: dynamic_domains.spec @@ -816,6 +841,7 @@ workflows: requires: - otp_25_docker filters: *all_tags + store_results: true - big_tests_in_docker: name: dynamic_domains_mssql_mnesia_25 spec: dynamic_domains.spec @@ -826,6 +852,7 @@ workflows: requires: - otp_25_docker filters: *all_tags + store_results: true - big_tests_in_docker: name: riak_mnesia_24 executor: otp_24_riak_redis @@ -853,6 +880,7 @@ workflows: requires: - otp_25_docker filters: *all_tags + store_results: true - big_tests_in_docker: name: elasticsearch_and_cassandra_25 executor: otp_25_elasticsearch_cassandra @@ -862,6 +890,7 @@ workflows: requires: - otp_25_docker filters: *all_tags + store_results: true # ============= DOCKER IMAGE BUILD & UPLOAD ============= - docker_image: name: docker_build_and_ship