[fxtesting] Add check for skipping integration tests
We'll use this to skip tilo integration tests, which should only
run on CI.
IN-699 #comment
Change-Id: I0321568aee22e26f60ce31d6acf0054abbdf3296
diff --git a/fxtesting/testing.go b/fxtesting/testing.go
index 2a2318c..0c6b067 100644
--- a/fxtesting/testing.go
+++ b/fxtesting/testing.go
@@ -14,6 +14,14 @@
*testing.T
}
+// IsPresubmitMode returns true iff running in short mode. To enable short mode, run
+// `go test -short`. Long running tests and integration tests should Skip() themselves if
+// this flag is set. See https://golang.org/pkg/testing/ for an explanation of the
+// testing package's short flag.
+func IsPresubmitMode() bool {
+ return testing.Short()
+}
+
// AssertNil raises a fatal error if the error is not nil.
func (t *T) AssertNil(err error) {
if err != nil {