-
Couldn't load subscription status.
- Fork 8
test: Enhance e2e tests for recently added features #67
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: main
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.
HI @earaghbidikashani. Thank you for your work. Could you please create test *.yamls non-inline as files and put them in static sub-folder in test or test/e2e folder (if they are only used by e2e)?
I know that our existing e2e tests define files inline but it's a bad practice, we should refactor existing tests doing that and not add new ones doing that.
|
Created #69 to track the need to refactor other / existing e2e tests to use static *.yaml files instead of defining them inline |
5b41fc7 to
9ffd03b
Compare
Sure @andrii-i, added static files for the new tests I added |
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.
Note that the invalid-resources test only creates the Workspace and checks that a status section exists and that the Workspace object is present. Should it also assert that the operator marks the Workspace as invalid (or rejects the creation) when the Workspace resource spec is invalid?
Note that the access-strategy test currently verifies the WorkspaceAccessStrategy exists and the Workspace.spec references it. Should it also verify the end-to-end behavior: that the controller materializes the configured access resources, that an access URL is populated on the Workspace status and templating is resolved, that access-related environment variables are applied to the generated workload spec, and also potentially that access resources/status are removed when the Workspace stops and recreated when it runs again?
2a12b88 to
7a02d48
Compare
Add comprehensive e2e test coverage
This PR expands the end-to-end test suite to provide better coverage of the jupyter-k8s operator's core functionality.
Changes
New test files:
• workspace_lifecycle_test.go - Tests workspace creation, status transitions, and resource validation
• workspace_access_test.go - Tests WorkspaceAccessStrategy creation and workspace integration
Enhanced existing tests:
• Fixed flaky webhook connectivity issues in workspace_scheduling_test.go by adding webhook readiness checks
• Re-enabled previously disabled scheduling tests with improved reliability
Makefile improvements:
• Added FOCUS parameter support to test-e2e target for running specific tests: make test-e2e FOCUS="test name"
Test Coverage Added
Workspace Lifecycle:
• Workspace creation with valid configurations
• Status condition management (Valid, Degraded conditions)
• Workspace state transitions (Running → Stopped)
• Resource validation handling for invalid configurations
Access Control:
• WorkspaceAccessStrategy resource creation and configuration
• Workspace integration with access strategies via accessStrategy.name references
• Access URL templates and resource template functionality
Reliability Improvements:
• Added webhook readiness verification to prevent connection refused errors
• Improved controller startup detection with proper retry logic
All tests use the //go:build e2e tag and integrate with the existing test infrastructure using Kind clusters and the standard make test-e2e workflow.
closes #45