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

Testclsuters: convert plugins qa projects #41496

Merged
merged 5 commits into from
Apr 26, 2019

Conversation

alpar-t
Copy link
Contributor

@alpar-t alpar-t commented Apr 24, 2019

These slipped trough the cracks initially.
With this PR we now run these tests with test-clusters.

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

Copy link
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

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

A few comments

private void addSupplier(String name, Map<String, FileSupplier> collector, String key, FileSupplier valueSupplier) {
requireNonNull(key, name + " key was null when configuring test cluster `" + this + "`");
requireNonNull(valueSupplier, name + " value supplier was null when configuring test cluster `" + this + "`");
collector.put(key, valueSupplier);
Copy link
Member

Choose a reason for hiding this comment

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

Why all these extra levels of indirection? I think this addSupplier, and the other one added here could just be implemented inside keystore that takes a FileSupplier, and the File variant calls that method instead of this indirection.

keystoreFiles.values().stream()
.map(each -> each.get())
.filter(each -> each == null || each.exists() == false)
.forEach(each -> {
Copy link
Member

Choose a reason for hiding this comment

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

Sorry but these uses of forEach are getting out of hand. Can you please just use a simple loop? This forEach and the one below can simply be:

for (var entry : keystoreFiles.entrySet()) {
  File file = entry.getValue().get();
  if (file == null) {
    throw new IllegalArgumentException("supplied keystoreFile was null when configuring test cluster `" + this + "`")
  }
  if (file.exists() == false) {
    throw new TestClustersException("supplied keystore file " + each + " does not exist, require for " + this);
  }
  runElaticsearchBinScript("elasticsearch-keystore", "add-file", entry.getKey(), file.toString())
}

It is the same number of lines, yet does not require thinking about the special way that the first forEach actually works (which gives a different error if null was found instead of a non existent file).

keystoreSetting 'discovery.ec2.access_key', 'ec2_integration_test_access_key'
keystoreSetting 'discovery.ec2.secret_key', 'ec2_integration_test_secret_key'
integTest {
dependsOn ec2Fixture, project(':plugins:discovery-ec2').bundlePlugin
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we should add cross project task dependencies here. While I know cluster formation was already using this pattern, it was internal. By keeping it internal, we can improve the implementation without needing to change 20+ projects to have a different syntax.

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 agree and don't like it either, I was planning to address it in a follow up.

@@ -30,6 +30,7 @@ integTestCluster {
retries: 10)
return tmpFile.exists()
}
// TODO: systemProperty('tests.cluster', "${-> cluster.transportPortURI }") when migerating to testclusters
Copy link
Member

Choose a reason for hiding this comment

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

Why is this commented out?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

because it's just a reminder for when we convert it to testclusters, it doesn't use it yet, and we continue to set that property for ClusterFormationTasks

@alpar-t
Copy link
Contributor Author

alpar-t commented Apr 24, 2019

run elasticsearch-ci/1

@alpar-t
Copy link
Contributor Author

alpar-t commented Apr 26, 2019

run elasticsearch-ci/1

@alpar-t
Copy link
Contributor Author

alpar-t commented Apr 26, 2019

@rjernst ready for annother review. Please merge it if you find it acceptable.

@rjernst rjernst merged commit 14af0b4 into elastic:master Apr 26, 2019
rjernst pushed a commit that referenced this pull request Apr 26, 2019
Add testclusters support for files in keystore and convert qa subprojects within plugins.
akhil10x5 pushed a commit to akhil10x5/elasticsearch that referenced this pull request May 2, 2019
Add testclusters support for files in keystore and convert qa subprojects within plugins.
gurkankaymak pushed a commit to gurkankaymak/elasticsearch that referenced this pull request May 27, 2019
Add testclusters support for files in keystore and convert qa subprojects within plugins.
@alpar-t alpar-t deleted the testclsuters-plugins-qa branch November 11, 2019 09:41
@mark-vieira mark-vieira added the Team:Delivery Meta label for Delivery team label Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Delivery/Build Build or test infrastructure >non-issue Team:Delivery Meta label for Delivery team v7.2.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants