<commit_before>#!/bin/bash
#############################################################################
# A shell script for running acceptance tests from travis via AWS.
#############################################################################

# Setup global variables
export DEBUG=1
export EXCON_DEBUG=1
export FOG_RC=./secrets/fog.rc
export GITBRANCH='master'
export GITREPO='https://github.com/puppetlabs/puppetlabs-ntp.git'

#############################################################################
# Check if we are to run this at all.
#############################################################################

if [ -z "$BEAKER_TEST" ]; then
  echo "Skipping acceptance tests."
  exit 0
fi

echo "TRAVIS_JOB_ID: $TRAVIS_JOB_ID"

if [ "$TRAVIS_JOB_ID" != 1 ]; then
  echo "Skipping acceptance tests."
  exit 0
fi

echo "TRAVIS_JOB_ID: $TRAVIS_TEST_RESULT"

if [ "$TRAVIS_TEST_RESULT" != 0 ]; then
  echo "Skipping acceptance tests."
  exit 0
fi

if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
  echo "This is a pull request, skipping acceptance tests."
  exit 0
fi

#############################################################################
# Provision the AWS node.
#############################################################################
tar xvf secrets.tar
instance_info=`ruby tests/provision.rb`
instance_id=`echo $instance_info | cut -d: -f1`
instance_public_ip_address=`echo $instance_info | cut -d: -f2`
<commit_msg>WIP (#115).<commit_after>#!/bin/bash
#############################################################################
# A shell script for running acceptance tests from travis via AWS.
#############################################################################

# Setup global variables
export DEBUG=1
export EXCON_DEBUG=1
export FOG_RC=./secrets/fog.rc
export GITBRANCH='master'
export GITREPO='https://github.com/puppetlabs/puppetlabs-ntp.git'

#############################################################################
# Check if we are to run this at all.
#############################################################################

if [ -z "$BEAKER_TEST" ]; then
  echo "Skipping acceptance tests."
  exit 0
fi

echo "TRAVIS_BUILD_ID     : $TRAVIS_BUILD_ID"
echo "TRAVIS_BUILD_NUMBER : $TRAVIS_BUILD_ID"
echo "TRAVIS_JOB_ID       : $TRAVIS_JOB_ID"
echo "TRAVIS_JOB_NUMBER   : $TRAVIS_JOB_NUMBER"
echo "TRAVIS_TEST_RESULT  : $TRAVIS_TEST_RESULT"

if [ "$TRAVIS_TEST_RESULT" != 0 ]; then
  echo "Skipping acceptance tests."
  exit 0
fi

if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
  echo "This is a pull request, skipping acceptance tests."
  exit 0
fi

#############################################################################
# Provision the AWS node.
#############################################################################
tar xvf secrets.tar
instance_info=`ruby tests/provision.rb`
instance_id=`echo $instance_info | cut -d: -f1`
instance_public_ip_address=`echo $instance_info | cut -d: -f2`

{'fraction_non_alphanumeric': 0.3879339400067408, 'fraction_numerical': 0.007077856420626896, 'mean_word_length': 6.872679045092839, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3995454', 'n_tokens_mistral': 895, 'n_tokens_neox': 834, 'n_words': 215}