Skip to content
Snippets Groups Projects
Commit b02e18f0 authored by Andrew Newdigate's avatar Andrew Newdigate
Browse files

Merge branch 'revert/dc99c125' into 'main'

Revert "feat(go-unittests): run Go race detector"

See merge request gitlab-com/gl-infra/common-ci-tasks!434
parents 85d0154f 6be6d205
No related branches found
No related tags found
No related merge requests found
Pipeline #17228497 passed
Loading
Loading
@@ -22,9 +22,6 @@ include:
- project: 'gitlab-com/gl-infra/common-ci-tasks'
ref: v1.79.0 # renovate:managed
file: go-unittests.yml
inputs:
# Run Go race detector
race: true
```
 
## Skipping Integration Tests
Loading
Loading
---
spec:
inputs:
stage:
default: validate
race:
default: false
description: Run go tests with the Go race detector https://go.dev/doc/articles/race_detector
---
 
.go_unittests_base:
go_unittests:
image: golang:${GL_ASDF_GOLANG_VERSION}
stage: $[[ inputs.stage ]]
needs: []
after_script: |
cat <<-EOD
----------------------------------------------------------
Need help? Documentation on the go_unittests CI job can be found at:
https://gitlab.com/gitlab-com/gl-infra/common-ci-tasks/-/blob/main/go-unittests.md
EOD
# Automatically retry on any system blips
retry:
max: 2
when:
- runner_system_failure
go_unittests:
extends:
- .go_unittests_base
script:
- GOBIN=/usr/bin/ go install -v gotest.tools/gotestsum@latest || go get gotest.tools/gotestsum
- packages=$(go list ./...|grep -Ev "${GO_UNITTESTS_EXCLUDE_PACKAGES_REGEXP:-__ignored__}" || true)
Loading
Loading
@@ -35,25 +16,22 @@ go_unittests:
else
echo "all packages excluded, skipping tests...";
fi
after_script: |
cat <<-EOD
----------------------------------------------------------
Need help? Documentation on the go_unittests CI job can be found at:
https://gitlab.com/gitlab-com/gl-infra/common-ci-tasks/-/blob/main/go-unittests.md
EOD
artifacts:
when: always
reports:
junit: report.xml
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE != "schedule"
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE != "schedule"'
 
go_unittests_race:
extends:
- .go_unittests_base
script:
- packages=$(go list ./...|grep -Ev "${GO_UNITTESTS_EXCLUDE_PACKAGES_REGEXP:-__ignored__}" || true)
- if [[ -n "$packages" ]]; then
go test -v -race $packages;
else
echo "all packages excluded, skipping tests...";
fi
rules:
- if: $[[ inputs.race ]]
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE != "schedule"
# Automatically retry on any system blips
retry:
max: 2
when:
- runner_system_failure
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment