Skip to content

Makefile: Disable test caching by using go test -count=1#97

Merged
anfredette merged 1 commit intobpfman:mainfrom
frobware:drop-call-to-go-clean-testcache
Aug 13, 2024
Merged

Makefile: Disable test caching by using go test -count=1#97
anfredette merged 1 commit intobpfman:mainfrom
frobware:drop-call-to-go-clean-testcache

Conversation

@frobware
Copy link
Contributor

@frobware frobware commented Aug 8, 2024

The test-integration Make target clears the entire Go test cache, which is overly aggressive, especially when running go test ./... in other projects, causing all tests to re-run in those other projects after running the integration tests.

Instead, use the idiomatic -count=1 flag to explicitly disable test caching.

This idiom is mentioned in the documentation [1]: "The idiomatic way to disable test caching explicitly is to use -count=1."

[1] https://pkg.go.dev/cmd/go#hdr-Test_packages

The test-integration Make target clears the entire Go test cache, which
is overly aggressive, especially when running `go test ./...` in other
projects, causing all tests to re-run after running the integration
tests.

Instead, use the idiomatic -count=1 flag to explicitly disable test
caching.

This idiom is mentioned in the documentation [1]: "The idiomatic way to
disable test caching explicitly is to use -count=1."

[1] https://pkg.go.dev/cmd/go#hdr-Test_packages

Signed-off-by: Andrew McDermott <amcdermo@redhat.com>
@codecov
Copy link

codecov bot commented Aug 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 27.61%. Comparing base (4462632) to head (f6c608e).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #97   +/-   ##
=======================================
  Coverage   27.61%   27.61%           
=======================================
  Files          81       81           
  Lines        6999     6999           
=======================================
  Hits         1933     1933           
  Misses       4877     4877           
  Partials      189      189           
Flag Coverage Δ
unittests 27.61% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@Billy99 Billy99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

I am not familiar with this syntax, but following the provided link, looks like this is the preferred method.

Copy link
Contributor

@anfredette anfredette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@anfredette anfredette merged commit 6d7f517 into bpfman:main Aug 13, 2024
msherif1234 pushed a commit to msherif1234/bpfman-operator that referenced this pull request Nov 15, 2024
…/ocp-bpfman

chore(deps): update ocp-bpfman to 865b993
@frobware frobware deleted the drop-call-to-go-clean-testcache branch September 3, 2025 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants