Skip to content

Commit

Permalink
test: integration test poc
Browse files Browse the repository at this point in the history
  • Loading branch information
IronCore864 committed Sep 4, 2024
1 parent 236800d commit 682c2aa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion internals/testintegration/pebble_run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,23 @@ services:
override: replace
command: sleep 1000
startup: enabled
demo-service2:
override: replace
command: sleep 1000
startup: enabled
`[1:]
CreateLayer(t, pebbleDir, "001-simple-layer.yaml", layerYAML)

logs := PebbleRun(t, pebbleDir)

expected := []string{
"Started daemon",
"Service \"demo-service\" starting",
"Service \"demo-service2\" starting",
"Started default services with change",
}

if foundAll, notFound := AllExpectedKeywordsFoundInLogs(logs, expected); !foundAll {
if foundAll, notFound := AllKeywordsFoundInLogs(logs, expected); !foundAll {
t.Errorf("Expected keywords not found in logs: %v", notFound)
}
}
2 changes: 1 addition & 1 deletion internals/testintegration/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func getRootDir() string {
return filepath.Join(wd, "../../")
}

func AllExpectedKeywordsFoundInLogs(logs []string, keywords []string) (bool, []string) {
func AllKeywordsFoundInLogs(logs []string, keywords []string) (bool, []string) {
var notFound []string

for _, keyword := range keywords {
Expand Down

0 comments on commit 682c2aa

Please sign in to comment.