From 682c2aa106a176e41a0c16620cca21ad57825b4e Mon Sep 17 00:00:00 2001 From: Tiexin Guo Date: Wed, 4 Sep 2024 13:12:02 +0800 Subject: [PATCH] test: integration test poc --- internals/testintegration/pebble_run_test.go | 8 +++++++- internals/testintegration/utils.go | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/internals/testintegration/pebble_run_test.go b/internals/testintegration/pebble_run_test.go index 22f50dfa..168b55cc 100644 --- a/internals/testintegration/pebble_run_test.go +++ b/internals/testintegration/pebble_run_test.go @@ -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) } } diff --git a/internals/testintegration/utils.go b/internals/testintegration/utils.go index 95108436..e40cbbf6 100644 --- a/internals/testintegration/utils.go +++ b/internals/testintegration/utils.go @@ -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 {