cleanup: mark more integration tests as !short mode (#755)
The objective is to make PR checks run much faster. See https://github.com/ooni/probe/issues/2113 for context. Regarding netxlite's tests: Checking for every commit on master or on a release branch is good enough and makes pull requests faster than one minute since netxlite for windows is now 1m slower than coverage. We're losing some coverage but coverage from integration tests is not so good anyway, so I'm not super sad about this loss.
This commit is contained in:
@@ -11,16 +11,25 @@ func init() {
|
||||
}
|
||||
|
||||
func TestCheck(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skip test in short mode")
|
||||
}
|
||||
*mode = "check"
|
||||
main()
|
||||
}
|
||||
|
||||
func TestRaw(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skip test in short mode")
|
||||
}
|
||||
*mode = "raw"
|
||||
main()
|
||||
}
|
||||
|
||||
func TestMeta(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skip test in short mode")
|
||||
}
|
||||
*mode = "meta"
|
||||
main()
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ func TestListenError(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestStarTLS(t *testing.T) {
|
||||
func TestStartTLS(t *testing.T) {
|
||||
expected := errors.New("mocked error")
|
||||
|
||||
t.Run("when we cannot create a new authority", func(t *testing.T) {
|
||||
|
||||
@@ -16,6 +16,9 @@ func ensureWeStartOverWithIPTables() {
|
||||
}
|
||||
|
||||
func TestNoCommand(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skip test in short mode")
|
||||
}
|
||||
if runtime.GOOS != "linux" {
|
||||
t.Skip("skip test on non Linux systems")
|
||||
}
|
||||
@@ -30,6 +33,9 @@ func TestNoCommand(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestWithCommand(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skip test in short mode")
|
||||
}
|
||||
if runtime.GOOS != "linux" {
|
||||
t.Skip("skip test on non Linux systems")
|
||||
}
|
||||
@@ -54,6 +60,7 @@ func TestMustx(t *testing.T) {
|
||||
t.Fatal("should not happen")
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("with non-exit-code error", func(t *testing.T) {
|
||||
var (
|
||||
called int
|
||||
@@ -70,6 +77,7 @@ func TestMustx(t *testing.T) {
|
||||
t.Fatal("unexpected exitcode value")
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("with exit-code error", func(t *testing.T) {
|
||||
var (
|
||||
called int
|
||||
|
||||
@@ -27,6 +27,9 @@ func TestRedirect(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestIgnore(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skip test in short mode")
|
||||
}
|
||||
server := newresolver(t, nil, nil, []string{"ooni.nu"})
|
||||
iotimeout := "i/o timeout"
|
||||
checkrequest(t, server, "hkgmetadb.ooni.nu", "hijacked", &iotimeout)
|
||||
|
||||
@@ -98,6 +98,9 @@ func TestOOClientDoWithInvalidTargetURL(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestOOClientDoWithResolverFailure(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skip test in short mode")
|
||||
}
|
||||
ctx := context.Background()
|
||||
config := internal.OOConfig{
|
||||
TargetURL: "http://www.example.com",
|
||||
|
||||
@@ -3,6 +3,9 @@ package main
|
||||
import "testing"
|
||||
|
||||
func TestSmoke(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skip test in short mode")
|
||||
}
|
||||
*target = "http://www.example.com"
|
||||
main()
|
||||
}
|
||||
|
||||
@@ -23,6 +23,9 @@ func TestReadLines(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestNewSessionAndSubmitter(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skip test in short mode")
|
||||
}
|
||||
ctx := context.Background()
|
||||
sess := newSession(ctx)
|
||||
if sess == nil {
|
||||
@@ -57,6 +60,9 @@ func TestMainMissingFile(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMainEmptyFile(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skip test in short mode")
|
||||
}
|
||||
defer func() {
|
||||
var s interface{}
|
||||
if s = recover(); s != nil {
|
||||
@@ -67,6 +73,9 @@ func TestMainEmptyFile(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSubmitAllFails(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skip test in short mode")
|
||||
}
|
||||
ctx := context.Background()
|
||||
sess := newSession(ctx)
|
||||
subm := newSubmitter(sess, ctx)
|
||||
|
||||
Reference in New Issue
Block a user