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

refactor(run-versioned-tests.sh): added ability to run versioned tests and skip collecting coverage by passing in C8 env var to the job. #1621

Merged
merged 2 commits into from
May 8, 2023
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
5 changes: 3 additions & 2 deletions .c8rc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"reporter": ["html", "lcov"],
"exclude": ["test/*", "*.mjs", "**/*.mjs"]
"reporter": ["lcov"],
bizob2828 marked this conversation as resolved.
Show resolved Hide resolved
"exclude": ["test/*", "*.mjs", "**/*.mjs"],
"clean": true
}
1 change: 1 addition & 0 deletions .github/workflows/versioned-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
env:
VERSIONED_MODE: --major
JOBS: 4 # 2 per CPU seems to be the sweet spot in GHA (July 2022)
SKIP_C8: true

versioned:
runs-on: ubuntu-latest
Expand Down
24 changes: 17 additions & 7 deletions bin/run-versioned-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ set -x
VERSIONED_MODE="${VERSIONED_MODE:---minor}"
SAMPLES="${SAMPLES:-10}"
export NODE_OPTIONS="--max-old-space-size=4096"
SKIP_C8="${SKIP_C8:-false}"

# Determine context manager for sanity sake
if [[ $NEW_RELIC_FEATURE_FLAG_ASYNC_LOCAL_CONTEXT == 1 ]];
Expand All @@ -33,15 +34,23 @@ else
)
fi

# C8 runs out of heap when running against
# patch/minor flag. We will just skip it
# and figure out another way to get coverage
# when running on main branch.
if [[ $VERSIONED_MODE == '--major' ]];
# No coverage as env var is true
# set C8 to ""
if [[ "${SKIP_C8}" = "true" ]];
then
C8="c8 -o ./coverage/versioned"
else
C8=""
else
# C8 runs out of heap when running against
# patch/minor flag. We will just skip it
# and figure out another way to get coverage
# when running on main branch.
if [[ $VERSIONED_MODE == '--major' ]];
then
# lcovonly only generates lcov report which will cut down on amount of time generating reports
C8="c8 -o ./coverage/versioned -r lcovonly"
else
C8=""
fi
fi

export AGENT_PATH=`pwd`
Expand All @@ -50,6 +59,7 @@ export AGENT_PATH=`pwd`
echo "JOBS = ${JOBS}"
echo "NPM7 = ${NPM7}"
echo "CONTEXT MANAGER = ${CTX_MGR}"
echo "C8 = ${C8}"

# if $JOBS is not empy
if [ ! -z "$JOBS" ];
Expand Down