Skip to content

Commit

Permalink
Add ability to run branch-specific trace files.
Browse files Browse the repository at this point in the history
Pass the travis branch to run_regression_tests.sh. When downloading
trace files, first look for a file traces-XXX-$BRANCH and if found
download it. This allows testing out a set of changes with a trace file
specifically for that branch, that can be moved to the normal file once
the PR is merged.

Also increase the timeout for the spawned falco process from 1 to 3
minutes. In debug mode, the kubernetes demo was taking slightly over 1
minute.
  • Loading branch information
mstemm committed Jul 12, 2016
1 parent a2011c3 commit 8ffb553
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ script:
- make VERBOSE=1
- make package
- cd ..
- sudo test/run_regression_tests.sh
- sudo test/run_regression_tests.sh $TRAVIS_BRANCH
notifications:
webhooks:
urls:
# - https://webhooks.gitter.im/e/fdbc2356fb0ea2f15033
on_success: change
on_failure: always
on_start: never
on_start: never
2 changes: 1 addition & 1 deletion test/falco_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def test(self):

self.falco_proc = process.SubProcess(cmd)

res = self.falco_proc.run(timeout=60, sig=9)
res = self.falco_proc.run(timeout=180, sig=9)

if res.exit_status != 0:
self.error("Falco command \"{}\" exited with non-zero return value {}".format(
Expand Down
4 changes: 3 additions & 1 deletion test/run_regression_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
SCRIPT=$(readlink -f $0)
SCRIPTDIR=$(dirname $SCRIPT)
MULT_FILE=$SCRIPTDIR/falco_tests.yaml
BRANCH=$1

function download_trace_files() {
echo "branch=$BRANCH"
for TRACE in traces-positive traces-negative traces-info ; do
rm -rf $SCRIPTDIR/$TRACE
curl -so $SCRIPTDIR/$TRACE.zip https://s3.amazonaws.com/download.draios.com/falco-tests/$TRACE.zip &&
curl -fso $SCRIPTDIR/$TRACE.zip https://s3.amazonaws.com/download.draios.com/falco-tests/$TRACE-$BRANCH.zip || curl -fso $SCRIPTDIR/$TRACE.zip https://s3.amazonaws.com/download.draios.com/falco-tests/$TRACE.zip &&
unzip -d $SCRIPTDIR $SCRIPTDIR/$TRACE.zip &&
rm -rf $SCRIPTDIR/$TRACE.zip
done
Expand Down

0 comments on commit 8ffb553

Please sign in to comment.