-
Notifications
You must be signed in to change notification settings - Fork 9
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
Migrate the underlying test framework from kuttl
to chainsaw
#15
Migrate the underlying test framework from kuttl
to chainsaw
#15
Conversation
5f6ccfd
to
a73bed8
Compare
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.
Are we going to allow uptest users to set respective apply, assert, cleanup, delete, error, exec timeouts for chainsaw?
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 chainsaw asset files cover all the resources that are expected to be created by a claim?
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 external resources that were created by chainsaw be properly cleaned up also in the event of creation and assertion failures?
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 this chainsaw integration work seamlessly with Upbound SaaS?
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.
Would it be useful if Uptest supported both KUTTL and Chainsaw for a couple of months to allow users a migration period after a proper announcement?
329c0ed
to
7d54801
Compare
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.
Thanks @sergenyalcin for the chainsaw
integration. Left some comments for us to consider & discuss.
KindGroup string | ||
YAML string | ||
APIVersion string | ||
Kind string |
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.
Isn't Kind
duplicated as I suspect it also appears in KindGroup
?
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.
Yes this is duplicate. We need to access Kind
and KindGroup
in template files. I did not move the complexity to template file for doing concatenation inside the template files. Instead of this, I introduced both of them as separate fields.
return err | ||
} | ||
} | ||
return writer.Flush() |
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.
nit:
return writer.Flush() | |
return nil |
as the deferred file.Close
will already flush any pending writes.
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.
When I changed this I noticed that the input file is being empty. So I preserved this line.
Hi all, |
Hi @sergenyalcin, |
3f2d6c6
to
5066b3c
Compare
@ulucinar thank you for your detailed review, this is ready for the second cycle. |
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.
Thank you @sergenyalcin for working on this PR. As we've discussed offline, the timeout models of kuttle and chainsaw do not match each other. But what you've implemented in this PR is a good tradeoff between the issues/goals we've discussed. We may need to revisit how we implement timesouts with chainsaw if users want tighter bounds for failing tests, or if we experience issues with signaling (killing) the chainsaw process. According to some preliminary tests, chainsaw seems to be handling SIGINT
by propagating it to the child processes it forks (in exec
steps), so we should be fine. Also if we decide to send a signal to the main chainsaw process, that means the test has timed out and the CI pipeline needs to terminate as soon as the resources are cleaned up, so any orphaned processes will not matter as long as the pipeline terminates. My understanding is that chainsaw itself is not responsible for the cleanup as we have a separate cleanup job in the pipeline. So, killing the chainsaw process looks safe. If these assumptions are invalidated, then we can consider implementing a different timeout scheme on top of chainsaw.
Signed-off-by: Sergen Yalçın <yalcinsergen97@gmail.com>
Signed-off-by: Sergen Yalçın <yalcinsergen97@gmail.com>
- Use configurable timeout for all timeout types - Use CommandContext for applying the global timeout - For preventing memory leak extract the test function Signed-off-by: Sergen Yalçın <yalcinsergen97@gmail.com>
5066b3c
to
72c3770
Compare
Description of your changes
This PR migrates the underlying test framework from
kuttl
tochainsaw
. For further details about the design one pager about migration, please see: https://github.com/crossplane/uptest/blob/main/design/one-pager-considerations-for-changing-test-framework-of-uptest.mdThis pull request updates our project's testing framework to align with the latest best practices for Kubernetes configurations and resource management. By transitioning from
kuttl
tochainsaw
, we embrace a strategic shift toward advanced testing functionalities. This change requires updates across our configuration and templating setups to optimize our new testing framework.Updated Testing Files, Templates, and Structure
Transition from
kuttl
tochainsaw
:Apply
,Update
,Import
, andDelete
operations were part of a single end-to-end test inkuttl
. Now, each operation is treated as a separate test inchainsaw
, improving management and isolation. Each test consists of distinct steps, simplifying log tracking. Here’s the new test and step hierarchy:Revamp of Test Templates:
chainsaw
requirements, ensuring compatibility with the framework’s features.kuttl
specific templates and references, decluttering the test setup.chainsaw
, streamlining test execution.Directory and Terminology Updates:
kuttl
tochainsaw
to reflect the new testing framework.Configuration and Execution Enhancements
New Flags Introduced:
log-collect-interval
to set specific intervals for log collection during tests, enhancing debugging and monitoring capabilities.render-only
to render test configurations without execution, useful for verifying setups without running full tests.Modified Timeout Settings:
Duration
type, aligning with Go’s handling of timed durations for improved reliability in test execution timing.Robust Condition Checks and Cleanup:
Logging Improvements
kubectl get managed/claim
tocrossplane beta trace
for logging, better integrating with thecrossplane
ecosystem and providing clearer logs.log-collect-interval
now defaults to 30 seconds, allowing for flexible and effective log management during tests.This comprehensive update not only refines our testing processes but also sets a new standard for future developments within our project’s testing practices.
I have:
make reviewable test
to ensure this PR is ready for review.How has this code been tested
Tested locally and in this PR