Skip to content

Commit

Permalink
fix: disable dupl linter on some e2e tests
Browse files Browse the repository at this point in the history
Linter complains that the expected event lists are too similar,
which is deliberate and should not be abstracted away. Explicit
test expectations in the test makes it easier to debug failures.
  • Loading branch information
karlkfi committed Nov 4, 2021
1 parent a24aaea commit 9426fcb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/e2e/crd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
)

//nolint:dupl // expEvents similar to mutation tests
func crdTest(_ client.Client, invConfig InventoryConfig, inventoryName, namespaceName string) {
By("apply a set of resources that includes both a crd and a cr")
applier := invConfig.ApplierFactoryFunc()
Expand All @@ -38,7 +39,6 @@ func crdTest(_ client.Client, invConfig InventoryConfig, inventoryName, namespac
EmitStatusEvents: false,
}))

//nolint:dupl
expEvents := []testutil.ExpEvent{
{
// InitTask
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/mutation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (
// we test a toy example with a pod-a depending on pod-b, injecting the ip and
// port from pod-b into an environment variable of pod-a.

//nolint:dupl // expEvents similar to CRD tests
func mutationTest(c client.Client, invConfig InventoryConfig, inventoryName, namespaceName string) {
By("apply resources in order with substitutions based on apply-time-mutation annotation")
applier := invConfig.ApplierFactoryFunc()
Expand All @@ -51,7 +52,6 @@ func mutationTest(c client.Client, invConfig InventoryConfig, inventoryName, nam
EmitStatusEvents: false,
}))

//nolint:dupl
expEvents := []testutil.ExpEvent{
{
// InitTask
Expand Down

0 comments on commit 9426fcb

Please sign in to comment.