Skip to content

Unit tests are not working locally (go 1.17.5) #2567

Closed
@camilamacedo86

Description

@camilamacedo86

What broke? What's expected?

The make test is not working locally
That fails when we run go test -race ./pkg/...

Reproducing this issue

It was reported on the channel that someone was not able to run the tests.
the tests are called in the CI and works see: https://github.com/kubernetes-sigs/kubebuilder/runs/5605172452?check_suite_focus=true#step:5:1

However, I tried to run with;

  • Mac os (darwin_amd64)
  • Go 1.17.5

And also faced issues:

--- FAIL: TestNewCommand (0.03s)
    --- FAIL: TestNewCommand/testdata/componentconfig (0.02s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x4e258ea]

goroutine 23 [running]:
testing.tRunner.func1.2({0x4f3a160, 0x59b1970})
	/usr/local/Cellar/go/1.17.5/libexec/src/testing/testing.go:1209 +0x36c
testing.tRunner.func1()
	/usr/local/Cellar/go/1.17.5/libexec/src/testing/testing.go:1212 +0x3b6
panic({0x4f3a160, 0x59b1970})
	/usr/local/Cellar/go/1.17.5/libexec/src/runtime/panic.go:1047 +0x266
sigs.k8s.io/kubebuilder/v3/pkg/cli/alpha/config-gen.ControllerGenFilter.Filter({0x0}, {0x0, 0x0, 0x4071325})
	/Users/camilamacedo86/go/src/sigs.k8s.io/kubebuilder/pkg/cli/alpha/config-gen/controller-gen-filter.go:68 +0x58a
sigs.k8s.io/kustomize/kyaml/fn/framework.(*TemplateProcessor).doPreProcess(0xc00016cfc0, {0x0, 0x0, 0x0})
	/Users/camilamacedo86/go/pkg/mod/sigs.k8s.io/kustomize/[email protected]/fn/framework/processors.go:280 +0x17b
sigs.k8s.io/kustomize/kyaml/kio.FilterFunc.Filter(0xc000427ae0, {0x0, 0x0, 0x0})
	/Users/camilamacedo86/go/pkg/mod/sigs.k8s.io/kustomize/[email protected]/kio/kio.go:60 +0x52
sigs.k8s.io/kustomize/kyaml/kio.Pipeline.ExecuteWithCallback({{0xc0004a5178, 0x1, 0x1}, {0xc0004a51f0, 0x5, 0x5}, {0xc0004a5168, 0x1, 0x1}, 0x1}, ...)
	/Users/camilamacedo86/go/pkg/mod/sigs.k8s.io/kustomize/[email protected]/kio/kio.go:120 +0x32b
sigs.k8s.io/kustomize/kyaml/kio.Pipeline.Execute(...)
	/Users/camilamacedo86/go/pkg/mod/sigs.k8s.io/kustomize/[email protected]/kio/kio.go:93
sigs.k8s.io/kustomize/kyaml/fn/framework.TemplateProcessor.Filter({{0x5004bc0, 0xc0001bcc00}, {0xc0003cdcc0, 0x1, 0x1}, {0xc000473710, 0x3, 0x3}, 0x1, {0xc0003cdca0, ...}, ...}, ...)
	/Users/camilamacedo86/go/pkg/mod/sigs.k8s.io/kustomize/[email protected]/fn/framework/processors.go:245 +0x73a
sigs.k8s.io/kustomize/kyaml/fn/framework.(*ResourceList).Filter(0xc000473b00, {0x5239740, 0xc00016cf30})
	/Users/camilamacedo86/go/pkg/mod/sigs.k8s.io/kustomize/[email protected]/fn/framework/framework.go:144 +0x74
sigs.k8s.io/kustomize/kyaml/fn/framework.TemplateProcessor.Process({{0x5004bc0, 0xc0001bcc00}, {0xc0003cdcc0, 0x1, 0x1}, {0xc000473710, 0x3, 0x3}, 0x1, {0xc0003cdca0, ...}, ...}, ...)
	/Users/camilamacedo86/go/pkg/mod/sigs.k8s.io/kustomize/[email protected]/fn/framework/processors.go:259 +0x138
sigs.k8s.io/kustomize/kyaml/fn/framework.Execute({0x5239720, 0xc00016ccf0}, 0xc000195970)
	/Users/camilamacedo86/go/pkg/mod/sigs.k8s.io/kustomize/[email protected]/fn/framework/framework.go:118 +0x39e
sigs.k8s.io/kustomize/kyaml/fn/framework/command.Build.func1(0xc00047a280, {0xc000427530, 0x1, 0x1})
	/Users/camilamacedo86/go/pkg/mod/sigs.k8s.io/kustomize/[email protected]/fn/framework/command/command.go:101 +0x40b
github.com/spf13/cobra.(*Command).execute(0xc00047a280, {0xc0004273b0, 0x1, 0x1})
	/Users/camilamacedo86/go/pkg/mod/github.com/spf13/[email protected]/command.go:856 +0xa7e
github.com/spf13/cobra.(*Command).ExecuteC(0xc00047a280)
	/Users/camilamacedo86/go/pkg/mod/github.com/spf13/[email protected]/command.go:974 +0x5db
github.com/spf13/cobra.(*Command).Execute(...)
	/Users/camilamacedo86/go/pkg/mod/github.com/spf13/[email protected]/command.go:902
sigs.k8s.io/kustomize/kyaml/fn/framework/frameworktestutil.(*CommandResultsChecker).Assert.func1()
	/Users/camilamacedo86/go/pkg/mod/sigs.k8s.io/kustomize/[email protected]/fn/framework/frameworktestutil/frameworktestutil.go:114 +0x505
sigs.k8s.io/kustomize/kyaml/fn/framework/frameworktestutil.(*resultsChecker).runDirectoryTestCase.func2(0xc000423d40)
	/Users/camilamacedo86/go/pkg/mod/sigs.k8s.io/kustomize/[email protected]/fn/framework/frameworktestutil/frameworktestutil.go:303 +0xe2
testing.tRunner(0xc000423d40, 0xc0004800c0)
	/usr/local/Cellar/go/1.17.5/libexec/src/testing/testing.go:1259 +0x230
created by testing.(*T).Run
	/usr/local/Cellar/go/1.17.5/libexec/src/testing/testing.go:1306 +0x727

then, we need to check why to solve it or add the guidance in the Contribution doc

KubeBuilder (CLI) Version

master

PROJECT version

No response

Plugin versions

No response

Other versions

No response

Extra Labels

/kind regression

Metadata

Metadata

Assignees

Labels

kind/bugCategorizes issue or PR as related to a bug.kind/regressionCategorizes issue or PR as related to a regression from a prior release.kind/supportCategorizes issue or PR as a support question.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions