-
Notifications
You must be signed in to change notification settings - Fork 38
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
Add TestRule for preserving logs #191
base: scylla-4.x
Are you sure you want to change the base?
Conversation
f59a52b
to
2a93e64
Compare
This TestRule can be combined with other CCM Rules to prevent them from deleting logs of failed tests during cleanup.
2a93e64
to
fdd62ea
Compare
|
||
public CcmBridge getCcmBridge() { | ||
return ccmBridge; | ||
} |
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.
Why is this method moved here from CustomCcmRule?
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.
Could be an accident, but this was so long ago that I need to look at it again.
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.
I think it was to allow combining new rule with all other rules. New rule needs ccmBridge to modify its state.
import org.junit.rules.TestWatcher; | ||
import org.junit.runner.Description; | ||
|
||
public class PreserveLogsRule extends TestWatcher { |
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.
Question - why not to make it configurable from environment variable ? So that it could be easily set for whole run.
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.
IIRC this was the simplest way to have the rule react only in case of failure. The goal was to skip logs of passing runs.
Global switch would be nice for running locally, but I'm not sure if we want CI to keep regularly uploading unnecessary log files.
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.
We definitely would want to store ccm logs on test failures on cicd.
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.
Let's make it global flag that controls whether we keep ccm logs after the test or not.
This TestRule can be combined with other CCM Rules to prevent them from deleting logs of failed tests during cleanup.