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 2 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
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,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
SKIP_AUTO_COMPILE=true KEEP_COVER_RUNNING=1 REBAR_CT_EXTRA_ARGS=" -c " ./tools/test.sh -p small_tests -s true -e true
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmmm... what about github actions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

do we gather cover for github actions?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Huh, good question, no idea 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

probably no, or at least not codecov service (so it does not cause interference).

I could add it though:

  • it would make scripts more similar in feature set
  • it would make execution a bit slower :)

I could also add an env-var COVER_ENABLED instead of that REBAR_CT_EXTRA_ARGS and maybe set it explicitly to 0 on github actions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done ;)
Now we just use COVER_ENABLED=false to be passed into tools/test.sh.
I also cleaned other env vars in circleci config.

- run_coverage_analysis
- upload_results_to_aws
- publish_github_comment
Expand Down Expand Up @@ -462,7 +462,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
SKIP_AUTO_COMPILE=true KEEP_COVER_RUNNING=1 REBAR_CT_EXTRA_ARGS=" -c " ./tools/test.sh -p small_tests -s true -e true
- run_coverage_analysis
- upload_results_to_aws
- publish_github_comment
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
18 changes: 11 additions & 7 deletions tools/test-runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,16 @@ 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
if [[ -f "auto_small_tests.spec" ]]; then
REBAR_CT_EXTRA_ARGS=" --spec \"$(pwd)/auto_small_tests.spec\" $REBAR_CT_EXTRA_ARGS"
fi

if [ "$COVER_ENABLED" = true ]; then
REBAR_CT_EXTRA_ARGS=" -c "
fi

# Allow user to pass PRESET and DB as an env variable
# (or use default value)
# "${parameter-word}" means:
Expand All @@ -612,13 +622,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