Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to skip cover compilation for small tests #3382

Merged
merged 6 commits into from
Nov 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ jobs:
description: Version of the Erlang package to install
environment:
PRESET: small_tests
SKIP_AUTO_COMPILE: true
steps:
- checkout
- fetch_packages
Expand All @@ -277,7 +278,7 @@ jobs:
- run:
name: Run Small Tests
command: |
SKIP_AUTO_COMPILE=true KEEP_COVER_RUNNING=1 ./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 +319,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 +341,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 +458,15 @@ jobs:
parallelism: 1
environment:
PRESET: small_tests
SKIP_AUTO_COMPILE: true
steps:
- restore_workspace
- install_dockerize
- dockerize_wait: {port: 6379}
- run:
name: Run Small Tests
command: |
SKIP_AUTO_COMPILE=true KEEP_COVER_RUNNING=1 ./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 +498,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 +510,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 +534,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 +547,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 +559,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 +584,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
1 change: 0 additions & 1 deletion rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@

{dialyzer, [{plt_extra_apps, [jid, cowboy, lasse, p1_utils, ranch, gen_fsm_compat, epgsql]}]}.

{cover_enabled, true}.
{cover_print_enabled, true}.
{cover_export_enabled, true}.
{coveralls_coverdata, "/tmp/*.coverdata"}.
Expand Down
15 changes: 8 additions & 7 deletions tools/test-runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,13 @@ TEST_HOSTS_DEFAULT="${TEST_HOSTS_ARRAY[@]}"

./tools/configure with-all

# Pass extra arguments from tools/test_runner/selected-tests-to-test-spec.sh
# to rebar3 in Makefile
REBAR_CT_EXTRA_ARGS=""
if [[ -f "auto_small_tests.spec" ]]; then
REBAR_CT_EXTRA_ARGS=" --spec \"$(pwd)/auto_small_tests.spec\" $REBAR_CT_EXTRA_ARGS"
fi

# Allow user to pass PRESET and DB as an env variable
# (or use default value)
# "${parameter-word}" means:
Expand All @@ -612,13 +619,7 @@ export TEST_HOSTS="${TEST_HOSTS-$TEST_HOSTS_DEFAULT}"
export BUILD_TESTS="$BUILD_TESTS"
export BUILD_MIM="$BUILD_MIM"
export TLS_DIST="$TLS_DIST"
# Pass extra arguments from tools/test_runner/selected-tests-to-test-spec.sh
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved it above, so we have all exports in one place

# to rebar3 in Makefile
if [[ -f "auto_small_tests.spec" ]]; then
export REBAR_CT_EXTRA_ARGS=" --spec \"$(pwd)/auto_small_tests.spec\" "
else
export REBAR_CT_EXTRA_ARGS=""
fi
export REBAR_CT_EXTRA_ARGS="$REBAR_CT_EXTRA_ARGS"
export SRC_TESTSPEC="$SRC_TESTSPEC"
export TESTSPEC="auto_big_tests.spec"
export START_NODES="$START_NODES"
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