diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1f96bf20..97d30abd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,15 +80,18 @@ jobs: if [ -n "$DD_API_KEY" ]; then echo "Running tests with Datadog CI Visibility enabled" orchestrion go test -v -race -parallel 256 ./... - # Calculate coverage with orchestrion instrumentation - # Use -count=1 to disable test caching and get accurate coverage - orchestrion go test -count=1 -parallel 256 -coverprofile=coverage.out -covermode=atomic ./pkg/... else echo "Running tests without Datadog CI Visibility (DD_API_KEY not set)" go test -v -race ./... - go test -count=1 -coverprofile=coverage.out -covermode=atomic ./pkg/... fi + # Coverage collection: run WITHOUT orchestrion/ITR to ensure ALL tests execute. + # Intelligent Test Runner skips tests it deems unaffected by code changes, + # which breaks coverage on dependency-only PRs (e.g., go.mod updates). + # GOFLAGS is cleared to remove the '-toolexec=orchestrion toolexec' injected + # by test-visibility-github-action. + GOFLAGS="" go test -count=1 -coverprofile=coverage.out -covermode=atomic ./pkg/... + # Generate HTML coverage report go tool cover -html=coverage.out -o coverage.html diff --git a/go.mod b/go.mod index 4eda77d7..513c4b3e 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/DataDog/datadog-api-client-go/v2 v2.54.0 github.com/olekukonko/tablewriter v1.1.3 github.com/spf13/cobra v1.10.2 - github.com/stretchr/testify v1.7.0 + github.com/stretchr/testify v1.11.1 gopkg.in/yaml.v3 v3.0.1 ) diff --git a/go.sum b/go.sum index 1b0732b2..51b7e6ac 100644 --- a/go.sum +++ b/go.sum @@ -68,10 +68,11 @@ github.com/spf13/cobra v1.10.2/go.mod h1:7C1pvHqHw5A4vrJfjNwvOdzYu0Gml16OCs2GRiT github.com/spf13/pflag v1.0.9 h1:9exaQaMOCwffKiiiYk6/BndUBv+iRViNW+4lEMi0PvY= github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.3.0 h1:NGXK3lHquSN08v5vWalVI/L8XU9hdzE/G6xsrze47As= -github.com/stretchr/objx v0.3.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=