Merge pull request #12904 from nik9000/remove_ES_CLEAN_BEFORE_TEST
Remove ES_CLEAN_BEFORE_TEST
This commit is contained in:
commit
42300938aa
|
@ -473,11 +473,9 @@ and in another window:
|
||||||
----------------------------------------------------
|
----------------------------------------------------
|
||||||
vagrant up centos-7 && vagrant ssh centos-7
|
vagrant up centos-7 && vagrant ssh centos-7
|
||||||
cd $RPM
|
cd $RPM
|
||||||
sudo ES_CLEAN_BEFORE_TEST=true bats $BATS/*rpm*.bats
|
sudo bats $BATS/*rpm*.bats
|
||||||
----------------------------------------------------
|
----------------------------------------------------
|
||||||
|
|
||||||
At this point `ES_CLEAN_BEFORE_TEST=true` is required or tests fail spuriously.
|
|
||||||
|
|
||||||
If you wanted to retest all the release artifacts on a single VM you could:
|
If you wanted to retest all the release artifacts on a single VM you could:
|
||||||
-------------------------------------------------
|
-------------------------------------------------
|
||||||
# Build all the distributions fresh but skip recompiling elasticsearch:
|
# Build all the distributions fresh but skip recompiling elasticsearch:
|
||||||
|
@ -486,7 +484,7 @@ mvn -amd -pl distribution install -DskipTests
|
||||||
mvn -Dtests.vagrant -pl qa/vagrant pre-integration-test
|
mvn -Dtests.vagrant -pl qa/vagrant pre-integration-test
|
||||||
vagrant up trusty && vagrant ssh trusty
|
vagrant up trusty && vagrant ssh trusty
|
||||||
cd $TESTROOT
|
cd $TESTROOT
|
||||||
sudo ES_CLEAN_BEFORE_TEST=true bats $BATS/*.bats
|
sudo bats $BATS/*.bats
|
||||||
-------------------------------------------------
|
-------------------------------------------------
|
||||||
|
|
||||||
== Coverage analysis
|
== Coverage analysis
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
<!-- The documentation for how to run this is in ../../Vagrantfile -->
|
<!-- The documentation for how to run this is in ../../Vagrantfile -->
|
||||||
<properties>
|
<properties>
|
||||||
<testScripts>*.bats</testScripts>
|
<testScripts>*.bats</testScripts>
|
||||||
<testCommand>sudo ES_CLEAN_BEFORE_TEST=true bats $BATS/${testScripts}</testCommand>
|
<testCommand>sudo bats $BATS/${testScripts}</testCommand>
|
||||||
|
|
||||||
<allDebBoxes>precise, trusty, vivid, wheezy, jessie</allDebBoxes>
|
<allDebBoxes>precise, trusty, vivid, wheezy, jessie</allDebBoxes>
|
||||||
<allRpmBoxes>centos-6, centos-7, fedora-22, oel-7</allRpmBoxes>
|
<allRpmBoxes>centos-6, centos-7, fedora-22, oel-7</allRpmBoxes>
|
||||||
|
|
|
@ -305,51 +305,41 @@ clean_before_test() {
|
||||||
"/usr/lib/tmpfiles.d/elasticsearch.conf" \
|
"/usr/lib/tmpfiles.d/elasticsearch.conf" \
|
||||||
"/usr/lib/sysctl.d/elasticsearch.conf")
|
"/usr/lib/sysctl.d/elasticsearch.conf")
|
||||||
|
|
||||||
if [ "$ES_CLEAN_BEFORE_TEST" = "true" ]; then
|
# Kills all processes of user elasticsearch
|
||||||
# Kills all processes of user elasticsearch
|
if id elasticsearch > /dev/null 2>&1; then
|
||||||
if id elasticsearch > /dev/null 2>&1; then
|
pkill -u elasticsearch 2>/dev/null || true
|
||||||
pkill -u elasticsearch 2>/dev/null || true
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Kills all running Elasticsearch processes
|
|
||||||
ps aux | grep -i "org.elasticsearch.bootstrap.Elasticsearch" | awk {'print $2'} | xargs kill -9 > /dev/null 2>&1 || true
|
|
||||||
|
|
||||||
# Removes RPM package
|
|
||||||
if is_rpm; then
|
|
||||||
rpm --quiet -e elasticsearch > /dev/null 2>&1 || true
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -x "`which yum 2>/dev/null`" ]; then
|
|
||||||
yum remove -y elasticsearch > /dev/null 2>&1 || true
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Removes DEB package
|
|
||||||
if is_dpkg; then
|
|
||||||
dpkg --purge elasticsearch > /dev/null 2>&1 || true
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -x "`which apt-get 2>/dev/null`" ]; then
|
|
||||||
apt-get --quiet --yes purge elasticsearch > /dev/null 2>&1 || true
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Removes user & group
|
|
||||||
userdel elasticsearch > /dev/null 2>&1 || true
|
|
||||||
groupdel elasticsearch > /dev/null 2>&1 || true
|
|
||||||
|
|
||||||
|
|
||||||
# Removes all files
|
|
||||||
for d in "${ELASTICSEARCH_TEST_FILES[@]}"; do
|
|
||||||
if [ -e "$d" ]; then
|
|
||||||
rm -rf "$d"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Checks that all files are deleted
|
# Kills all running Elasticsearch processes
|
||||||
|
ps aux | grep -i "org.elasticsearch.bootstrap.Elasticsearch" | awk {'print $2'} | xargs kill -9 > /dev/null 2>&1 || true
|
||||||
|
|
||||||
|
# Removes RPM package
|
||||||
|
if is_rpm; then
|
||||||
|
rpm --quiet -e elasticsearch > /dev/null 2>&1 || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -x "`which yum 2>/dev/null`" ]; then
|
||||||
|
yum remove -y elasticsearch > /dev/null 2>&1 || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Removes DEB package
|
||||||
|
if is_dpkg; then
|
||||||
|
dpkg --purge elasticsearch > /dev/null 2>&1 || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -x "`which apt-get 2>/dev/null`" ]; then
|
||||||
|
apt-get --quiet --yes purge elasticsearch > /dev/null 2>&1 || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Removes user & group
|
||||||
|
userdel elasticsearch > /dev/null 2>&1 || true
|
||||||
|
groupdel elasticsearch > /dev/null 2>&1 || true
|
||||||
|
|
||||||
|
|
||||||
|
# Removes all files
|
||||||
for d in "${ELASTICSEARCH_TEST_FILES[@]}"; do
|
for d in "${ELASTICSEARCH_TEST_FILES[@]}"; do
|
||||||
if [ -e "$d" ]; then
|
if [ -e "$d" ]; then
|
||||||
echo "$d should not exist before running the tests" >&2
|
rm -rf "$d"
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue