Skip to content

Commit 3230f2a

Browse files
authored
remove gotestloghelper from core tests (smartcontractkit#15395)
* try gotestloghelper with branch version * fail core tests on purpose * use tee by default for processing output of core go tests, do not use -json flag, remove gotestloghelper * rename log message, filter out no tests/test files from fuzz tests * remove on-purpose core test failure * remove non-tee mode from running go core tests, simplify all conditions * remove extra new line from test * remove whitespaces * fix relative path * remove superfluous if
1 parent 90eb9ae commit 3230f2a

6 files changed

+17
-65
lines changed

.github/workflows/ci-core.yml

-12
Original file line numberDiff line numberDiff line change
@@ -231,26 +231,14 @@ jobs:
231231
echo "COUNT=50" >> $GITHUB_ENV
232232
echo "FUZZ_TIMEOUT_MINUTES=10">> $GITHUB_ENV
233233
234-
- name: Install gotestloghelper
235-
if: ${{ needs.filter.outputs.should-run-ci-core == 'true' }}
236-
run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/gotestloghelper@v1.50.0
237-
238234
- name: Run tests
239235
if: ${{ needs.filter.outputs.should-run-ci-core == 'true' }}
240236
id: run-tests
241237
env:
242238
OUTPUT_FILE: ./output.txt
243-
USE_TEE: false
244239
CL_DATABASE_URL: ${{ env.DB_URL }}
245240
run: ./tools/bin/${{ matrix.type.cmd }} ./...
246241

247-
- name: Print Filtered Test Results
248-
if: ${{ failure() && needs.filter.outputs.should-run-ci-core == 'true' && steps.run-tests.conclusion == 'failure' }}
249-
run: |
250-
if [[ "${{ matrix.type.printResults }}" == "true" ]]; then
251-
cat output.txt | gotestloghelper -ci
252-
fi
253-
254242
- name: Print Races
255243
id: print-races
256244
if: ${{ failure() && matrix.type.cmd == 'go_core_race_tests' && needs.filter.outputs.should-run-ci-core == 'true' }}

tools/bin/go_core_ccip_deployment_tests

+6-14
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,18 @@ set -o pipefail
33
set +e
44

55
SCRIPT_PATH=`dirname "$0"`; SCRIPT_PATH=`eval "cd \"$SCRIPT_PATH\" && pwd"`
6-
OUTPUT_FILE="../output.txt"
7-
USE_TEE="${USE_TEE:-true}"
6+
OUTPUT_FILE=${OUTPUT_FILE:-"../output.txt"}
7+
EXTRA_FLAGS=""
88

99
cd ./deployment || exit
1010
go mod download
11-
echo "Failed tests and panics: ---------------------"
11+
echo "Test execution results: ---------------------"
1212
echo ""
13+
1314
if [[ $GITHUB_EVENT_NAME == "schedule" ]]; then
14-
if [[ $DEBUG == "true" ]]; then
15-
go test -json ./... -covermode=atomic -coverpkg=./... -coverprofile=coverage.txt | tee $OUTPUT_FILE
16-
else
17-
go test -json ./... -covermode=atomic -coverpkg=./... -coverprofile=coverage.txt | cat > $OUTPUT_FILE
18-
fi
19-
else
20-
if [[ $DEBUG == "true" ]]; then
21-
go test ./... | tee $OUTPUT_FILE
22-
else
23-
go test ./... | cat > $OUTPUT_FILE
24-
fi
15+
EXTRA_FLAGS="-covermode=atomic -coverpkg=./... -coverprofile=coverage.txt"
2516
fi
17+
go test ./... "$EXTRA_FLAGS" | tee $OUTPUT_FILE | grep -Ev '\[no test files\]|\[no tests to run\]'
2618
EXITCODE=${PIPESTATUS[0]}
2719

2820
# Assert no known sensitive strings present in test logger output

tools/bin/go_core_fuzz

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ echo "timeout minutes: $FUZZ_TIMEOUT_MINUTES"
1919
echo "fuzz seconds: $FUZZ_SECONDS"
2020
echo "Failed fuzz tests and panics: ---------------------"
2121
echo ""
22-
timeout "${FUZZ_TIMEOUT_MINUTES}"m ./fuzz/fuzz_all_native.py --ci --seconds "$FUZZ_SECONDS" --go_module_root ./ | tee $OUTPUT_FILE
22+
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\]'
2323
EXITCODE=${PIPESTATUS[0]}
2424

2525
# Assert no known sensitive strings present in test logger output

tools/bin/go_core_race_tests

+2-14
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,9 @@ OUTPUT_FILE=${OUTPUT_FILE:-"./output.txt"}
44
TIMEOUT="${TIMEOUT:-10s}"
55
COUNT="${COUNT:-5}"
66

7-
echo "Failed tests and panics: ---------------------"
7+
echo "Test execution results: ---------------------"
88
echo ""
9-
if [[ $GITHUB_EVENT_NAME == "schedule" ]]; then
10-
if [[ $DEBUG == "true" ]]; then
11-
GORACE="log_path=$PWD/race" go test -json -race -shuffle on -timeout "$TIMEOUT" -count "$COUNT" $1 | tee $OUTPUT_FILE
12-
else
13-
GORACE="log_path=$PWD/race" go test -race -shuffle on -timeout "$TIMEOUT" -count "$COUNT" $1 | cat > $OUTPUT_FILE
14-
fi
15-
else
16-
if [[ $DEBUG == "true" ]]; then
17-
GORACE="log_path=$PWD/race" go test -json -race -shuffle on -timeout "$TIMEOUT" -count "$COUNT" $1 | tee $OUTPUT_FILE
18-
else
19-
GORACE="log_path=$PWD/race" go test -race -shuffle on -timeout "$TIMEOUT" -count "$COUNT" $1 | cat > $OUTPUT_FILE
20-
fi
21-
fi
9+
GORACE="log_path=$PWD/race" go test -race -shuffle on -timeout "$TIMEOUT" -count "$COUNT" $1 | cat > $OUTPUT_FILE
2210
EXITCODE=${PIPESTATUS[0]}
2311

2412

tools/bin/go_core_tests

+4-12
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,14 @@ set +e
44

55
SCRIPT_PATH=`dirname "$0"`; SCRIPT_PATH=`eval "cd \"$SCRIPT_PATH\" && pwd"`
66
OUTPUT_FILE=${OUTPUT_FILE:-"./output.txt"}
7+
EXTRA_FLAGS=""
78

8-
echo "Failed tests and panics: ---------------------"
9+
echo "Test execution results: ---------------------"
910
echo ""
1011
if [[ $GITHUB_EVENT_NAME == "schedule" ]]; then
11-
if [[ $DEBUG == "true" ]]; then
12-
go test -json -covermode=atomic -coverpkg=./... -coverprofile=coverage.txt $1 | tee $OUTPUT_FILE
13-
else
14-
go test -json -covermode=atomic -coverpkg=./... -coverprofile=coverage.txt $1 | cat > $OUTPUT_FILE
15-
fi
16-
else
17-
if [[ $DEBUG == "true" ]]; then
18-
go test $1 | tee $OUTPUT_FILE
19-
else
20-
go test $1 | cat > $OUTPUT_FILE
21-
fi
12+
EXTRA_FLAGS="-covermode=atomic -coverpkg=./... -coverprofile=coverage.txt"
2213
fi
14+
go test "$EXTRA_FLAGS" $1 | tee $OUTPUT_FILE | grep -Ev '\[no test files\]|\[no tests to run\]'
2315
EXITCODE=${PIPESTATUS[0]}
2416

2517
# Assert no known sensitive strings present in test logger output

tools/bin/go_core_tests_integration

+4-12
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ set +e
44

55
SCRIPT_PATH=$(dirname "$0"); SCRIPT_PATH=$(eval "cd \"$SCRIPT_PATH\" && pwd")
66
OUTPUT_FILE=${OUTPUT_FILE:-"./output.txt"}
7+
EXTRA_FLAGS=""
78

89
echo "Finding and running integration-tagged tests"
910
INTEGRATION_TAGGED_TEST_FILES=$(find . -name '*_test.go' -exec grep -l '//go:build integration' {} +)
@@ -14,24 +15,15 @@ fi
1415
INTEGRATION_TEST_DIRS=$(echo "$INTEGRATION_TAGGED_TEST_FILES" | xargs -n1 dirname | sort -u)
1516
INTEGRATION_TEST_DIRS_SPACE_DELIMITED=$(echo "$INTEGRATION_TEST_DIRS" | tr '\n' ' ')
1617

17-
echo "Failed tests and panics: ---------------------"
18+
echo "Test execution results: ---------------------"
1819
echo ""
1920
if [[ $GITHUB_EVENT_NAME == "schedule" ]]; then
2021
# Experimental code to minimize size of this coverage report
2122
# ALL_IMPORTS=$(go list -f '{{ join .Imports "\n" }}' $INTEGRATION_TEST_DIRS | sort -u)
2223
# COVERPKG_DIRS=$(echo "$INTEGRATION_TEST_DIRS $ALL_IMPORTS" | grep "smartcontractkit/chainlink" | tr '\n' ',')
23-
if [[ $DEBUG == "true" ]]; then
24-
go test -json -tags integration -covermode=atomic -coverpkg=./... -coverprofile=coverage.txt $INTEGRATION_TEST_DIRS_SPACE_DELIMITED | tee $OUTPUT_FILE
25-
else
26-
go test -json -tags integration -covermode=atomic -coverpkg=./... -coverprofile=coverage.txt $INTEGRATION_TEST_DIRS_SPACE_DELIMITED | cat > $OUTPUT_FILE
27-
fi
28-
else
29-
if [[ $DEBUG == "true" ]]; then
30-
go test -tags integration $INTEGRATION_TEST_DIRS_SPACE_DELIMITED | tee $OUTPUT_FILE
31-
else
32-
go test -tags integration $INTEGRATION_TEST_DIRS_SPACE_DELIMITED | cat > $OUTPUT_FILE
33-
fi
24+
EXTRA_FLAGS="-covermode=atomic -coverpkg=./... -coverprofile=coverage.txt"
3425
fi
26+
go test -tags integration "$EXTRA_FLAGS" $INTEGRATION_TEST_DIRS_SPACE_DELIMITED | tee $OUTPUT_FILE | grep -Ev '\[no test files\]|\[no tests to run\]'
3527
EXITCODE=${PIPESTATUS[0]}
3628

3729
# Assert no known sensitive strings present in test logger output

0 commit comments

Comments
 (0)