-
Notifications
You must be signed in to change notification settings - Fork 1
wip: adding basic tests #22
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
base: develop
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
This PR adds basic integration tests using k3d clusters and updates dependencies to newer versions. The changes include new test utilities for managing k3d clusters and kubectl operations, test suite configuration, and controller integration tests.
Key Changes:
- Added test infrastructure using k3d for integration testing
- Updated Go modules and Kubernetes dependencies to newer versions
- Migrated from envtest to k3d-based integration tests
- Updated controller code to use newer controller-runtime APIs
Reviewed Changes
Copilot reviewed 28 out of 29 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/utils/utils.go | Utility functions for running commands in tests |
| tests/utils/kubectl.go | Kubectl wrapper for test operations |
| tests/utils/k3d.go | K3d cluster management utilities |
| tests/suite_test.go | Test suite setup migrated from envtest to k3d |
| tests/controller_test.go | Integration tests for airlock controller |
| tests/assets/ | Test fixtures for MongoDB and airlock resources |
| go.mod | Invalid Go version 1.25.3 specified |
| go.sum | Updated dependency checksums |
| controllers/mongodbcluster_controller.go | Updated to newer controller-runtime API |
| main.go | Commented out metrics and webhook ports |
| config/ | Namespace changed from "system" to "airlock-system" |
| Makefile | Test command updated to use new test suite |
| .github/workflows/ | Invalid Go version 1.25 in golangci-lint workflow |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| _, hasConnectionString := secret.Data["connectionString"] | ||
| if !hasConnectionString { | ||
| return fmt.Errorf("generated secret is missing connectionSecret") |
Copilot
AI
Nov 20, 2025
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.
Typo in error message: "connectionSecret" should be "connectionString" to match the actual secret field being checked.
| return fmt.Errorf("generated secret is missing connectionSecret") | |
| return fmt.Errorf("generated secret is missing connectionString") |
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.
agreed
|
|
||
| Context("Airlock Controller", func() { | ||
| It("should run successfully", func() { | ||
| // FIXME: this is failig -_- |
Copilot
AI
Nov 20, 2025
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.
Typo in comment: "failig" should be "failing".
| // FIXME: this is failig -_- | |
| // FIXME: this is failing -_- |
| // MetricsBindAddress: metricsAddr, | ||
| // Port: 9443, |
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.
why commenting these out?
geekgonecrazy
left a comment
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.
Over all seems like a good improvement to be doing more integration testing and seeing how this thing will actually behave in a kubernetes cluster
| - --leader-elect | ||
| image: controller:latest | ||
| imagePullPolicy: Always | ||
| image: docker.io/library/controller:latest |
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.
erm, why change this?
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.
Will revert. Was checking something.
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.
Will revert. Was checking something.
| image: controller:latest | ||
| imagePullPolicy: Always | ||
| image: docker.io/library/controller:latest | ||
| imagePullPolicy: IfNotPresent |
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.
and this?
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.
Pull policy yes needs changing because I'm importing image to k3d, and always policy will not use that image but try to pull
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.
Pull policy yes needs changing because I'm importing image to k3d, and always policy will not use that image but try to pull
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.
Pull policy yes needs changing because I'm importing image to k3d, and always policy will not use that image but try to pull
| metadata: | ||
| name: controller-manager | ||
| namespace: system | ||
| namespace: airlock-system |
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.
I don't get why those changes to the namespace is needed.
In config/default/kustomization.yaml, there is
namespace: airlock-system
namePrefix: airlock-
so all resources here will go to that namespace, and be named correctly.....
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.
I'll revert. Did this before saw the kustomize file
| app.kubernetes.io/part-of: airlock | ||
| app.kubernetes.io/managed-by: kustomize | ||
| name: system | ||
| name: airlock-system |
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.
Yeah, this will break, it will be called airlock-airlock-system
|
|
||
| ready := false | ||
|
|
||
| // TODO: i doubt this is full proof |
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.
should we look in mongo to see if it actually created? or do we just trust ourselves?
| return err | ||
| } | ||
|
|
||
| _, hasConnectionString := secret.Data["connectionString"] |
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.
same here, should we try to connect?
No description provided.