Skip to content

Commit

Permalink
Enable e2e logging to be toggled by a label
Browse files Browse the repository at this point in the history
  • Loading branch information
nwmac committed May 21, 2020
1 parent 4bf6bfc commit 1b4df49
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
12 changes: 12 additions & 0 deletions deploy/ci/travis/check-e2e-pr.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

if [ -n "${TRAVIS_PULL_REQUEST}" ]; then
if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then
echo "Checking labels on ${TRAVIS_PULL_REQUEST_SLUG} #${TRAVIS_PULL_REQUEST}"
LABEL=$(curl -s "https://api.github.com/repos/${TRAVIS_PULL_REQUEST_SLUG}/pulls/${TRAVIS_PULL_REQUEST}" | jq -r '.labels[] | select(.name == "e2e-debug") | .name')
if [ "${LABEL}" == "e2e-debug" ]; then
echo "PR has the 'e2e-debug' label - enabling debug logging for E2E tests"
export STRATOS_E2E_DEBUG=true
fi
fi
fi
5 changes: 5 additions & 0 deletions deploy/ci/travis/run-e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ set -e
echo "Stratos e2e tests"
echo "================="

DIRPATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && cd ../../.. && pwd)"

echo "Checking docker version"

docker version
Expand Down Expand Up @@ -64,6 +66,9 @@ export STRATOS_E2E_BASE_URL="https://127.0.0.1:5443"

E2E_TARGET="e2e -- --no-webdriver-update --dev-server-target= --base-url=https://127.0.0.1:5443 --suite=${SUITE}"

# Set Stratos debug if running a PR with the appropriate label
source "${DIRPATH}/deploy/ci/travis/check-e2e-pr.sh"

# Capture video if configured
if [ "$CAPTURE_VIDEO" == "video" ]; then
echo "Waiting for ffmpeg install to complete..."
Expand Down

0 comments on commit 1b4df49

Please sign in to comment.