Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 5fe2739

Browse files
committed
e2e test to check parameters validation
Signed-off-by: Nicolas De Loof <[email protected]>
1 parent f9f8aac commit 5fe2739

File tree

4 files changed

+64
-0
lines changed

4 files changed

+64
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
version: "3.6"
2+
services:
3+
api:
4+
image: python:3.6
5+
networks:
6+
back:
7+
front:
8+
aliases:
9+
- api.example.com
10+
- ${api.host}
11+
web:
12+
image: nginx:latest
13+
networks:
14+
- front
15+
volumes:
16+
- static:/opt/${static_subdir}
17+
ports:
18+
- ${web.port}:80
19+
db:
20+
image: postgres:9.3
21+
networks:
22+
- back
23+
networks:
24+
front:
25+
back:
26+
volumes:
27+
static:
28+
external: true
29+
name: corp/web-static-data
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: 1.1.0-beta1
2+
name: simple
3+
description: "new fancy webapp with microservices"
4+
maintainers:
5+
- name: John Developer
6+
7+
- name: Jane Developer
8+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
web:
2+
port: '8082'
3+
api:
4+
host: example.com
5+
static_subdir: data/static
6+
unused:
7+
parameter: FOO

e2e/validate_test.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package e2e
2+
3+
import (
4+
"path"
5+
"strings"
6+
"testing"
7+
8+
"gotest.tools/assert"
9+
10+
"gotest.tools/icmd"
11+
)
12+
13+
func TestOrphanedParameter(t *testing.T) {
14+
cmd, cleanup := dockerCli.createTestCmd()
15+
defer cleanup()
16+
p := path.Join("testdata", "invalid", "unused_parameter")
17+
cmd.Command = dockerCli.Command("app", "validate", p)
18+
out := icmd.RunCmd(cmd).Assert(t, icmd.Expected{ExitCode: 1}).Combined()
19+
assert.Assert(t, strings.Contains(out, "unused.parameter is declared as parameter but not used by the compose file"))
20+
}

0 commit comments

Comments
 (0)