Skip to content

Commit

Permalink
Add integration test
Browse files Browse the repository at this point in the history
Signed-off-by: Kim Christensen <kimworking@gmail.com>
  • Loading branch information
kichristensen committed Apr 8, 2024
1 parent 0631698 commit a6c5a73
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/integration/lint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,15 @@ func TestLint(t *testing.T) {
require.NotContains(t, output, "unknown command", "an unsupported mixin command should not be printed to the console in info")

}

func TestLint_DependenciesSameName(t *testing.T) {
test, err := tester.NewTest(t)
defer test.Close()
require.NoError(t, err, "test setup failed")

_, output, _ := test.RunPorterWith(func(cmd *shx.PreparedCommand) {
cmd.Args("lint")
cmd.In(filepath.Join(test.RepoRoot, "tests/integration/testdata/bundles/bundle-with-samenamedeps-lint-error"))
})
require.Contains(t, output, "error(porter-102) - Dependency error", "multiple dependencies with the same name should be an error")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# This bundle is designed to cause the porter lint/build commands to fail
schemaType: Bundle
schemaVersion: 1.0.1
name: exec-mixin-lint-error
version: 0.1.0
description: "This bundle is designed to cause the porter lint/build commands to fail, use --no-lint to use it anyway"
registry: "localhost:5000"

mixins:
- exec

dependencies:
requires:
- bundle:
reference: ghcr.io/getporter/porter-hello:v0.2.0
name: samename
- bundle:
reference: ghcr.io/getporter/porter-hello:v0.2.0
name: samename

install:
- exec:
description: trigger a lint error
command: echo
arguments:
- install

upgrade:
- exec:
description: "World 2.0"
command: echo
arguments:
- upgrade

uninstall:
- exec:
description: "Uninstall Hello World"
command: echo
arguments:
- uninstall

0 comments on commit a6c5a73

Please sign in to comment.