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

try and add an xdef to mimic what go toolset does for testing.Testing… #4096

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

paulgmiller
Copy link

@paulgmiller paulgmiller commented Sep 10, 2024

See https://pkg.go.dev/testing\#Testing
Go test sets an -X so that code knows if its in a UT

What type of PR is this?
Feature?

What does this PR do? Why is it needed?
Adds an xdef to mimic go test more precisely.

Should we only do for go > 1.23?

Which issues(s) does this PR fix?

Fixes #3686

Other notes for review

Copy link

google-cla bot commented Sep 10, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@paulgmiller paulgmiller changed the title try and add an xdef to mimic what go toolset toes for testing.Testing… try and add an xdef to mimic what go toolset does for testing.Testing… Sep 10, 2024
@@ -150,7 +150,8 @@ def _go_test_impl(ctx):
# before user code. See comment above the init function
# in bzltestutil/init.go.
test_gc_linkopts.extend(["-X", "+initfirst/github.com/bazelbuild/rules_go/go/tools/bzltestutil/chdir.RunDir=" + run_dir])

#post golang 1.23 testing.Testing is expected to be set for go tests
Copy link
Member

Choose a reason for hiding this comment

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

Please run buildifier and add a reference to the testing.Testing() function here.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks going a little slow since I am pretty new to bazel.

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.

support Go1.21 testing.Testing() function
2 participants