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

Allow copy-file and delete-file to be scheduled #574

Merged
merged 1 commit into from
Sep 5, 2024

Conversation

lptr
Copy link
Member

@lptr lptr commented Sep 3, 2024

This allows a copy-file or delete-file to be scheduled to be executed before a scenario, cleanup or build step.

@lptr lptr self-assigned this Sep 3, 2024
Copy link
Member

@asodja asodja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

super(schedule);
this.gradleUserHome = gradleUserHome;
}

@Override
protected void cleanup() {
protected void executeOnSchedule() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 Note: This change will require also a change of some logic in gradle/gradle when we upgrade the profiler. I know about this one:
https://github.com/gradle/gradle/blob/9b00b5d6f111a3542959598fb31c5c7181c15972/testing/internal-performance-testing/src/main/groovy/org/gradle/performance/mutator/ClearArtifactTransformCacheWithoutInstrumentedJarsMutator.groovy#L45

It's not a problem but we should be aware of that when we upgrade a profiler.

}

@Override
public String toString() {
return getClass().getSimpleName() + "(" + schedule + ")";
}

public enum CleanupSchedule {
public enum Schedule {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 Also this change will require some changes in gradle/gradle since we use these constants in few places, e.g.:
https://github.com/gradle/gradle/blob/381460e0f3dca2bb39d77d91e474f390a9ef812b/testing/performance/src/performanceTest/groovy/org/gradle/performance/experiment/declarativedsl/DeclarativeDslFirstUsePerformanceTest.groovy#L49-L54

It's not a problem but we should be aware of that when we upgrade a profiler.

@@ -352,8 +352,10 @@ They can be added to a scenario file like this:
}
delete-file = [{
target = ".mvn/develocity.xml"
schedule = CLEANUP
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 Nice

}, {
target = ".gradle"
schedule = CLEANUP
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ This then runs at the start of schedule, right?

Can we maybe add this detail also do README.md that it means at start/before a schedule, or should that be obvious?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I've extracted some words about scheduling mutators.

@lptr lptr force-pushed the lptr/schedule-file-operations branch from 14ae24e to b819eee Compare September 5, 2024 13:45
@lptr lptr merged commit 45107dd into master Sep 5, 2024
9 of 10 checks passed
@lptr lptr deleted the lptr/schedule-file-operations branch September 5, 2024 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants