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:
parent
6924d1ad81
commit
d922bd9afc
28 changed files with 143 additions and 70 deletions
|
|
@ -5,7 +5,6 @@ import (
|
|||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"runtime"
|
||||
"strings"
|
||||
|
|
@ -33,9 +32,6 @@ func NewSessionForTesting() (*oonimkall.Session, error) {
|
|||
}
|
||||
|
||||
func TestNewSessionWithInvalidStateDir(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skip test in short mode")
|
||||
}
|
||||
sess, err := oonimkall.NewSession(&oonimkall.SessionConfig{
|
||||
StateDir: "",
|
||||
})
|
||||
|
|
@ -47,29 +43,6 @@ func TestNewSessionWithInvalidStateDir(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestMaybeUpdateResourcesWithCancelledContext(t *testing.T) {
|
||||
// Note that MaybeUpdateResources is now a deprecated stub that
|
||||
// does nothing. We will remove it when we bump major.
|
||||
dir, err := ioutil.TempDir("", "xx")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer os.RemoveAll(dir)
|
||||
sess, err := NewSessionForTestingWithAssetsDir(dir)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
ctx := sess.NewContext()
|
||||
ctx.Cancel() // cause immediate failure
|
||||
err = sess.MaybeUpdateResources(ctx)
|
||||
// Explanation: we embed resources. We should change the API
|
||||
// and remove the context. Until we do that, let us just assert
|
||||
// that we have embedding and the context does not matter.
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func ReduceErrorForGeolocate(err error) error {
|
||||
if err == nil {
|
||||
return errors.New("we expected an error here")
|
||||
|
|
@ -250,6 +223,9 @@ func TestSubmitCancelContextAfterFirstSubmission(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestCheckInSuccess(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skip test in short mode")
|
||||
}
|
||||
sess, err := NewSessionForTesting()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
|
|
@ -298,6 +274,9 @@ func TestCheckInSuccess(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestCheckInLookupLocationFailure(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skip test in short mode")
|
||||
}
|
||||
sess, err := NewSessionForTesting()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
|
|
@ -325,6 +304,9 @@ func TestCheckInLookupLocationFailure(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestCheckInNewProbeServicesFailure(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skip test in short mode")
|
||||
}
|
||||
sess, err := NewSessionForTesting()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
|
|
@ -354,6 +336,9 @@ func TestCheckInNewProbeServicesFailure(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestCheckInCheckInFailure(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skip test in short mode")
|
||||
}
|
||||
sess, err := NewSessionForTesting()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
|
|
@ -383,6 +368,9 @@ func TestCheckInCheckInFailure(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestCheckInNoParams(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skip test in short mode")
|
||||
}
|
||||
sess, err := NewSessionForTesting()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
|
|
@ -441,6 +429,9 @@ func TestFetchURLListSuccess(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestFetchURLListWithCC(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skip test in short mode")
|
||||
}
|
||||
sess, err := NewSessionForTesting()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
|
|
|
|||
Loading…
Reference in a new issue