-
Notifications
You must be signed in to change notification settings - Fork 173
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: move lint e2e test to unit test #3334
Conversation
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]>
✅ Deploy Preview for zarf-docs canceled.
|
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]>
@@ -130,14 +130,6 @@ init-package: ## Create the zarf init package (must `brew install coreutils` on | |||
release-init-package: | |||
$(ZARF_BIN) package create -o build -a $(ARCH) --set AGENT_IMAGE_TAG=$(AGENT_IMAGE_TAG) --confirm . | |||
|
|||
# INTERNAL: used to build an iron bank version of the init package with an ib version of the registry image |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shoving this into this PR. We don't do ironbank things anymore in Zarf, no reason to keep this around.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, added a few comments but no changes requested.
This is definitely outside the scope of the PR, but deleting e2e test 12 highlights to me that these should be named in their order. Add or remove one and all of the other tests are affected. If you agree, would you be interested in scoping out an issue to migrate e2e tests to no longer be numbered?
@@ -130,14 +130,6 @@ init-package: ## Create the zarf init package (must `brew install coreutils` on | |||
release-init-package: | |||
$(ZARF_BIN) package create -o build -a $(ARCH) --set AGENT_IMAGE_TAG=$(AGENT_IMAGE_TAG) --confirm . | |||
|
|||
# INTERNAL: used to build an iron bank version of the init package with an ib version of the registry image |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -128,15 +127,12 @@ func templateZarfObj(zarfObj any, setVariables map[string]string) ([]PackageFind | |||
}) | |||
} | |||
if _, present := setVariables[key]; !present { | |||
unSetTemplates = true | |||
findings = append(findings, PackageFinding{ | |||
Description: fmt.Sprintf("package template %s is not set and won't be evaluated during lint", key), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
} | ||
cwd, err := os.Getwd() | ||
require.NoError(t, err) | ||
// TODO @austinabro321: remove this and parallelize the test once changing the working directory is no longer required |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense keeping the scope of changes manageable.
@@ -93,3 +95,67 @@ func TestFillObjTemplate(t *testing.T) { | |||
require.ElementsMatch(t, expectedFindings, findings) | |||
require.Equal(t, expectedComponent, component) | |||
} | |||
|
|||
func TestLintPackageWithImports(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In an ideal world we would testing more cases which are smaller. But this makes sense as an iterative step in the right direction.
Codecov ReportAll modified and coverable lines are covered by tests ✅
|
Description
lint e2e test should be moved to a unit test for simplicity and to avoid checking output from the cli. Also simplifying the e2e test to focus on flavors, variables, and importing as we have other unit tests already for much for the lint rules.
Checklist before merging