This repository has been archived by the owner on Jun 13, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
e2e test to check parameters validation
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
- Loading branch information
Showing
4 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
e2e/testdata/invalid/unused_parameter.dockerapp/docker-compose.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
version: "3.6" | ||
services: | ||
api: | ||
image: python:3.6 | ||
networks: | ||
back: | ||
front: | ||
aliases: | ||
- api.example.com | ||
- ${api.host} | ||
web: | ||
image: nginx:latest | ||
networks: | ||
- front | ||
volumes: | ||
- static:/opt/${static_subdir} | ||
ports: | ||
- ${web.port}:80 | ||
db: | ||
image: postgres:9.3 | ||
networks: | ||
- back | ||
networks: | ||
front: | ||
back: | ||
volumes: | ||
static: | ||
external: true | ||
name: corp/web-static-data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
version: 1.1.0-beta1 | ||
name: simple | ||
description: "new fancy webapp with microservices" | ||
maintainers: | ||
- name: John Developer | ||
email: john.dev@example.com | ||
- name: Jane Developer | ||
email: jane.dev@example.com |
7 changes: 7 additions & 0 deletions
7
e2e/testdata/invalid/unused_parameter.dockerapp/parameters.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
web: | ||
port: '8082' | ||
api: | ||
host: example.com | ||
static_subdir: data/static | ||
unused: | ||
parameter: FOO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package e2e | ||
|
||
import ( | ||
"path" | ||
"testing" | ||
|
||
"gotest.tools/assert" | ||
|
||
"gotest.tools/icmd" | ||
) | ||
|
||
func TestOrphanedParameter(t *testing.T) { | ||
cmd, cleanup := dockerCli.createTestCmd() | ||
defer cleanup() | ||
p := path.Join("testdata", "invalid", "unused_parameter") | ||
cmd.Command = dockerCli.Command("app", "validate", p) | ||
out := icmd.RunCmd(cmd).Assert(t, icmd.Expected{ExitCode: 1}).Combined() | ||
assert.Equal(t, out, "unused.parameter is declared as parameter but not used by the compose file") | ||
} |