Skip to content
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
38 changes: 38 additions & 0 deletions .github/workflows/test-go-race.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: test-go-race

on:
pull_request:
branches: [main]
paths:
- "cli/**"
- "!cli/azd/extensions/**"
- ".github/workflows/test-go-race.yml"

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true

permissions:
contents: read

jobs:
race-tests:
runs-on: ubuntu-latest
timeout-minutes: 30
defaults:
run:
working-directory: cli/azd
env:
CGO_ENABLED: "1"
AZURE_RECORD_MODE: playback
AZURE_DEV_COLLECT_TELEMETRY: "no"
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: cli/azd/go.mod
cache-dependency-path: cli/azd/go.sum
- name: Build azd
Comment thread
vhvb1989 marked this conversation as resolved.
Resolved
run: go build -o azd .
- name: Run race detector tests
run: go test -race -short -count=1 ./...
7 changes: 0 additions & 7 deletions eng/pipelines/templates/jobs/build-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,6 @@ jobs:
# Without this disabled, we often see tests failing due to MSBuild worker processes being shared across concurrent tests.
MSBUILDDISABLENODEREUSE: 1

- ${{ if eq(parameters.OS, 'linux') }}:
- pwsh: |
$env:CGO_ENABLED = "1"
go test -race -short ./...
workingDirectory: cli/azd
displayName: Run race detector tests

- task: PublishTestResults@2
inputs:
testResultsFormat: JUnit
Expand Down
Loading