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

🌱 fix run unit test locally #2581

Conversation

camilamacedo86
Copy link
Member

@camilamacedo86 camilamacedo86 commented Mar 30, 2022

Description
🌱 fix run unit test and coverage test by removing the race flag

Why?
The tests implemented for the config-gen alpha command are not working locally with this option:

--- FAIL: TestNewCommand (0.02s)
    --- 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=0x4e2e04a]

E.g the above was using (mac os/amd64) besides working on the ci.

We might need to look for how to come back to the -race option in the future. (I'd suggest seeing if we can migrate alpha-gen to the plugin first)
This pr unblocks contributors that want to run the tests locally.

Closes; #2567

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Mar 30, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: camilamacedo86

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 30, 2022
@camilamacedo86 camilamacedo86 changed the title 🌱 fix run unit test and and coverage test by removing the race flag 🌱 fix run unit test locally Mar 30, 2022
Copy link
Member

@AlmogBaku AlmogBaku left a comment

Choose a reason for hiding this comment

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

After investigating further, I found another issue that causing this:

  1. /pkg/cli/alpha/config-gen/testdata/project is missing a go module. Creating a module there solves the problem
  2. /pkg/cli/alpha/config-gen/controller-gen-filer.go:L67 ignoring a critical issue

Since this is especially breaking since go 1.18, I'll add this fix as part of my PR

@camilamacedo86
Copy link
Member Author

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 1, 2022
@camilamacedo86
Copy link
Member Author

/hold cancel

@camilamacedo86 camilamacedo86 reopened this Apr 2, 2022
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 2, 2022
@camilamacedo86
Copy link
Member Author

/hold

I'd like to

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants