-
Notifications
You must be signed in to change notification settings - Fork 34
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
chore(ci): refactor e2e package and ci tests to speed up ci #404
Conversation
WalkthroughThis update introduces several improvements and modifications across the codebase. Key changes include updates to the GitHub Actions workflow for testing, enhancements to the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Actionable comments posted: 1
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (16)
- .github/workflows/knuu_testing.yml (2 hunks)
- Makefile (1 hunks)
- e2e/assert_cleanups.go (3 hunks)
- e2e/assert_create.go (3 hunks)
- e2e/basic/probe_test.go (1 hunks)
- e2e/bittwister/bittwister_test.go (1 hunks)
- e2e/bittwister/main_test.go (1 hunks)
- e2e/system/build_from_git_test.go (2 hunks)
- e2e/system/env_to_json_test.go (4 hunks)
- e2e/system/external_file_test.go (1 hunks)
- e2e/system/file_test.go (1 hunks)
- e2e/system/file_test_image_cached_test.go (4 hunks)
- e2e/system/files_to_volumes_cm_test.go (10 hunks)
- e2e/system/folder_test.go (2 hunks)
- e2e/system/folder_test_image_cached_test.go (3 hunks)
- e2e/system/main_test.go (1 hunks)
Files skipped from review due to trivial changes (7)
- Makefile
- e2e/assert_cleanups.go
- e2e/bittwister/bittwister_test.go
- e2e/system/build_from_git_test.go
- e2e/system/external_file_test.go
- e2e/system/file_test.go
- e2e/system/main_test.go
Additional comments not posted (11)
e2e/bittwister/main_test.go (1)
1-19
: TheTestMain
function setup in thebittwister
package is well-implemented. It ensures that theknuu
package is initialized before any tests are run and properly handles any initialization errors. The use oflogrus
for logging the scope and fatal errors is appropriate. Exiting with the test run's exit value is also correctly implemented..github/workflows/knuu_testing.yml (2)
5-23
: The modifications to the workflow file introduce a matrix strategy for running tests, which is a great way to parallelize and manage different test configurations. The inclusion of specific packages with designated timeouts is a thoughtful approach to managing test execution time. This setup should effectively help in speeding up the CI process as intended.
43-46
: The dynamic configuration of themake test
command using matrix variables for package paths and timeouts is a robust way to handle test executions across different configurations. This change should contribute significantly to the flexibility and efficiency of the CI process.e2e/system/folder_test.go (1)
22-31
: The refactoring of the test to useAssertCreateInstanceNginxWithVolumeOwnerWithoutCommit
for creating the instance without committing it immediately allows for more granular control over the test flow, especially with subsequent operations likeAddFolder
andCommit
. This change enhances the test's clarity and control over the instance lifecycle.e2e/system/folder_test_image_cached_test.go (2)
29-42
: The testTestFolderCached
effectively demonstrates the use of concurrency withsync.WaitGroup
and goroutines to handle multiple instances. The update to useAssertCreateInstanceNginxWithVolumeOwner
from thee2e
package ensures consistency and reuse of test setup logic across different tests. This is a good practice in maintaining clean and maintainable test code.
48-48
: Proper cleanup usingAssertCleanupInstances
is crucial in tests, especially when dealing with multiple instances like in this test. This ensures that resources are properly released after tests, preventing potential resource leaks or conflicts in subsequent tests.e2e/system/file_test_image_cached_test.go (2)
27-27
: The use ofAssertCreateInstanceNginxWithVolumeOwner
for instance creation in the cached file test is consistent with other tests, promoting code reuse and maintainability. This standardization is beneficial for maintaining a uniform approach across different tests.
47-47
: Ensuring proper cleanup in tests is essential, and the use ofAssertCleanupInstances
here follows best practices in test hygiene. This is particularly important in a test environment where multiple instances are created and manipulated.e2e/assert_create.go (1)
Line range hint
22-45
: Splitting the instance creation into two separate functions (AssertCreateInstanceNginxWithVolumeOwnerWithoutCommit
andAssertCreateInstanceNginxWithVolumeOwner
) is a good practice. It allows for more flexible test design, where tests can opt to manipulate the instance state further before committing. This change enhances both the flexibility and clarity of the test code.e2e/system/env_to_json_test.go (1)
Line range hint
19-136
: The enhancements to environment variable handling in the test improve its functionality and clarity.e2e/system/files_to_volumes_cm_test.go (1)
48-48
: The updates to use thee2e
package for function calls and cleanup enhance the test's modularity and maintainability.Also applies to: 114-114, 160-160, 191-191, 243-243, 272-272, 324-324, 356-356
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.
lgtm!
left a question
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- e2e/system/build_from_git_test.go (3 hunks)
Files skipped from review as they are similar to previous changes (1)
- e2e/system/build_from_git_test.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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- e2e/bittwister/bittwister_test.go (1 hunks)
- e2e/system/folder_test.go (2 hunks)
Files skipped from review as they are similar to previous changes (2)
- e2e/bittwister/bittwister_test.go
- e2e/system/folder_test.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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (8)
- Makefile (2 hunks)
- e2e/basic/probe_test.go (1 hunks)
- e2e/bittwister/main_test.go (1 hunks)
- e2e/system/file_test_image_cached_test.go (4 hunks)
- e2e/system/files_to_volumes_cm_test.go (10 hunks)
- e2e/system/folder_test.go (2 hunks)
- e2e/system/main_test.go (1 hunks)
- pkg/builder/kaniko/utils_test.go (2 hunks)
Files skipped from review due to trivial changes (1)
- pkg/builder/kaniko/utils_test.go
Files skipped from review as they are similar to previous changes (7)
- Makefile
- e2e/basic/probe_test.go
- e2e/bittwister/main_test.go
- e2e/system/file_test_image_cached_test.go
- e2e/system/files_to_volumes_cm_test.go
- e2e/system/folder_test.go
- e2e/system/main_test.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.
LGTM!
Overview
Closes #403
This PR does the following:
We could also now enable the tests that are passing as required, which I highly recommend. So that we have better protection on future changes.
Summary by CodeRabbit
New Features
Bug Fixes
Refactor
basic
tosystem
across multiple test files for better organization.e2e
package.Chores
timeout
variable in theMakefile
for dynamic test timeout configuration.