Skip to content

Instantly share code, notes, and snippets.

@krisleech
Created February 24, 2014 10:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krisleech/9185616 to your computer and use it in GitHub Desktop.
Save krisleech/9185616 to your computer and use it in GitHub Desktop.
Get list of cukes failing in one branch but not another using output from CI
#!/usr/bin/env bash
# manual steps
# Download raw output of master cuke to master-cuke-ci.raw as plain text
# Download raw output of another cuke branch to branch-cuke-js.raw as plain text
set -e
MASTER_RAW_FILE=master-cukes-ci.raw
BRANCH_RAW_FILE=branch-cukes-ci.raw
MASTER_FAILS_FILE=master-cukes-ci.fails
BRANCH_FAILS_FILE=branch-cukes-ci.fails
RESULTS_FILE=fails-in-branch-not-in-master
if [ ! -f "./${MASTER_RAW_FILE}" ]; then
echo "Download raw output of master cuke to ${MASTER_RAW_FILE} as plain text"
exit 0
fi
if [ ! -f "./${BRANCH_RAW_FILE}" ]; then
echo "Download raw output of branch cuke to ${BRANCH_RAW_FILE} as plain text"
exit 0
fi
awk '/Failing Scenarios/' RS= $MASTER_RAW_FILE | sed '/Failing Scenarios:/d' > $MASTER_FAILS_FILE
awk '/Failing Scenarios/' RS= $BRANCH_RAW_FILE | sed '/Failing Scenarios:/d' > $BRANCH_FAILS_FILE
# 1=left, 2= right, 3=both
comm -23 $BRANCH_FAILS_FILE $MASTER_FAILS_FILE > $RESULTS_FILE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment