mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-06 05:31:47 +00:00
Windows: Workaround for CI
Signed-off-by: John Howard <jhoward@microsoft.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// +build daemon,experimental
|
||||
// +build daemon,experimental,!windows
|
||||
|
||||
package main
|
||||
|
||||
@@ -22,6 +22,7 @@ func assertNetwork(c *check.C, d *Daemon, name string) {
|
||||
}
|
||||
|
||||
func (s *DockerDaemonSuite) TestDaemonDefaultNetwork(c *check.C) {
|
||||
testRequires(c, SameHostDaemon)
|
||||
d := s.d
|
||||
|
||||
networkName := "testdefault"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// +build daemon
|
||||
// +build daemon,!windows
|
||||
|
||||
package main
|
||||
|
||||
|
||||
@@ -24,6 +24,10 @@ var (
|
||||
execDriverPath = runtimePath + "/execdriver/native"
|
||||
|
||||
workingDirectory string
|
||||
|
||||
// isLocalDaemon is true if the daemon under test is on the same
|
||||
// host as the CLI.
|
||||
isLocalDaemon bool
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -43,4 +47,26 @@ func init() {
|
||||
privateRegistryURL = registry
|
||||
}
|
||||
workingDirectory, _ = os.Getwd()
|
||||
|
||||
// Deterministically working out the environment in which CI is running
|
||||
// to evaluate whether the daemon is local or remote is not possible through
|
||||
// a build tag.
|
||||
//
|
||||
// For example Windows CI under Jenkins test the 64-bit
|
||||
// Windows binary build with the daemon build tag, but calls a remote
|
||||
// Linux daemon.
|
||||
//
|
||||
// We can't just say if Windows then assume the daemon is local as at
|
||||
// some point, we will be testing the Windows CLI against a Windows daemon.
|
||||
//
|
||||
// Similarly, it will be perfectly valid to also run CLI tests from
|
||||
// a Linux CLI (built with the daemon tag) against a Windows daemon.
|
||||
if len(os.Getenv("DOCKER_REMOTE_DAEMON")) > 0 {
|
||||
fmt.Println("INFO: Testing against a remote daemon")
|
||||
isLocalDaemon = false
|
||||
} else {
|
||||
fmt.Println("INFO: Testing against a local daemon")
|
||||
isLocalDaemon = true
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
// +build !daemon
|
||||
|
||||
package main
|
||||
|
||||
const (
|
||||
// tests should not assume daemon runs on the same machine as CLI
|
||||
isLocalDaemon = false
|
||||
)
|
||||
@@ -1,8 +0,0 @@
|
||||
// +build daemon
|
||||
|
||||
package main
|
||||
|
||||
const (
|
||||
// tests can assume daemon runs on the same machine as CLI
|
||||
isLocalDaemon = true
|
||||
)
|
||||
Reference in New Issue
Block a user