Skip to content

Commit

Permalink
[package testing] Show kibana logs on exit (#128619) (#130327)
Browse files Browse the repository at this point in the history
* [package testing] Show kibana logs on exit

* fix syntax

* fix syntax

* fix

* use absolute path

* wrap in fn

(cherry picked from commit 0300e02)

Co-authored-by: Jonathan Budzenski <jon@elastic.co>
  • Loading branch information
kibanamachine and jbudz committed Apr 14, 2022
1 parent 8ce24f8 commit 834c676
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion .buildkite/scripts/steps/package_testing/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ elif [[ "$TEST_PACKAGE" == "docker" ]]; then
fi
cd ..

export VAGRANT_CWD=test/package
export VAGRANT_CWD=$PWD/test/package
vagrant up "$TEST_PACKAGE" --no-provision

node scripts/es snapshot \
Expand All @@ -29,6 +29,16 @@ node scripts/es snapshot \
--license=trial &
while ! timeout 1 bash -c "echo > /dev/tcp/localhost/9200"; do sleep 30; done

function echoKibanaLogs {
echo '--- Kibana logs'
if [[ "$TEST_PACKAGE" == "deb" ]] || [[ "$TEST_PACKAGE" == "rpm" ]]; then
vagrant ssh $TEST_PACKAGE -t -c 'sudo cat /var/log/kibana/kibana.log'
elif [[ "$TEST_PACKAGE" == "docker" ]]; then
vagrant ssh $TEST_PACKAGE -t -c 'sudo docker logs kibana'
fi
}
trap "echoKibanaLogs" EXIT

vagrant provision "$TEST_PACKAGE"

export TEST_BROWSER_HEADLESS=1
Expand Down

0 comments on commit 834c676

Please sign in to comment.