Remove all remaining references to unittest.ManualTest().
Change-Id: I27fddf63719573175bb3e64218a2e2324e3fdc2d
Reviewed-on: https://skia-review.googlesource.com/c/buildbot/+/577164
Auto-Submit: Leandro Lovisolo <lovisolo@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
diff --git a/BAZEL_CHEATSHEET.md b/BAZEL_CHEATSHEET.md
index f9e1a5d..7eb9d7a 100644
--- a/BAZEL_CHEATSHEET.md
+++ b/BAZEL_CHEATSHEET.md
@@ -192,8 +192,7 @@
#### Manual Go tests
To mark specific Go test cases as manual, extract them out into a separate file ending with
-`_manual_test.go` within the same directory, and call `unittest.ManualTest(t)` from each test case
-in said file.
+`_manual_test.go` within the same directory.
The `go_test` macro in `//bazel/go/go_test.bzl` places files ending with `_manual_test.go` in a
separate `go_test` target, which is tagged as manual.
diff --git a/BUILD.bazel b/BUILD.bazel
index eb2734a..12f3b93 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -33,9 +33,8 @@
#
# The custom macro generates separate go_test targets for manual Go tests, which will be tagged as
# manual. The macro relies on the assumption that any manual test cases will be placed on Go source
-# files ending in "_manual_test.go". This convention is enforced by unittest.ManualTest(). If the
-# test target does not contain any manual test, the custom macro behaves exactly like rules_go's
-# go_test rule.
+# files ending in "_manual_test.go". If the test target does not contain any manual test, the
+# custom macro behaves exactly like rules_go's go_test rule.
#
# See the macro's docstring for details.
#
diff --git a/bazel/go/go_test.bzl b/bazel/go/go_test.bzl
index 9ed19e9..94ed30c 100644
--- a/bazel/go/go_test.bzl
+++ b/bazel/go/go_test.bzl
@@ -8,7 +8,7 @@
The purpose of this macro is to automatically create separate test targets for non-manual and
manual Go tests. The latter will be tagged as manual in order to exclude them from wildcard
queries such as "bazel test ...". It assumes that any manual test cases are placed in Go files
- ending with "_manual_test.go", and that each such test case calls unittest.ManualTest().
+ ending with "_manual_test.go".
In addition, this macro customizes some go_test arguments with better defaults.
@@ -62,15 +62,14 @@
"omega_manual_test.go",
],
tags = ["manual"], # Exclude from Bazel wildcards, e.g. "bazel test ...".
- args = ["--manual"], # Only run test cases that call unittest.ManualTest().
...
)
```
The reason why example_manual_test includes the non-manual tests as well is because they might
- define auxiliary functions, test data, etc. shared between all tests, including the manual ones.
- However, non-manual tests are excluded by passing the --manual flag to the test binary, which
- skips any test cases that do not call unittest.ManualTest().
+ define auxiliary functions, test data, etc. shared between all tests, including the manual
+ ones. Thus, example_manual_test will run both the manual and non-manual tests when invoked with
+ "bazel test ...".
If this macro is invoked without any files ending with "_manual_test.go", it behaves exactly
like the default go_test rule from the rules_go repository.
@@ -107,10 +106,7 @@
name = name[:-4] + "manual_test", # Turn e.g. foo_test into foo_manual_test.
# Include *_manual_test.go and *_test.go sources as well, because the latter might
# contain functions, test data, etc. shared between the manual and non-manual tests.
- # However, non-manual tests will not be executed because we pass the --manual flag to
- # the test binary.
srcs = srcs,
tags = tags + ["manual"], # Exclude from Bazel wildcards, e.g. "bazel test ...".
- args = args + ["--manual"], # Only run test cases that call unittest.ManualTest().
**kwargs
)