Skip to content

Commit

Permalink
Store test results for CircleCI Test Insights
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
chrzaszcz committed Dec 15, 2022
1 parent 8422b5c commit 9108acb
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion .circleci/template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: <<parameters.spec>>
PRESET: <<parameters.preset>>
DB: <<parameters.db>>
TLS_DIST: <<parameters.tls_dist>>
STORE_RESULTS: <<parameters.store_results>>
SKIP_AUTO_COMPILE: true
KEEP_COVER_RUNNING: 1
steps:
Expand All @@ -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: <<parameters.store_results>>
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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 9108acb

Please sign in to comment.