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

Some tests broken by recent changes around elasticsearch.versions #78864

Closed
edh-oss opened this issue Oct 7, 2021 · 5 comments
Closed

Some tests broken by recent changes around elasticsearch.versions #78864

edh-oss opened this issue Oct 7, 2021 · 5 comments
Labels
>bug :Delivery/Build Build or test infrastructure needs:triage Requires assignment of a team area label Team:Delivery Meta label for Delivery team

Comments

@edh-oss
Copy link
Contributor

edh-oss commented Oct 7, 2021

From the build-tools-internal folder, I try this:

gradle test --tests SnippetsTaskTests

The result is:

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/edhoward/oss/elastic/elasticsearch/build-tools/build.gradle' line: 17

* What went wrong:
An exception occurred applying plugin request [id: 'elasticsearch.versions']
> Failed to apply plugin 'elasticsearch.versions'.
   > Failed to create service 'versions'.
      > Could not create an instance of type org.elasticsearch.gradle.internal.conventions.VersionPropertiesBuildService.
         > Cannot load VersionPropertiesBuildService

It looks like this started with #78704

@edh-oss edh-oss added >bug needs:triage Requires assignment of a team area label labels Oct 7, 2021
@edh-oss
Copy link
Contributor Author

edh-oss commented Oct 8, 2021

I see now that the issue is more general then the example above. The same result occurs when trying to invoke gradle from that folder, for any purpose. "gradle tasks", "gradle non-existent-option", just "gradle", all fail the same way.

This has me wondering if the new behavior is by design, if we're not meant to be able to invoke gradle from build-tools-internal. If not, how are we meant to run corresponding tests? For instance, how does one run ElasticsearchJavaPluginFuncTest ?

@cbuescher cbuescher added the :Delivery/Build Build or test infrastructure label Oct 11, 2021
@elasticmachine elasticmachine added the Team:Delivery Meta label for Delivery team label Oct 11, 2021
@elasticmachine
Copy link
Collaborator

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

@mark-vieira
Copy link
Contributor

mark-vieira commented Oct 11, 2021

You are correct, build-tools-internal is never meant to be built as a "stand alone" project. It's only intended to be included in the larger elasticsearch build as a composite. You can run tests on those project as if they were any other subproject of the larger build though. For example:

./gradlew :build-tools-internal:integTest --tests org.elasticsearch.gradle.internal.ElasticsearchJavaPluginFuncTest

@edh-oss
Copy link
Contributor Author

edh-oss commented Oct 14, 2021

Regarding Spock, I'm having trouble getting Spock tests recognized under elasticsearch/build-tools-internal .
For instance, trying to run the existing test RerunTestResultProcessorTestSpec like this:

./gradlew :build-tools-internal:test -i --tests RerunTestResultProcessorTestSpec

results in:

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':build-tools-internal:test'.

No tests found for given includes: [org.elasticsearch.gradle.internal.test.rerun.executer.RerunTestResultProcessorTestSpec](--tests filter)

If I put a groovy script with a junit test in the same folder, it's recognized.

package org.elasticsearch.gradle.internal.test.rerun.executer

import org.elasticsearch.gradle.internal.test.GradleUnitTestCase;

public class EmptyTest extends GradleUnitTestCase {
  public void testNothing() {
      System.out.println("Here we are")
  }
}

./gradlew :build-tools-internal:test -i --tests EmptyTest
.....
org.elasticsearch.gradle.internal.test.rerun.executer.EmptyTest > testNothing STANDARD_OUT
Here we are

@breskeby
Copy link
Contributor

thanks for reporting. Yes we need to use the junit-jupiter runtime to run the Spock tests correctly. Working on a fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Delivery/Build Build or test infrastructure needs:triage Requires assignment of a team area label Team:Delivery Meta label for Delivery team
Projects
None yet
Development

No branches or pull requests

5 participants