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 easier configuration cache test support in build logic tests #88047

Merged

Conversation

breskeby
Copy link
Contributor

This is intended to help us getting closer to #57918 by implicitly testing our build logic
configuration-cache support. Plugin and Task tests can be marked as configuration cache compatible
now and we will always run then with configuration cache enabled.

By default, gradle will fail the build if configuration cache problems have been detected during
build execution. That should be in general better then adding explicit tests for testing configuration
cache compatibility per Test class

@breskeby breskeby self-assigned this Jun 27, 2022
@breskeby breskeby added :Delivery/Build Build or test infrastructure >enhancement Team:Delivery Meta label for Delivery team labels Jun 27, 2022
@breskeby breskeby marked this pull request as ready for review June 27, 2022 08:20
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-delivery (Team:Delivery)

def setup() {
projectDir = testProjectDir.root
settingsFile = testProjectDir.newFile('settings.gradle')
settingsFile << "rootProject.name = 'hello-world'\n"
buildFile = testProjectDir.newFile('build.gradle')
propertiesFile = testProjectDir.newFile('gradle.properties')
propertiesFile <<
"org.gradle.java.installations.fromEnv=JAVA_HOME,RUNTIME_JAVA_HOME,JAVA15_HOME,JAVA14_HOME,JAVA13_HOME,JAVA12_HOME,JAVA11_HOME,JAVA8_HOME"
"org.gradle.java.installations.fromEnv=JAVA_HOME,RUNTIME_JAVA_HOME,JAVA15_HOME,JAVA14_HOME,JAVA13_HOME,JAVA12_HOME,JAVA11_HOME,JAVA8_HOME"
Copy link
Contributor

Choose a reason for hiding this comment

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

Some indents in this file seem have to have gone from 4 to 8.

Copy link
Contributor

@pugnascotia pugnascotia left a comment

Choose a reason for hiding this comment

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

Some comments but LGTM.

@breskeby breskeby added the auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) label Jun 27, 2022
dataStreamAliasDiff != null
? dataStreamAliasDiff.apply(((DataStreamMetadata) part).dataStreamAliases)
: ImmutableOpenMap.of()
dataStreamDiff.apply(((DataStreamMetadata) part).dataStreams),
Copy link
Contributor

Choose a reason for hiding this comment

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

This change looks unrelated?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I cleaned that up

@breskeby breskeby removed the auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) label Jun 27, 2022
breskeby and others added 4 commits June 27, 2022 12:05
This is intended to help us getting closer to elastic#57918 by implicitly testing our build logic
configuration-cache support. Plugin and Task tests can be marked as configuration cache compatible
now and we will always run then with configuration cache enabled.

By default, gradle will fail the build if configuration cache problems have been detected during
build execution. That should be in general better then adding explicit tests for testing configuration
cache compatibility per Test class
…ernal/test/ConfigurationCacheCompatibleAwareGradleRunner.java


+1

Co-authored-by: Rory Hunter <[email protected]>
…ernal/test/ConfigurationCacheCompatibleAwareGradleRunner.java

Co-authored-by: Rory Hunter <[email protected]>
@breskeby breskeby force-pushed the cleanup-build-logic-tests branch from e71407c to fa105ef Compare June 27, 2022 10:07
@breskeby breskeby added the auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) label Jun 27, 2022
@elasticsearchmachine elasticsearchmachine merged commit 12525ad into elastic:master Jun 27, 2022
@breskeby breskeby deleted the cleanup-build-logic-tests branch June 27, 2022 12:11
breskeby added a commit to breskeby/elasticsearch that referenced this pull request Jul 15, 2022
…stic#88047)

This is intended to help us getting closer to elastic#57918 by implicitly
testing our build logic configuration-cache support. Plugin and Task
tests can be marked as configuration cache compatible now and we will
always run then with configuration cache enabled.

By default, gradle will fail the build if configuration cache problems
have been detected during build execution. That should be in general
better then adding explicit tests for testing configuration cache
compatibility per Test class
# Conflicts:
#	build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/fixtures/AbstractGradleInternalPluginFuncTest.groovy
#	build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/precommit/LicenseHeadersPrecommitPluginFuncTest.groovy
#	build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/precommit/TestingConventionsPrecommitPluginFuncTest.groovy
breskeby added a commit that referenced this pull request Jul 15, 2022
) (#88569)

This is intended to help us getting closer to #57918 by implicitly
testing our build logic configuration-cache support. Plugin and Task
tests can be marked as configuration cache compatible now and we will
always run then with configuration cache enabled.

By default, gradle will fail the build if configuration cache problems
have been detected during build execution. That should be in general
better then adding explicit tests for testing configuration cache
compatibility per Test class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) :Delivery/Build Build or test infrastructure >enhancement Team:Delivery Meta label for Delivery team v8.4.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants