Skip to content

Commit

Permalink
Merge bb7e704 into da04ff2
Browse files Browse the repository at this point in the history
  • Loading branch information
yasirfolio3 committed Oct 31, 2019
2 parents da04ff2 + bb7e704 commit 39aaa55
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 1 deletion.
12 changes: 11 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ install:
- eval "$(gimme)"
stages:
- 'Lint'
# - 'Integration tests'
- 'Unit test'
- 'Integration tests'
jobs:
include:
- stage: 'Lint'
Expand Down Expand Up @@ -54,3 +54,13 @@ jobs:
- go get github.com/mattn/goveralls
after_success:
- $GOPATH/bin/goveralls -coverprofile=profile.cov -service=travis-ci
- stage: 'Integration tests'
env: GIMME_GO_VERSION=1.12.x FSC_PATH="/tmp/fsc-repo"
before_script:
- mkdir -p $FSC_PATH
- pushd $FSC_PATH && git init && git fetch --depth=1 https://$CI_USER_TOKEN@github.com/optimizely/fullstack-sdk-compatibility-suite ${FSC_BRANCH:-master} && git checkout FETCH_HEAD && popd
install:
- eval "$(gimme)"
script:
- ./scripts/run-fsc-tests.sh -f "$FSC_PATH/features/" -d "$FSC_PATH/features/support/datafiles/" -t "$TAGS"

70 changes: 70 additions & 0 deletions scripts/run-fsc-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#!/bin/bash

# This script fetches Full stack compatibility suite and copies all the feature files and datafiles to the given paths.

# inputs:
# FEATURES_PATH - destination path to copy feature files (required)
# DATAFILES_PATH - destination path to use for datafiles (required)
# TAG_FILTER_EXPRESSION - Gherkin filter
FEATURE_FILES_PATH="${FEATURES_PATH:-}"
DATAFILES_PATH="${DATAFILES_PATH:-}"
TAG_FILTER_EXPRESSION=""
usage() { echo "Usage: $0 -h [-t <string>] [-f <string>] [-d <string>]" 1>&2; }

show_example() { cat <<EOF
Example: $0 -f /usr/tests/integration/features -d /usr/support/fsc-datafiles -t "@FEATURE_ROLLOUT && ~@INPUT_FILTER"
EOF
}

while getopts ":t:f:d:h" o; do
case "${o}" in
f)
FEATURE_FILES_PATH=${OPTARG}
;;
d)
DATAFILES_PATH=${OPTARG}
;;
t)
TAG_FILTER_EXPRESSION=${OPTARG}
;;
h)
usage
echo
show_example
exit 1
;;
*)
usage
exit 1
;;
esac

done
shift $((OPTIND-1))


if [ -z "$FEATURE_FILES_PATH" ]; then
echo
echo "-f is a required argument"
echo
show_example
exit 1
fi

if [ -z "$DATAFILES_PATH" ]; then
echo
echo "-d is a required argument"
echo
show_example
exit 1
fi

set -ex
GO_FEATUREFILES_PATH="$(pwd)/tests/integration/features"
rm -rf $GO_FEATUREFILES_PATH
mkdir -p $GO_FEATUREFILES_PATH
cp -r $FEATURE_FILES_PATH $GO_FEATUREFILES_PATH

export DATAFILES_DIR="$DATAFILES_PATH"
go test -v $(pwd)/tests/integration --godog.tags="$TAG_FILTER_EXPRESSION"
echo "Ready for testing."

0 comments on commit 39aaa55

Please sign in to comment.