Build: Remove rest tests on archive distribution projects (#28952)
This commit removes running rest tests on the full zip and tar distributions in favor of doing a simple extraction check like is done for rpm and deb files. The rest tests are still run on the integ test zip, at least for now (this should eventually be moved out to a different location).
This commit is contained in:
parent
46a79127ed
commit
0f95636a91
|
@ -21,6 +21,7 @@ import org.apache.tools.ant.taskdefs.condition.Os
|
|||
import org.apache.tools.ant.filters.FixCrLfFilter
|
||||
import org.elasticsearch.gradle.BuildPlugin
|
||||
import org.elasticsearch.gradle.EmptyDirTask
|
||||
import org.elasticsearch.gradle.LoggedExec
|
||||
import org.elasticsearch.gradle.MavenFilteringHack
|
||||
import org.elasticsearch.gradle.plugin.PluginBuildPlugin
|
||||
|
||||
|
@ -125,19 +126,39 @@ subprojects {
|
|||
artifacts {
|
||||
'default' buildDist
|
||||
}
|
||||
|
||||
// sanity checks if a archives can be extracted
|
||||
File extractionDir = new File(buildDir, 'extracted')
|
||||
task testExtraction(type: LoggedExec) {
|
||||
dependsOn buildDist
|
||||
doFirst {
|
||||
project.delete(extractionDir)
|
||||
extractionDir.mkdirs()
|
||||
}
|
||||
}
|
||||
if (project.name.contains('zip')) {
|
||||
testExtraction {
|
||||
onlyIf { new File('/bin/unzip').exists() || new File('/usr/bin/unzip').exists() || new File('/usr/local/bin/unzip').exists() }
|
||||
commandLine 'unzip', "${-> buildDist.outputs.files.singleFile}", '-d', extractionDir
|
||||
}
|
||||
} else { // tar
|
||||
testExtraction {
|
||||
onlyIf { new File('/bin/tar').exists() || new File('/usr/bin/tar').exists() || new File('/usr/local/bin/tar').exists() }
|
||||
commandLine 'tar', '-xvzf', "${-> buildDist.outputs.files.singleFile}", '-C', extractionDir
|
||||
}
|
||||
}
|
||||
check.dependsOn testExtraction
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* Rest test config *
|
||||
*****************************************************************************/
|
||||
subprojects {
|
||||
configure(subprojects.findAll { it.name == 'integ-test-zip' }) {
|
||||
apply plugin: 'elasticsearch.standalone-rest-test'
|
||||
apply plugin: 'elasticsearch.rest-test'
|
||||
|
||||
if (project.name == 'integ-test-zip') {
|
||||
integTest {
|
||||
includePackaged true
|
||||
}
|
||||
integTest {
|
||||
includePackaged true
|
||||
}
|
||||
|
||||
integTestCluster {
|
||||
|
|
|
@ -1,37 +0,0 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.test.rest;
|
||||
|
||||
import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;
|
||||
|
||||
import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate;
|
||||
import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase;
|
||||
|
||||
/** Rest integration test. Runs against a cluster started by {@code gradle integTest} */
|
||||
public class TarClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase {
|
||||
public TarClientYamlTestSuiteIT(ClientYamlTestCandidate testCandidate) {
|
||||
super(testCandidate);
|
||||
}
|
||||
|
||||
@ParametersFactory
|
||||
public static Iterable<Object[]> parameters() throws Exception {
|
||||
return createParameters();
|
||||
}
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
# Integration tests for distributions with modules
|
||||
#
|
||||
"Correct Modules Count":
|
||||
- do:
|
||||
cluster.state: {}
|
||||
|
||||
# Get master node id
|
||||
- set: { master_node: master }
|
||||
|
||||
- do:
|
||||
nodes.info: {}
|
||||
|
||||
- length: { nodes.$master.modules: ${expected.modules.count} }
|
|
@ -1,37 +0,0 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.test.rest;
|
||||
|
||||
import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;
|
||||
|
||||
import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate;
|
||||
import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase;
|
||||
|
||||
/** Rest integration test. Runs against a cluster started by {@code gradle integTest} */
|
||||
public class ZipClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase {
|
||||
public ZipClientYamlTestSuiteIT(ClientYamlTestCandidate testCandidate) {
|
||||
super(testCandidate);
|
||||
}
|
||||
|
||||
@ParametersFactory
|
||||
public static Iterable<Object[]> parameters() throws Exception {
|
||||
return createParameters();
|
||||
}
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
# Integration tests for distributions with modules
|
||||
#
|
||||
"Correct Modules Count":
|
||||
- do:
|
||||
cluster.state: {}
|
||||
|
||||
# Get master node id
|
||||
- set: { master_node: master }
|
||||
|
||||
- do:
|
||||
nodes.info: {}
|
||||
|
||||
- length: { nodes.$master.modules: ${expected.modules.count} }
|
Loading…
Reference in New Issue