Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
marccampbell committed Oct 22, 2024
1 parent efa0f18 commit 39d1f01
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions pkg/integration/app_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package integration

import (
"fmt"
"os/exec"
"strings"
"testing"
Expand Down Expand Up @@ -29,14 +28,29 @@ func TestApp(t *testing.T) {
want: `ID NAME SLUG SCHEDULER
123 test test kots`,
},
{
name: "app-ls-single",
cli: "app ls --output json",
want: `[
{
"app": {
"id": "123",
"name": "test",
"scheduler": "kots",
"slug": "test",
"isFoundation": false
},
"channels": []
}
]`,
},
}

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
args := strings.Split(tt.cli, " ")
args = append(args, "--integration-test", tt.name)

fmt.Printf("args: %v\n", args)
cmd := exec.Command(CLIPath(), args...)
out, err := cmd.CombinedOutput()
if err != nil {
Expand All @@ -46,7 +60,7 @@ func TestApp(t *testing.T) {
trimmedWant := strings.TrimSpace(tt.want)
trimmedOut := strings.TrimSpace(string(out))
if trimmedWant != trimmedOut {
t.Errorf("\nwant: %v\ngot: %v", tt.want, string(out))
t.Errorf("\nwant: %v\ngot: %v", tt.want, string(out))
}
})
}
Expand Down

0 comments on commit 39d1f01

Please sign in to comment.