Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Build Id mismatch while running go test using -covermode and -coverprofile #526

Open
tonyredondo opened this issue Feb 4, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@tonyredondo
Copy link
Member

tonyredondo commented Feb 4, 2025

Version of orchestrion

1.0.4

Describe what happened:

Trying to instrument the gin tests using Orchestrion + CI Visibility throws build Id mismatch errors.

@RomainMuller discovered that the gin tests were running with -covermode and -coverprofile arguments without setting -coverpkg. If we pass the -coverpkg attribute then stops failing.

Gin makefile go test command: https://github.com/gin-gonic/gin/blob/master/Makefile#L15

Log file:
orchestrion-logs-ubuntu-latest-1.23- (3).zip

Stdout:

for d in github.com/gin-gonic/gin github.com/gin-gonic/gin/binding github.com/gin-gonic/gin/render; do \
	orchestrion go test  -v -covermode=count -coverprofile=profile.out $d > tmp.out; \
	cat tmp.out; \
	if grep -q "^--- FAIL" tmp.out; then \
		rm tmp.out; \
		exit 1; \
	elif grep -q "build failed" tmp.out; then \
		rm tmp.out; \
		exit 1; \
	elif grep -q "setup failed" tmp.out; then \
		rm tmp.out; \
		exit 1; \
	fi; \
	if [ -f profile.out ]; then \
		cat profile.out | grep -v "mode:" >> coverage.out; \
		rm profile.out; \
	fi; \
done
# os
resolving woven dependency on gopkg.in/DataDog/dd-trace-go.v1/internal/appsec/emitter/ossec: -: # gopkg.in/DataDog/dd-trace-go.v1/internal/appsec/dyngo
sending never-build-twice request: mismatched build ID for "gopkg.in/DataDog/dd-trace-go.v1/internal/appsec/dyngo": "St17Dga3rWo_Bo1gn00A/St17Dga3rWo_Bo1gn00A" != "gDaWZDlp8ITA_dZ1NXih/gDaWZDlp8ITA_dZ1NXih"
FAIL	github.com/gin-gonic/gin [build failed]
FAIL
make: *** [Makefile:14: test] Error 1
Error: Process completed with exit code 2.

Describe what you expected:

Normal test pass

Steps to reproduce the issue:

  1. Fork the gin repo: https://github.com/gin-gonic/gin
  2. Modify the Run Tests step in https://github.com/gin-gonic/gin/blob/master/.github/workflows/gin.yml with:
      - name: Run Tests
        run: |
          go install github.com/DataDog/orchestrion@latest
          make test
        env:
          DD_API_KEY: ${{ secrets.DD_API_KEY }}
  1. Modify the Makefile Go command with:
GO ?= orchestrion go
  1. Run the github action

Additional environment details (Version of Go, Operating System, etc.):

@tonyredondo tonyredondo added the bug Something isn't working label Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant