Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: change e2e tests to use new log format #3318

Merged
merged 16 commits into from
Dec 13, 2024
Merged

Conversation

AustinAbro321
Copy link
Contributor

@AustinAbro321 AustinAbro321 commented Dec 11, 2024

Description

change e2e test to use new log format

Related Issue

Fixes #3304

Checklist before merging

Signed-off-by: Austin Abro <[email protected]>
Copy link

netlify bot commented Dec 11, 2024

Deploy Preview for zarf-docs canceled.

Name Link
🔨 Latest commit eefd78a
🔍 Latest deploy log https://app.netlify.com/sites/zarf-docs/deploys/675c80a8f8310e000887e1d3

Copy link

codecov bot commented Dec 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
@AustinAbro321 AustinAbro321 changed the title test: change e2e test to use new log format test: change e2e tests to use new log format Dec 13, 2024
Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
Copy link
Contributor

@mkcp mkcp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good changes, one question about unit test coverage of zarfState redactions to make sure we can catch regressions.

@@ -30,7 +32,19 @@ type ZarfE2ETest struct {
ApplianceModeKeep bool
}

var logRegex = regexp.MustCompile(`Saving log file to (?P<logFile>.*?\.log)`)
// GetLogger returns the default log configuration for the tests.
func GetLogger(t *testing.T) *slog.Logger {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

suite.NoError(err)
suite.Contains(stdErr, "Published "+ref)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 to fewer suite.Contains

@@ -108,23 +103,6 @@ func TestZarfInit(t *testing.T) {
_, _, _ = e2e.Kubectl(t, "scale", "deploy", "-n", "zarf", "agent-hook", "--replicas=1") //nolint:errcheck
}

func checkLogForSensitiveState(t *testing.T, logText string, zarfState types.ZarfState) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have unit test coverage for zarfState redactions?

@AustinAbro321 AustinAbro321 marked this pull request as ready for review December 13, 2024 19:25
@AustinAbro321 AustinAbro321 requested review from a team as code owners December 13, 2024 19:25
@AustinAbro321 AustinAbro321 added this pull request to the merge queue Dec 13, 2024
Merged via the queue into main with commit 6c86967 Dec 13, 2024
26 checks passed
@AustinAbro321 AustinAbro321 deleted the move-e2e-log-format branch December 13, 2024 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change e2e tests to run with --log-format flag
2 participants