Skip to content
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

Open
wants to merge 1 commit into
base: scylla-4.x
Choose a base branch
from

Conversation

Bouncheck
Copy link
Collaborator

This TestRule can be combined with other CCM Rules to prevent them from deleting logs of failed tests during cleanup.

This TestRule can be combined with other CCM Rules to prevent them
from deleting logs of failed tests during cleanup.
Comment on lines +235 to +238

public CcmBridge getCcmBridge() {
return ccmBridge;
}

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?

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

@Bouncheck Bouncheck Aug 7, 2024

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.

@Bouncheck Bouncheck self-assigned this Jul 26, 2024
import org.junit.rules.TestWatcher;
import org.junit.runner.Description;

public class PreserveLogsRule extends TestWatcher {
Copy link
Collaborator

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.

Copy link
Collaborator Author

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.

Copy link
Collaborator

@dkropachev dkropachev Sep 30, 2024

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.

Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants