Skip to content

Commit 3fb2c45

Browse files
committed
Merge branch 'master' into ccr
* master: [DOCS] Fixes typos in security settings Fix GeoShapeQueryBuilder serialization after backport [DOCS] Splits auditing.asciidoc into smaller files Reintroduce mandatory http pipelining support (#30820) Painless: Types Section Clean Up (#30283) Add support for indexed shape routing in geo_shape query (#30760) [test] java tests for archive packaging (#30734) Revert "Make http pipelining support mandatory (#30695)" (#30813) [DOCS] Fix more edit URLs in Stack Overview (#30704) Use correct cluster state version for node fault detection (#30810) Change serialization version of doc-value fields. [DOCS] Fixes broken link for native realm [DOCS] Clarified audit.index.client.hosts (#30797) [TEST] Don't expect acks when isolating nodes Add a `format` option to `docvalue_fields`. (#29639) Fixes UpdateSettingsRequestStreamableTests mutate bug Mustes {p0=snapshot.get_repository/10_basic/*} YAML test Revert "Mutes MachineLearningTests.testNoAttributes_givenSameAndMlEnabled" Only allow x-pack metadata if all nodes are ready (#30743) Mutes MachineLearningTests.testNoAttributes_givenSameAndMlEnabled Use original settings on full-cluster restart (#30780) Only ack cluster state updates successfully applied on all nodes (#30672) Expose Lucene's FeatureField. (#30618) Fix a grammatical error in the 'search types' documentation. Remove http pipelining from integration test case (#30788)
2 parents 65a5281 + e76c09f commit 3fb2c45

File tree

174 files changed

+5488
-1034
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

174 files changed

+5488
-1034
lines changed

TESTING.asciidoc

+24-4
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,9 @@ into it
512512
vagrant ssh debian-9
513513
--------------------------------------------
514514

515-
Now inside the VM, to run the https://github.com/sstephenson/bats[bats] packaging tests
515+
Now inside the VM, start the packaging tests from the terminal. There are two packaging
516+
test projects. The old ones are written with https://github.com/sstephenson/bats[bats]
517+
and only run on linux. To run them do
516518

517519
--------------------------------------------
518520
cd $PACKAGING_ARCHIVES
@@ -524,18 +526,36 @@ sudo bats $BATS_TESTS/*.bats
524526
sudo bats $BATS_TESTS/20_tar_package.bats $BATS_TESTS/25_tar_plugins.bats
525527
--------------------------------------------
526528

527-
To run the Java packaging tests, again inside the VM
529+
The new packaging tests are written in Java and run on both linux and windows. On
530+
linux (again, inside the VM)
528531

529532
--------------------------------------------
530-
bash $PACKAGING_TESTS/run-tests.sh
533+
# run the full suite
534+
sudo bash $PACKAGING_TESTS/run-tests.sh
535+
536+
# run specific test cases
537+
sudo bash $PACKAGING_TESTS/run-tests.sh \
538+
org.elasticsearch.packaging.test.DefaultZipTests \
539+
org.elasticsearch.packaging.test.OssZipTests
531540
--------------------------------------------
532541

533-
or on Windows
542+
or on Windows, from a terminal running as Administrator
534543

535544
--------------------------------------------
545+
# run the full suite
536546
powershell -File $Env:PACKAGING_TESTS/run-tests.ps1
547+
548+
# run specific test cases
549+
powershell -File $Env:PACKAGING_TESTS/run-tests.ps1 `
550+
org.elasticsearch.packaging.test.DefaultZipTests `
551+
org.elasticsearch.packaging.test.OssZipTests
537552
--------------------------------------------
538553

554+
Note that on Windows boxes when running from inside the GUI, you may have to log out and
555+
back in to the `vagrant` user (password `vagrant`) for the environment variables that
556+
locate the packaging tests and distributions to take effect, due to how vagrant provisions
557+
Windows machines.
558+
539559
When you've made changes you want to test, keep the VM up and reload the tests and
540560
distributions inside by running (on the host)
541561

Vagrantfile

+1
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ def linux_common(config,
237237

238238
config.vm.provision 'markerfile', type: 'shell', inline: <<-SHELL
239239
touch /etc/is_vagrant_vm
240+
touch /is_vagrant_vm # for consistency between linux and windows
240241
SHELL
241242

242243
# This prevents leftovers from previous tests using the

buildSrc/src/main/groovy/org/elasticsearch/gradle/vagrant/VagrantTestPlugin.groovy

+20-3
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ class VagrantTestPlugin implements Plugin<Project> {
5252
static final List<String> DISTRIBUTIONS = unmodifiableList([
5353
'archives:tar',
5454
'archives:oss-tar',
55+
'archives:zip',
56+
'archives:oss-zip',
5557
'packages:rpm',
5658
'packages:oss-rpm',
5759
'packages:deb',
@@ -242,13 +244,27 @@ class VagrantTestPlugin implements Plugin<Project> {
242244
Task createLinuxRunnerScript = project.tasks.create('createLinuxRunnerScript', FileContentsTask) {
243245
dependsOn copyPackagingTests
244246
file "${testsDir}/run-tests.sh"
245-
contents "java -cp \"\$PACKAGING_TESTS/*\" org.junit.runner.JUnitCore ${-> project.extensions.esvagrant.testClass}"
247+
contents """\
248+
if [ "\$#" -eq 0 ]; then
249+
test_args=( "${-> project.extensions.esvagrant.testClass}" )
250+
else
251+
test_args=( "\$@" )
252+
fi
253+
java -cp "\$PACKAGING_TESTS/*" org.elasticsearch.packaging.VMTestRunner "\${test_args[@]}"
254+
"""
246255
}
247256
Task createWindowsRunnerScript = project.tasks.create('createWindowsRunnerScript', FileContentsTask) {
248257
dependsOn copyPackagingTests
249258
file "${testsDir}/run-tests.ps1"
259+
// the use of $args rather than param() here is deliberate because the syntax for array (multivalued) parameters is likely
260+
// a little trappy for those unfamiliar with powershell
250261
contents """\
251-
java -cp "\$Env:PACKAGING_TESTS/*" org.junit.runner.JUnitCore ${-> project.extensions.esvagrant.testClass}
262+
if (\$args.Count -eq 0) {
263+
\$testArgs = @("${-> project.extensions.esvagrant.testClass}")
264+
} else {
265+
\$testArgs = \$args
266+
}
267+
java -cp "\$Env:PACKAGING_TESTS/*" org.elasticsearch.packaging.VMTestRunner @testArgs
252268
exit \$LASTEXITCODE
253269
"""
254270
}
@@ -525,9 +541,10 @@ class VagrantTestPlugin implements Plugin<Project> {
525541

526542
if (LINUX_BOXES.contains(box)) {
527543
javaPackagingTest.command = 'ssh'
528-
javaPackagingTest.args = ['--command', 'bash "$PACKAGING_TESTS/run-tests.sh"']
544+
javaPackagingTest.args = ['--command', 'sudo bash "$PACKAGING_TESTS/run-tests.sh"']
529545
} else {
530546
javaPackagingTest.command = 'winrm'
547+
// winrm commands run as administrator
531548
javaPackagingTest.args = ['--command', 'powershell -File "$Env:PACKAGING_TESTS/run-tests.ps1"']
532549
}
533550

0 commit comments

Comments
 (0)