diff --git a/.github/workflows/ci-core.yml b/.github/workflows/ci-core.yml index 7f5f0c091f8..c38ecd918ae 100644 --- a/.github/workflows/ci-core.yml +++ b/.github/workflows/ci-core.yml @@ -231,26 +231,14 @@ jobs: echo "COUNT=50" >> $GITHUB_ENV echo "FUZZ_TIMEOUT_MINUTES=10">> $GITHUB_ENV - - name: Install gotestloghelper - if: ${{ needs.filter.outputs.should-run-ci-core == 'true' }} - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/gotestloghelper@v1.50.0 - - name: Run tests if: ${{ needs.filter.outputs.should-run-ci-core == 'true' }} id: run-tests env: OUTPUT_FILE: ./output.txt - USE_TEE: false CL_DATABASE_URL: ${{ env.DB_URL }} run: ./tools/bin/${{ matrix.type.cmd }} ./... - - name: Print Filtered Test Results - if: ${{ failure() && needs.filter.outputs.should-run-ci-core == 'true' && steps.run-tests.conclusion == 'failure' }} - run: | - if [[ "${{ matrix.type.printResults }}" == "true" ]]; then - cat output.txt | gotestloghelper -ci - fi - - name: Print Races id: print-races if: ${{ failure() && matrix.type.cmd == 'go_core_race_tests' && needs.filter.outputs.should-run-ci-core == 'true' }} diff --git a/tools/bin/go_core_ccip_deployment_tests b/tools/bin/go_core_ccip_deployment_tests index 6f1ef8d01cf..de976741398 100755 --- a/tools/bin/go_core_ccip_deployment_tests +++ b/tools/bin/go_core_ccip_deployment_tests @@ -3,26 +3,18 @@ set -o pipefail set +e SCRIPT_PATH=`dirname "$0"`; SCRIPT_PATH=`eval "cd \"$SCRIPT_PATH\" && pwd"` -OUTPUT_FILE="../output.txt" -USE_TEE="${USE_TEE:-true}" +OUTPUT_FILE=${OUTPUT_FILE:-"../output.txt"} +EXTRA_FLAGS="" cd ./deployment || exit go mod download -echo "Failed tests and panics: ---------------------" +echo "Test execution results: ---------------------" echo "" + if [[ $GITHUB_EVENT_NAME == "schedule" ]]; then - if [[ $DEBUG == "true" ]]; then - go test -json ./... -covermode=atomic -coverpkg=./... -coverprofile=coverage.txt | tee $OUTPUT_FILE - else - go test -json ./... -covermode=atomic -coverpkg=./... -coverprofile=coverage.txt | cat > $OUTPUT_FILE - fi -else - if [[ $DEBUG == "true" ]]; then - go test ./... | tee $OUTPUT_FILE - else - go test ./... | cat > $OUTPUT_FILE - fi + EXTRA_FLAGS="-covermode=atomic -coverpkg=./... -coverprofile=coverage.txt" fi +go test ./... "$EXTRA_FLAGS" | tee $OUTPUT_FILE | grep -Ev '\[no test files\]|\[no tests to run\]' EXITCODE=${PIPESTATUS[0]} # Assert no known sensitive strings present in test logger output diff --git a/tools/bin/go_core_fuzz b/tools/bin/go_core_fuzz index 49aaf33b65e..65c9273a418 100755 --- a/tools/bin/go_core_fuzz +++ b/tools/bin/go_core_fuzz @@ -19,7 +19,7 @@ echo "timeout minutes: $FUZZ_TIMEOUT_MINUTES" echo "fuzz seconds: $FUZZ_SECONDS" echo "Failed fuzz tests and panics: ---------------------" echo "" -timeout "${FUZZ_TIMEOUT_MINUTES}"m ./fuzz/fuzz_all_native.py --ci --seconds "$FUZZ_SECONDS" --go_module_root ./ | tee $OUTPUT_FILE +timeout "${FUZZ_TIMEOUT_MINUTES}"m ./fuzz/fuzz_all_native.py --ci --seconds "$FUZZ_SECONDS" --go_module_root ./ | tee $OUTPUT_FILE | grep -Ev '\[no test files\]|\[no tests to run\]' EXITCODE=${PIPESTATUS[0]} # Assert no known sensitive strings present in test logger output diff --git a/tools/bin/go_core_race_tests b/tools/bin/go_core_race_tests index 2af12b86403..467dda4e92f 100755 --- a/tools/bin/go_core_race_tests +++ b/tools/bin/go_core_race_tests @@ -4,21 +4,9 @@ OUTPUT_FILE=${OUTPUT_FILE:-"./output.txt"} TIMEOUT="${TIMEOUT:-10s}" COUNT="${COUNT:-5}" -echo "Failed tests and panics: ---------------------" +echo "Test execution results: ---------------------" echo "" -if [[ $GITHUB_EVENT_NAME == "schedule" ]]; then - if [[ $DEBUG == "true" ]]; then - GORACE="log_path=$PWD/race" go test -json -race -shuffle on -timeout "$TIMEOUT" -count "$COUNT" $1 | tee $OUTPUT_FILE - else - GORACE="log_path=$PWD/race" go test -race -shuffle on -timeout "$TIMEOUT" -count "$COUNT" $1 | cat > $OUTPUT_FILE - fi -else - if [[ $DEBUG == "true" ]]; then - GORACE="log_path=$PWD/race" go test -json -race -shuffle on -timeout "$TIMEOUT" -count "$COUNT" $1 | tee $OUTPUT_FILE - else - GORACE="log_path=$PWD/race" go test -race -shuffle on -timeout "$TIMEOUT" -count "$COUNT" $1 | cat > $OUTPUT_FILE - fi -fi +GORACE="log_path=$PWD/race" go test -race -shuffle on -timeout "$TIMEOUT" -count "$COUNT" $1 | cat > $OUTPUT_FILE EXITCODE=${PIPESTATUS[0]} diff --git a/tools/bin/go_core_tests b/tools/bin/go_core_tests index 92e32b4ae94..0fffcb72a39 100755 --- a/tools/bin/go_core_tests +++ b/tools/bin/go_core_tests @@ -4,22 +4,14 @@ set +e SCRIPT_PATH=`dirname "$0"`; SCRIPT_PATH=`eval "cd \"$SCRIPT_PATH\" && pwd"` OUTPUT_FILE=${OUTPUT_FILE:-"./output.txt"} +EXTRA_FLAGS="" -echo "Failed tests and panics: ---------------------" +echo "Test execution results: ---------------------" echo "" if [[ $GITHUB_EVENT_NAME == "schedule" ]]; then - if [[ $DEBUG == "true" ]]; then - go test -json -covermode=atomic -coverpkg=./... -coverprofile=coverage.txt $1 | tee $OUTPUT_FILE - else - go test -json -covermode=atomic -coverpkg=./... -coverprofile=coverage.txt $1 | cat > $OUTPUT_FILE - fi -else - if [[ $DEBUG == "true" ]]; then - go test $1 | tee $OUTPUT_FILE - else - go test $1 | cat > $OUTPUT_FILE - fi + EXTRA_FLAGS="-covermode=atomic -coverpkg=./... -coverprofile=coverage.txt" fi +go test "$EXTRA_FLAGS" $1 | tee $OUTPUT_FILE | grep -Ev '\[no test files\]|\[no tests to run\]' EXITCODE=${PIPESTATUS[0]} # Assert no known sensitive strings present in test logger output diff --git a/tools/bin/go_core_tests_integration b/tools/bin/go_core_tests_integration index fed80c4bbd5..323e9d526ac 100755 --- a/tools/bin/go_core_tests_integration +++ b/tools/bin/go_core_tests_integration @@ -4,6 +4,7 @@ set +e SCRIPT_PATH=$(dirname "$0"); SCRIPT_PATH=$(eval "cd \"$SCRIPT_PATH\" && pwd") OUTPUT_FILE=${OUTPUT_FILE:-"./output.txt"} +EXTRA_FLAGS="" echo "Finding and running integration-tagged tests" INTEGRATION_TAGGED_TEST_FILES=$(find . -name '*_test.go' -exec grep -l '//go:build integration' {} +) @@ -14,24 +15,15 @@ fi INTEGRATION_TEST_DIRS=$(echo "$INTEGRATION_TAGGED_TEST_FILES" | xargs -n1 dirname | sort -u) INTEGRATION_TEST_DIRS_SPACE_DELIMITED=$(echo "$INTEGRATION_TEST_DIRS" | tr '\n' ' ') -echo "Failed tests and panics: ---------------------" +echo "Test execution results: ---------------------" echo "" if [[ $GITHUB_EVENT_NAME == "schedule" ]]; then # Experimental code to minimize size of this coverage report # ALL_IMPORTS=$(go list -f '{{ join .Imports "\n" }}' $INTEGRATION_TEST_DIRS | sort -u) # COVERPKG_DIRS=$(echo "$INTEGRATION_TEST_DIRS $ALL_IMPORTS" | grep "smartcontractkit/chainlink" | tr '\n' ',') - if [[ $DEBUG == "true" ]]; then - go test -json -tags integration -covermode=atomic -coverpkg=./... -coverprofile=coverage.txt $INTEGRATION_TEST_DIRS_SPACE_DELIMITED | tee $OUTPUT_FILE - else - go test -json -tags integration -covermode=atomic -coverpkg=./... -coverprofile=coverage.txt $INTEGRATION_TEST_DIRS_SPACE_DELIMITED | cat > $OUTPUT_FILE - fi -else - if [[ $DEBUG == "true" ]]; then - go test -tags integration $INTEGRATION_TEST_DIRS_SPACE_DELIMITED | tee $OUTPUT_FILE - else - go test -tags integration $INTEGRATION_TEST_DIRS_SPACE_DELIMITED | cat > $OUTPUT_FILE - fi + EXTRA_FLAGS="-covermode=atomic -coverpkg=./... -coverprofile=coverage.txt" fi +go test -tags integration "$EXTRA_FLAGS" $INTEGRATION_TEST_DIRS_SPACE_DELIMITED | tee $OUTPUT_FILE | grep -Ev '\[no test files\]|\[no tests to run\]' EXITCODE=${PIPESTATUS[0]} # Assert no known sensitive strings present in test logger output