Skip to content

Commit ef2e82b

Browse files
authored
Merge pull request docker-archive#1204 from docker/aci_timeout
ACI timeout moved from 10 to 15 mins
2 parents 1347447 + dfc8ded commit ef2e82b

File tree

2 files changed

+79
-1
lines changed

2 files changed

+79
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ e2e-win-ci: ## Run end to end local tests on Windows CI, no Docker for Linux con
5050
go test -count=1 -v $(TEST_FLAGS) ./local/e2e/cli-only
5151

5252
e2e-aci: ## Run End to end ACI tests. Set E2E_TEST=TestName to run a single test
53-
go test -count=1 -v $(TEST_FLAGS) ./aci/e2e
53+
go test -timeout 15m -count=1 -v $(TEST_FLAGS) ./aci/e2e
5454

5555
e2e-ecs: ## Run End to end ECS tests. Set E2E_TEST=TestName to run a single test
5656
go test -timeout 20m -count=1 -v $(TEST_FLAGS) ./ecs/e2e/ecs ./ecs/e2e/ecs-local

kube/e2e/compose_test.go

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
/*
2+
Copyright 2020 Docker Compose CLI authors
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package e2e
18+
19+
import (
20+
"fmt"
21+
"net/http"
22+
"os"
23+
"strings"
24+
"testing"
25+
"time"
26+
27+
"gotest.tools/v3/assert"
28+
"gotest.tools/v3/icmd"
29+
30+
. "github.com/docker/compose-cli/utils/e2e"
31+
)
32+
33+
var binDir string
34+
35+
func TestMain(m *testing.M) {
36+
p, cleanup, err := SetupExistingCLI()
37+
if err != nil {
38+
fmt.Println(err)
39+
os.Exit(1)
40+
}
41+
binDir = p
42+
exitCode := m.Run()
43+
cleanup()
44+
os.Exit(exitCode)
45+
}
46+
47+
func TestComposeUp(t *testing.T) {
48+
c := NewParallelE2eCLI(t, binDir)
49+
50+
const projectName = "compose-kube-demo"
51+
52+
t.Run("create kube context", func(t *testing.T) {
53+
res := c.RunDockerCmd("context", "create", "kubernetes", "--kubeconfig", "/Users/gtardif/.kube/config", "--kubecontext", "docker-desktop", "kube-e2e")
54+
res.Assert(t, icmd.Expected{Out: `Successfully created kube context "kube-e2e"`})
55+
c.RunDockerCmd("context", "use", "kube-e2e")
56+
})
57+
58+
t.Run("up", func(t *testing.T) {
59+
c.RunDockerCmd("compose", "-f", "./kube-simple-demo/demo_sentences.yaml", "--project-name", projectName, "up", "-d")
60+
})
61+
62+
t.Run("check running project", func(t *testing.T) {
63+
res := c.RunDockerCmd("compose", "-p", projectName, "ps")
64+
res.Assert(t, icmd.Expected{Out: `web`})
65+
66+
endpoint := "http://localhost:95"
67+
output := HTTPGetWithRetry(t, endpoint+"/words/noun", http.StatusOK, 2*time.Second, 20*time.Second)
68+
assert.Assert(t, strings.Contains(output, `"word":`))
69+
})
70+
t.Run("down", func(t *testing.T) {
71+
_ = c.RunDockerCmd("compose", "--project-name", projectName, "down")
72+
})
73+
74+
t.Run("check containers after down", func(t *testing.T) {
75+
res := c.RunDockerCmd("ps", "--all")
76+
assert.Assert(t, !strings.Contains(res.Combined(), projectName), res.Combined())
77+
})
78+
}

0 commit comments

Comments
 (0)