Skip integration tests on short or lack of docker

Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
Kristoffer Dalby committed 2022-10-18 15:37:11 +02:00
1 parent a9c3b14f79
commit eda4321486
2 files changed
+31 -1

No files matched your search

+13 -1
View File
@@ -1,6 +1,18 @@
package dockertestutil
import "github.com/ory/dockertest/v3/docker"
import (
"os"
"github.com/ory/dockertest/v3/docker"
)
func IsRunningInContainer() bool {
if _, err := os.Stat("/.dockerenv"); err != nil {
return false
}
return true
}
func DockerRestartPolicy(config *docker.HostConfig) {
// set AutoRemove to true so that stopped container goes away by itself on error *immediately*.