Skip to content
Snippets Groups Projects
Verified Commit 5432f630 authored by Axel von Bertoldi's avatar Axel von Bertoldi
Browse files

Function to skip tests if job variable set

parent 4f2ee8c5
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !5069. Comments created here will be created in the context of that merge request.
......@@ -4,6 +4,7 @@ import (
"context"
"os"
"runtime"
"strconv"
"testing"
"github.com/docker/docker/client"
......@@ -36,6 +37,23 @@ func SkipIfGitLabCIWithMessage(t *testing.T, msg string) {
}
}
func SkipIfVariable(t *testing.T, varName string) {
val, ok := os.LookupEnv(varName)
if !ok {
return
}
set, err := strconv.ParseBool(val)
if err != nil {
return
}
if set {
t.Skipf("Skipping test %s because variable %s set", t.Name(), varName)
}
}
func SkipIfDockerDaemonAPIVersionNotAtLeast(t *testing.T, version string) {
ver, err := getDockerDaemonAPIVersion()
if err != nil {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment