You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are many ad-hoc unit tests that can only run in IDE (due to config, exec order etc.) and need to be skipped if the test is run in CI or just through makefile
Then in package's TestMain we can call TestPkg to enable/disable entire package, and if just a single func we can use tesutil.SkipIf(testutil.EnvTrue("NO_IDE"))
funcTestPkg(pkgstring) bool {
pkgLock.Lock()
deferpkgLock.Unlock()
noIDE:=os.Getenv("NO_IDE")
ifnoIDE=="true" {
log.Printf("test package %s is skipped, set NO_IDE=false to enable it, currently NO_IDE=%s", pkg, noIDE)
returnfalse
}
}
in Makefile
GO = CGO_ENABLED=0 go
# NO_IDE is used to skip test or packages that are meant to run in IDE manually due to hard coded config
GOTEST = NO_IDE=true $(GO) test
The text was updated successfully, but these errors were encountered:
There are many ad-hoc unit tests that can only run in IDE (due to config, exec order etc.) and need to be skipped if the test is run in CI or just through makefile
Then in package's
TestMain
we can callTestPkg
to enable/disable entire package, and if just a single func we can usetesutil.SkipIf(testutil.EnvTrue("NO_IDE"))
in Makefile
The text was updated successfully, but these errors were encountered: