Closed mojtaba-esk closed 1 month ago
The changes introduce a new error variable ErrCannotCloneInstance
in the pkg/instance/errors.go
file to improve error handling when cloning instances. Additionally, the CloneWithName
method in pkg/instance/instance.go
is updated to enforce state checks, allowing cloning only if the instance is in StateCommitted
or StateStopped
. This modification enhances the control flow regarding instance cloning and provides clearer documentation about the cloning behavior, particularly concerning sidecars.
File Path | Change Summary |
---|---|
pkg/instance/errors.go | Added new error variable ErrCannotCloneInstance with a specific message. |
pkg/instance/instance.go | Updated CloneWithName method to include state validation for cloning. Added a comment clarifying cloning behavior for sidecars. |
pkg/sidecars/tshark/tshark_test.go | Enhanced TestTsharkClone with logger initialization and proper configuration of testInstance . |
Objective | Addressed | Explanation |
---|---|---|
Check for instance state in CloneWithSuffix (#531) |
❌ | The changes do not address the CloneWithSuffix method. |
In the fields where instances play,
A rabbit hops, brightening the day.
With states to check and errors to share,
Cloning now has a thoughtful care.
"Cannot clone!" it softly sings,
As it guards the joy that cloning brings! 🐇✨
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?
hello! I found the CI broken, is it expected?
build_image_test.go:35:
Error Trace: /home/runner/work/knuu/knuu/e2e/system/build_image_test.go:35
Error: Received unexpected error:
build failed
Test: TestRunSuite/TestOneVolumeTwoFiles
Messages: Error setting git repo
--- FAIL: TestRunSuite (134.40s)
--- PASS: TestRunSuite/TestStartWithCallback (1.70s)
--- FAIL: TestRunSuite/TestBuildFromGit (9.38s)
panic: test executed panic(nil) or runtime.Goexit
hello! I found the CI broken, is it expected? ...
No it is not expected. something might be wrong.
When I run the failing test TestRunSuite/TestBuildFromGit
locally it passes:
=== RUN TestRunSuite
time="2024-10-08T15:46:06+03:30" level=info msg="Current log level" file="log/logger.go:41" env_log_level=LOG_LEVEL log_level=info
suite_setup_test.go:53: Scope: 20241008-154533-860
=== RUN TestRunSuite/TestBuildFromGit
=== PAUSE TestRunSuite/TestBuildFromGit
=== RUN TestRunSuite/TestBuildFromGitWithModifications
=== PAUSE TestRunSuite/TestBuildFromGitWithModifications
=== CONT TestRunSuite/TestBuildFromGit
=== CONT TestRunSuite/TestBuildFromGitWithModifications
build_image_test.go:22: Creating new instance
build_image_test.go:64: Creating new instance
build_image_test.go:68: Setting git repo
build_image_test.go:26: Building the image
build_image_test.go:36: Image built
build_image_test.go:40: Starting instance
build_image_test.go:43: Instance started
build_image_test.go:45: Getting file bytes
=== NAME TestRunSuite
suite.go:59: Cleaning up knuu...
suite.go:63: Knuu is cleaned up
--- PASS: TestRunSuite (54.40s)
--- PASS: TestRunSuite/TestBuildFromGit (24.49s)
--- PASS: TestRunSuite/TestBuildFromGitWithModifications (43.83s)
PASS
ok github.com/celestiaorg/knuu/e2e/system 98.264s
Closes #531
Summary by CodeRabbit
New Features
StateCommitted
orStateStopped
states.Documentation
Tests
Tshark
struct by adding a logger and ensuring proper configuration of the test instance before cloning.