Skip to content

Commit

Permalink
Use COVER_ENABLED variable to enable cover (on by default)
Browse files Browse the repository at this point in the history
Clean up env variables for circleci
  • Loading branch information
arcusfelis committed Nov 3, 2021
1 parent 2c616cd commit 09cd99d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
24 changes: 16 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,8 @@ jobs:
description: Version of the Erlang package to install
environment:
PRESET: small_tests
SKIP_AUTO_COMPILE: true
KEEP_COVER_RUNNING: 1
steps:
- checkout
- fetch_packages
Expand All @@ -277,7 +279,7 @@ jobs:
- run:
name: Run Small Tests
command: |
SKIP_AUTO_COMPILE=true KEEP_COVER_RUNNING=1 REBAR_CT_EXTRA_ARGS=" -c " ./tools/test.sh -p small_tests -s true -e true
./tools/test.sh -p small_tests -s true -e true
- run_coverage_analysis
- upload_results_to_aws
- publish_github_comment
Expand Down Expand Up @@ -318,6 +320,8 @@ jobs:
CASSANDRA_VERSION: 3.9
TESTSPEC: <<parameters.spec>>
REDIS_VERSION: 3.2.10
SKIP_AUTO_COMPILE: true
KEEP_COVER_RUNNING: 1
steps:
- checkout
- fetch_packages
Expand All @@ -338,7 +342,7 @@ jobs:
- run:
name: Run Big Tests
command: |
SKIP_AUTO_COMPILE=true KEEP_COVER_RUNNING=1 ./tools/test.sh -p $PRESET -s false
./tools/test.sh -p $PRESET -s false
no_output_timeout: 40m
- run_coverage_analysis
- run:
Expand Down Expand Up @@ -455,14 +459,16 @@ jobs:
parallelism: 1
environment:
PRESET: small_tests
SKIP_AUTO_COMPILE: true
KEEP_COVER_RUNNING: 1
steps:
- restore_workspace
- install_dockerize
- dockerize_wait: {port: 6379}
- run:
name: Run Small Tests
command: |
SKIP_AUTO_COMPILE=true KEEP_COVER_RUNNING=1 REBAR_CT_EXTRA_ARGS=" -c " ./tools/test.sh -p small_tests -s true -e true
./tools/test.sh -p small_tests -s true -e true
- run_coverage_analysis
- upload_results_to_aws
- publish_github_comment
Expand Down Expand Up @@ -494,6 +500,8 @@ jobs:
ELASTICSEARCH_VERSION: 5.6.9
CASSANDRA_VERSION: 3.9
REDIS_VERSION: 3.2.10
SKIP_AUTO_COMPILE: true
KEEP_COVER_RUNNING: 1
steps:
- restore_workspace
- install_dockerize
Expand All @@ -504,7 +512,7 @@ jobs:
- run:
name: Run Big Tests
command: |
SKIP_AUTO_COMPILE=true KEEP_COVER_RUNNING=1 ./tools/test.sh -p $PRESET -s false
./tools/test.sh -p $PRESET -s false
no_output_timeout: 40m
- run_coverage_analysis
- run:
Expand All @@ -528,7 +536,7 @@ jobs:
- run:
name: Run Dialyzer
command: |
SKIP_AUTO_COMPILE=true KEEP_COVER_RUNNING=1 ./tools/test.sh -p dialyzer_only -s false
./tools/test.sh -p dialyzer_only -s false
xref:
executor: << parameters.executor >>
Expand All @@ -541,7 +549,7 @@ jobs:
- run:
name: Run Xref
command: |
SKIP_AUTO_COMPILE=true KEEP_COVER_RUNNING=1 ./tools/test.sh -p xref_only -s false
./tools/test.sh -p xref_only -s false
edoc:
executor: << parameters.executor >>
parameters:
Expand All @@ -553,7 +561,7 @@ jobs:
- run:
name: Run Edoc
command: |
SKIP_AUTO_COMPILE=true KEEP_COVER_RUNNING=1 ./tools/test.sh -p edoc_only -s false
./tools/test.sh -p edoc_only -s false
package:
parallelism: 1
Expand All @@ -578,7 +586,7 @@ jobs:
- run:
name: Build package
command: |
KEEP_COVER_RUNNING=1 ./tools/test.sh -p pkg -s false
./tools/test.sh -p pkg -s false
filters: &all_tags
tags:
Expand Down
5 changes: 5 additions & 0 deletions tools/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ PRESET="${PRESET-$DEFAULT_PRESET}"
SMALL_TESTS="${SMALL_TESTS:-true}"
EUNIT_TESTS="${EUNIT_TESTS:-false}"
COVER_ENABLED="${COVER_ENABLED:-true}"
REBAR_CT_EXTRA_ARGS="${REBAR_CT_EXTRA_ARGS:-}"

while getopts ":p:s:e:c:" opt; do
case $opt in
Expand Down Expand Up @@ -81,6 +82,10 @@ choose_newest_directory() {
run_small_tests() {
tools/print-dots.sh start
tools/print-dots.sh monitor $$
if [ "$COVER_ENABLED" = true ]; then
REBAR_CT_EXTRA_ARGS=" -c $REBAR_CT_EXTRA_ARGS "
fi
export REBAR_CT_EXTRA_ARGS="$REBAR_CT_EXTRA_ARGS"
make ct
tools/print-dots.sh stop
SMALL_SUMMARIES_DIRS=${BASE}/_build/test/logs/ct_run*
Expand Down

0 comments on commit 09cd99d

Please sign in to comment.