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

Enable controller tests to run #2

Merged
merged 3 commits into from
Jan 26, 2022
Merged

Conversation

johnmcollier
Copy link

@johnmcollier johnmcollier commented Jan 25, 2022

The testenv-based controller tests for HAS were failing because the test environment couldn't see CRDs outside of HAS, so adding them to CRDDirectoryPaths in suite_test.go fixed things. kubernetes-sigs/controller-runtime#1191 outlines the root issue.

For the Trigger and PipelineRun CRDs, just referencing the Go module where they are stored was sufficient.

Since there isn't a Route CRD that we can use hosted on GitHub, like there is for the Tekton CRDs, to add the Route CRD to the tests, I had to do the following:

  • Clone https://github.com/openshift/api/
  • Manually run controller-gen to generate the Route CRD yaml: controller-gen crd:trivialVersions=true,preserveUnknownFields=false rbac:roleName=manager-role webhook paths="./route/v1" output:crd:artifacts:config=config/
  • Copy the generated Route CRD yaml over to this repository

I also updated some of the ComponentDetectionQuery test cases that were added to use a unique resource name for each test. We've found that our delete logic in the tests isn't all that great, and until it's fixed, having a unique name per resource helps to prevent some flaky tests

Signed-off-by: John Collier <jcollier@redhat.com>
Signed-off-by: John Collier <jcollier@redhat.com>
Signed-off-by: John Collier <jcollier@redhat.com>
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.

2 participants