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

go_test should filter tests using --test_filter #272

Closed
jayconrod opened this issue Feb 21, 2017 · 0 comments
Closed

go_test should filter tests using --test_filter #272

jayconrod opened this issue Feb 21, 2017 · 0 comments
Assignees

Comments

@jayconrod
Copy link
Contributor

Bazel allows users to pass in a pattern for matching test cases within a test using --test_filter=filter-expression. This pattern is passed to the test runner through the TESTBRIDGE_TEST_ONLY environment variable.

The test runner generated by //go/tools:generate_test_main should treat this environment variable as a regular expression and filter tests accordingly. Currently, we pass a function to testing.Main which matches all tests.

@jayconrod jayconrod self-assigned this Feb 21, 2017
jayconrod pushed a commit to jayconrod/rules_go that referenced this issue Feb 24, 2017
Modified generate_test_main.go to map the TESTBRIDGE_TEST_ONLY
environment variable (set by Bazel for --test_filter) onto the
-test.run flag, which is defined and used by the testing package.

Fixes bazelbuild#272
jayconrod added a commit that referenced this issue Feb 27, 2017
Modified generate_test_main.go to map the TESTBRIDGE_TEST_ONLY
environment variable (set by Bazel for --test_filter) onto the
-test.run flag, which is defined and used by the testing package.

Fixes #272
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant