-
-
Notifications
You must be signed in to change notification settings - Fork 665
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Forward
-testfilter
to nogo and fix failure in case of no srcs (#4075)
**What type of PR is this?** Bug fix **What does this PR do? Why is it needed?** Without this, nogo runs on the external test sources when compiling the internal test library, which can result in missing deps errors and is also wasteful. Since filtering out files made certain nogo actions run on no files, also fix a bug that affects this situation by writing out an empty log in addition to an empty facts file. The code that checks imports and builds the importcfg was shared between `compilepkg` and `nogo` and is now extracted into a common method. Along the way, have it output the file into the working directory, which simplifies cleanup, makes the file easier to find and avoids writing files unknown to Bazel into the output directory. Also removes some unused test files. **Which issues(s) does this PR fix?** Fixes #4062 Fixes #4070 Fixes #4073 **Other notes for review**
- Loading branch information
Showing
9 changed files
with
212 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
load("@io_bazel_rules_go//go/tools/bazel_testing:def.bzl", "go_bazel_test") | ||
|
||
go_bazel_test( | ||
name = "tests_test", | ||
srcs = ["tests_test.go"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
nogo for go_test | ||
============================= | ||
|
||
.. _nogo: /go/nogo.rst | ||
.. _go_test: /docs/go/core/rules.md#_go_test | ||
|
||
Verifies interactions between `nogo`_ and `go_test`_. | ||
|
||
|
||
tests_test | ||
============================= | ||
|
||
Tests that `nogo`_ can handle various edge cases of external tests. |
Oops, something went wrong.