Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ private static ListMultimap<Class<?>, String> createLegacyRestTestBasePluginUsag
map.put(LegacyRestTestBasePlugin.class, ":x-pack:qa:third-party:jira");
map.put(LegacyRestTestBasePlugin.class, ":x-pack:qa:third-party:pagerduty");
map.put(LegacyRestTestBasePlugin.class, ":x-pack:qa:third-party:slack");
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:downsample:qa:with-security");
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:ent-search:qa:rest");
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:eql:qa:ccs-rolling-upgrade");
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:eql:qa:correctness");
Expand Down
3 changes: 0 additions & 3 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -399,9 +399,6 @@ tests:
- class: org.elasticsearch.xpack.esql.action.EsqlActionBreakerIT
method: testFromEvalStats
issue: https://github.com/elastic/elasticsearch/issues/131503
- class: org.elasticsearch.xpack.downsample.DownsampleWithBasicRestIT
method: test {p0=downsample-with-security/10_basic/Downsample index}
issue: https://github.com/elastic/elasticsearch/issues/131513
- class: org.elasticsearch.xpack.search.CrossClusterAsyncSearchIT
method: testCancellationViaTimeoutWithAllowPartialResultsSetToFalse
issue: https://github.com/elastic/elasticsearch/issues/131248
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public DownsampleRestIT(final ClientYamlTestCandidate testCandidate) {

@ParametersFactory
public static Iterable<Object[]> parameters() throws Exception {
return ESClientYamlSuiteTestCase.createParameters();
return ESClientYamlSuiteTestCase.createParameters(new String[] { "downsample" });
Copy link
Contributor

Choose a reason for hiding this comment

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

We should really make createParameters take a variable argument parameter to make this more convenient.

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'll make a note to do this next time (in a separate PR)

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public DownsampleWithBasicRestIT(final ClientYamlTestCandidate testCandidate) {

@ParametersFactory
public static Iterable<Object[]> parameters() throws Exception {
return ESClientYamlSuiteTestCase.createParameters();
return ESClientYamlSuiteTestCase.createParameters(new String[] { "downsample" });
Copy link
Contributor

Choose a reason for hiding this comment

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

I sure wish I understood the rationale behind running these tests multiple times with difference license types. We don't do this consistently.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same here. I just "ported" them 1-1, but I do wonder if there is a consistent rule or pattern here, and if we should flag any test that does not follow it so the teams owning them could review and amend.

Copy link
Contributor

Choose a reason for hiding this comment

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

but I do wonder if there is a consistent rule or pattern here

There almost certainly is not.

}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

package org.elasticsearch.xpack.downsample;

import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;

import org.elasticsearch.common.settings.SecureString;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.util.concurrent.ThreadContext;
import org.elasticsearch.test.cluster.ElasticsearchCluster;
import org.elasticsearch.test.cluster.local.distribution.DistributionType;
import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate;
import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase;
import org.junit.ClassRule;

public class DownsampleWithSecurityRestIT extends ESClientYamlSuiteTestCase {

public static final String USERNAME = "elastic_admin";
public static final String PASSWORD = "admin-password";

@ClassRule
public static ElasticsearchCluster cluster = ElasticsearchCluster.local()
.distribution(DistributionType.DEFAULT)
.setting("xpack.license.self_generated.type", "trial")
.setting("xpack.security.enabled", "true")
.user(USERNAME, PASSWORD)
.build();

@Override
protected String getTestRestCluster() {
return cluster.getHttpAddresses();
}

public DownsampleWithSecurityRestIT(final ClientYamlTestCandidate testCandidate) {
super(testCandidate);
}

@Override
protected Settings restClientSettings() {
String authentication = basicAuthHeaderValue(USERNAME, new SecureString(PASSWORD.toCharArray()));
return Settings.builder().put(super.restClientSettings()).put(ThreadContext.PREFIX + ".Authorization", authentication).build();
}

@ParametersFactory
public static Iterable<Object[]> parameters() throws Exception {
return ESClientYamlSuiteTestCase.createParameters(new String[] { "downsample-with-security" });
}
}
33 changes: 0 additions & 33 deletions x-pack/plugin/downsample/qa/with-security/build.gradle

This file was deleted.

This file was deleted.