-
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: refactor e2e tests to have a common suite for all tests #554
chore: refactor e2e tests to have a common suite for all tests #554
Conversation
WalkthroughThe changes encompass modifications to the test suite structure across multiple files in the Changes
Assessment against linked issues
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 Configuration 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: 2
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (15)
- e2e/basic/probe_test.go (2 hunks)
- e2e/basic/reverse_proxy_test.go (3 hunks)
- e2e/basic/suite_setup_test.go (3 hunks)
- e2e/netshaper/suite_setup_test.go (2 hunks)
- e2e/suite.go (1 hunks)
- e2e/system/build_from_git_test.go (1 hunks)
- e2e/system/env_to_json_test.go (3 hunks)
- e2e/system/external_file_test.go (3 hunks)
- e2e/system/file_test.go (2 hunks)
- e2e/system/file_test_image_cached_test.go (4 hunks)
- e2e/system/files_to_volumes_cm_test.go (9 hunks)
- e2e/system/folder_test.go (2 hunks)
- e2e/system/folder_test_image_cached_test.go (3 hunks)
- e2e/system/start_callback_test.go (2 hunks)
- e2e/system/suite_setup_test.go (3 hunks)
Additional comments not posted (50)
e2e/netshaper/suite_setup_test.go (1)
14-14
: LGTM!The
Suite
struct now extendse2e.Suite
, which aligns with the objective of centralizing theSuite
struct within thee2e
package.The code changes are approved.
e2e/system/folder_test.go (1)
19-20
: LGTM!The function now uses
CreateNginxInstanceWithVolume
ande2e.NginxHTMLPath
, which improves the visibility and maintainability of the code.The code changes are approved.
e2e/basic/suite_setup_test.go (1)
25-25
: LGTM!The
Suite
struct now extendse2e.Suite
, which aligns with the objective of centralizing theSuite
struct within thee2e
package.The code changes are approved.
e2e/system/suite_setup_test.go (1)
25-25
: LGTM!The
Suite
struct has been simplified by embeddinge2e.Suite
, which enhances maintainability and readability.The code changes are approved.
e2e/basic/probe_test.go (3)
21-21
: LGTM!The method
createNginxInstanceWithVolume
has been renamed toCreateNginxInstanceWithVolume
, making it public and enhancing its accessibility.The code changes are approved.
23-23
: LGTM!The path for the HTML resource file is updated to use
e2e.NginxHTMLPath
, enhancing modularity and maintainability.The code changes are approved.
30-30
: LGTM!The port number for the HTTP probe is now sourced from
e2e.NginxPort
, reinforcing the use of constants defined in thee2e
package and improving maintainability and clarity.The code changes are approved.
e2e/system/external_file_test.go (2)
20-20
: LGTM!The method
createNginxInstance
has been renamed toCreateNginxInstance
, making it public and enhancing its accessibility.The code changes are approved.
40-40
: LGTM!The path used in the
AddFile
method of the server's storage is modified to usee2e.NginxHTMLPath
, enhancing modularity and maintainability.The code changes are approved.
e2e/system/folder_test_image_cached_test.go (3)
8-8
: LGTM!The import statement correctly adds the
e2e
package, which is necessary for the new references.The code changes are approved.
26-26
: LGTM!The function correctly uses the public method
CreateNginxInstanceWithVolume
.The code changes are approved.
35-35
: LGTM!The path reference
e2e.NginxHTMLPath
improves maintainability and readability.The code changes are approved.
e2e/system/start_callback_test.go (4)
9-10
: LGTM!The import statement correctly adds the
e2e
package, which is necessary for the new references.The code changes are approved.
22-22
: LGTM!The function correctly uses the public method
CreateNginxInstance
.The code changes are approved.
30-30
: LGTM!The port number reference
e2e.NginxPort
improves maintainability and readability.The code changes are approved.
36-36
: LGTM!The start command reference
e2e.NginxCommand
improves maintainability and readability.The code changes are approved.
e2e/system/env_to_json_test.go (4)
9-9
: LGTM!The import statement correctly adds the
e2e
package, which is necessary for the new references.The code changes are approved.
41-41
: LGTM!The function correctly uses the public method
CreateNginxInstance
.The code changes are approved.
45-45
: LGTM!The path reference
e2e.NginxHTMLPath
improves maintainability and readability.The code changes are approved.
57-57
: LGTM!The path reference
e2e.NginxHTMLPath
improves maintainability and readability.The code changes are approved.
e2e/system/file_test_image_cached_test.go (3)
32-32
: Change method visibility to publicThe method
createNginxInstanceWithVolume
is nowCreateNginxInstanceWithVolume
. This change makes the method public, allowing it to be accessed outside its original package.The code changes are approved.
40-41
: Change method visibility to publicThe method
retryOperation
is nowRetryOperation
. This change makes the method public, allowing it to be accessed outside its original package.The code changes are approved.
41-41
: Use constants for maintainabilityThe hardcoded string has been replaced with the constant
e2e.NginxHTMLPath
. This change improves code maintainability by centralizing the path definition.The code changes are approved.
e2e/system/build_from_git_test.go (1)
68-68
: Change method visibility to publicThe method
retryOperation
is nowRetryOperation
. This change makes the method public, allowing it to be accessed outside its original package.The code changes are approved.
e2e/basic/reverse_proxy_test.go (2)
51-51
: Change method visibility to publicThe method
createNginxInstance
is nowCreateNginxInstance
. This change makes the method public, allowing it to be accessed outside its original package.The code changes are approved.
79-79
: Use constants for maintainabilityThe hardcoded port has been replaced with the constant
e2e.NginxPort
. This change improves code maintainability by centralizing the port configuration.The code changes are approved.
e2e/suite.go (9)
17-20
: LGTM!The constants are correctly defined and improve maintainability by centralizing the path and port definitions.
The code changes are approved.
22-24
: LGTM!The constants are correctly defined and improve maintainability by centralizing the image and volume owner definitions.
The code changes are approved.
26-34
: LGTM!The
Suite
struct is correctly defined and includes necessary fields for managing the test suite.The code changes are approved.
40-44
: LGTM!The
SetupTest
function is correctly implemented.The code changes are approved.
46-56
: LGTM!The
TearDownTest
function is correctly implemented and ensures proper cleanup after the last test.The code changes are approved.
58-64
: LGTM!The
cleanupSuite
function is correctly implemented and handles errors during the cleanup process.The code changes are approved.
66-72
: LGTM!The
CreateNginxInstance
function is correctly implemented and handles instance creation, image setting, and port addition.The code changes are approved.
75-82
: LGTM!The
CreateNginxInstanceWithVolume
function is correctly implemented and handles instance creation, directory addition, and volume addition.The code changes are approved.
85-94
: LGTM!The
RetryOperation
function is correctly implemented and handles retry logic with exponential backoff.The code changes are approved.
e2e/system/file_test.go (5)
29-33
: LGTM!The changes to use public methods and centralized path constants improve maintainability and consistency.
The code changes are approved.
38-38
: LGTM!The changes to use public methods and centralized path constants improve maintainability and consistency.
The code changes are approved.
46-46
: LGTM!The changes to use public methods and centralized path constants improve maintainability and consistency.
The code changes are approved.
54-54
: LGTM!The changes to use public methods and centralized path constants improve maintainability and consistency.
The code changes are approved.
61-61
: LGTM!The changes to use public methods and centralized path constants improve maintainability and consistency.
The code changes are approved.
e2e/system/files_to_volumes_cm_test.go (10)
26-26
: LGTM!The changes to use public methods and centralized path constants improve maintainability and consistency.
The code changes are approved.
54-54
: LGTM!The changes to use public methods and centralized path constants improve maintainability and consistency.
The code changes are approved.
92-92
: LGTM!The changes to use public methods and centralized path constants improve maintainability and consistency.
The code changes are approved.
104-104
: LGTM!The changes to use public methods and centralized path constants improve maintainability and consistency.
The code changes are approved.
148-148
: LGTM!The changes to use public methods and centralized path constants improve maintainability and consistency.
The code changes are approved.
157-157
: LGTM!The changes to use public methods and centralized path constants improve maintainability and consistency.
The code changes are approved.
201-201
: LGTM!The changes to use public methods and centralized path constants improve maintainability and consistency.
The code changes are approved.
209-210
: LGTM!The changes to use public methods and centralized path constants improve maintainability and consistency.
The code changes are approved.
214-214
: LGTM!The changes to use public methods and centralized path constants improve maintainability and consistency.
The code changes are approved.
227-227
: LGTM!The changes to use public methods and centralized path constants improve maintainability and consistency.
The code changes are approved.
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, if my understanding of my comment is correct just resolve so you can merge.
Closes #552
Summary by CodeRabbit
New Features
Refactor
e2e.Suite
functionality.Bug Fixes