-
Notifications
You must be signed in to change notification settings - Fork 64
🌱 [Monorepo]: Move e2e tests from catalogd to operator-controller #1726
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
🌱 [Monorepo]: Move e2e tests from catalogd to operator-controller #1726
Conversation
✅ Deploy Preview for olmv1 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
d956d77
to
dcd88ca
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1726 +/- ##
==========================================
+ Coverage 68.02% 68.22% +0.19%
==========================================
Files 59 58 -1
Lines 5004 4988 -16
==========================================
- Hits 3404 3403 -1
+ Misses 1358 1343 -15
Partials 242 242
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
b3d3c79
to
2ab4f40
Compare
@@ -79,7 +79,7 @@ var _ = Describe("ClusterCatalog Unpacking", func() { | |||
actualFBC, err := ReadTestCatalogServerContents(ctx, catalog, c, kubeClient) | |||
Expect(err).To(Not(HaveOccurred())) | |||
|
|||
expectedFBC, err := os.ReadFile("../../testdata/catalogs/test-catalog/expected_all.json") | |||
expectedFBC, err := os.ReadFile("../../catalogd/testdata/catalogs/test-catalog/expected_all.json") |
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.
We cannot move now the testdata/catalogs to the root because it will broke the sync:
2ab4f40
to
9e8f2d5
Compare
448c0ee
to
38d9bae
Compare
catalogd/Makefile
Outdated
|
||
image-registry: ## Setup in-cluster image registry | ||
./test/tools/imageregistry/registry.sh $(ISSUER_KIND) $(ISSUER_NAME) | ||
./../test/tools/imageregistry/registry.sh $(ISSUER_KIND) $(ISSUER_NAME) |
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.
Do we need this in both Makefiles (i.e. operator-controller and catalogd)?
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 a follow-up, we can probably combine both. But for now, I felt better keep in this away because they are not the same code implementation.
See
.PHONY: image-registry
E2E_REGISTRY_IMAGE=localhost/e2e-test-registry:devel
image-registry: export GOOS=linux
image-registry: export GOARCH=amd64
image-registry: ## Build the testdata catalog used for e2e tests and push it to the image registry
go build $(GO_BUILD_FLAGS) -tags '$(GO_BUILD_TAGS)' -ldflags '$(GO_BUILD_LDFLAGS)' -gcflags '$(GO_BUILD_GCFLAGS)' -asmflags '$(GO_BUILD_ASMFLAGS)' -o ./testdata/registry/bin/registry ./testdata/registry/registry.go
go build $(GO_BUILD_FLAGS) -tags '$(GO_BUILD_TAGS)' -ldflags '$(GO_BUILD_LDFLAGS)' -gcflags '$(GO_BUILD_GCFLAGS)' -asmflags '$(GO_BUILD_ASMFLAGS)' -o ./testdata/push/bin/push ./testdata/push/push.go
$(CONTAINER_RUNTIME) build -f ./testdata/Dockerfile -t $(E2E_REGISTRY_IMAGE) ./testdata
$(CONTAINER_RUNTIME) save $(E2E_REGISTRY_IMAGE) | $(KIND) load image-archive /dev/stdin --name $(KIND_CLUSTER_NAME)
./testdata/build-test-registry.sh $(E2E_REGISTRY_NAMESPACE) $(E2E_REGISTRY_NAME) $(E2E_REGISTRY_IMAGE) <- Call another implementation
catalogd-image-registry: ## Setup in-cluster image registry
./test/tools/imageregistry/registry.sh $(ISSUER_KIND) $(ISSUER_NAME)
@@ -209,6 +213,39 @@ test-e2e: KUSTOMIZE_BUILD_DIR := config/overlays/e2e | |||
test-e2e: GO_BUILD_FLAGS := -cover | |||
test-e2e: run image-registry e2e e2e-coverage kind-clean #HELP Run e2e test suite on local kind cluster |
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.
If I'm reading the Makefile correctly, we have:
test-e2e
- runs operator-controller
e2e only
catalogd-e2e
- runs catalogd
e2e only
I think we need some more clear separation between the e2e for the two components. I'd prefer this as a follow-up if we do change it, but IMO we should have:
test-e2e
- runs both operator-controller
and catalogd
e2e
catalogd-e2e
- runscatalogd
e2e only
operator-controller-e2e
- runs operator-controller
e2e only
We could then have the github actions run the catalogd-e2e
and operator-controller-e2e
in two separate jobs as it does now, but with slightly more clear job names. WDYT?
Again though, don't do that on this PR if you agree, I think this one is big enough already :)
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.
HI @dtfranz
I also want :-) That is what I expected we have at some point:
test-e2e - runs both operator-controller and catalogd e2e
upgrade-e2e runs for both
But that needs to be follow ups.
We need to do step by step
- We need change the tests to no longer use Omega Ginkgo
- Then, we can start to began to combine
- We will need to combine as well the image registry and going on
We need to split. Otherwise, it is too much for a single go
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.
Left a comment on the Makefile above but otherwise /lgtm!
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.
The PR takes another step in the direction of merging operator-controller and catalogd by moving the catalogd tools and e2e tests under the top-level test and tools directories. Only the required changes to the catalogd Makefile and e2e GHA were made in order to ensure the tests are still being correctly executed by CI. Follow-ups will continue the work of merging the projects.
Awesome work <3 thank you!
apidiff failure is due to moving an e2e test, unavoidable as we merge the directory hierarchies. |
5737736
to
f0c952e
Compare
@grokspawn rebased with main :-) |
Pull Request is not mergeable
Motivated by: #1712