This repository has been archived by the owner on Dec 12, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 155
/
tck.sh
executable file
·70 lines (67 loc) · 2.74 KB
/
tck.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#! /bin/bash
#
# Copyright 2016 Stormpath, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
OPTION=${1:-NO_OPTION}
OPTION_ARGUMENT01=${2:-NOT_SET}
OPTION_ARGUMENT02=${3:-NOT_SET}
AVAILABLE_PROFILES="java, laravel, express"
if [ "$OPTION" = "NO_OPTION" ] ; then
echo "usage: tck [<option>]"
echo "Option"
echo " clone <dir> clones stormpath-framework-tck locally under directory <dir>."
echo " If no <dir>, then current dir."
echo " run <profile> <dir> runs actual TCK tests using profile <profile>. Valid profiles are $AVAILABLE_PROFILES."
echo " TCK code will be sought under <dir>. If no directory is specified then current dir will be used."
echo ""
exit
fi
case "$OPTION" in
clone)
DIR=${OPTION_ARGUMENT01}
if [ "${DIR}" = "NOT_SET" ] ; then DIR="stormpath-framework-tck"; fi
echo "Checking out TCK"
git clone [email protected]:stormpath/stormpath-framework-tck.git ${DIR}
cd ${DIR}
git fetch
git checkout master
echo "TCK cloned"
;;
run)
SCRIPT_DIR=$(cd "$(dirname "$0")"; pwd)
CI_DIR_CONTENTS=`ls $SCRIPT_DIR/ci`
echo "CI DIR Contents:"
if [ -e "$SCRIPT_DIR/ci/stormpath_env.sh" ]; then
source ${SCRIPT_DIR}/ci/stormpath_env.sh
export STORMPATH_APPLICATION_HREF=$STORMPATH_TEST_APPLICATION_HREF
fi
PROFILE=${OPTION_ARGUMENT01}
DIR=${OPTION_ARGUMENT02}
#Let's read the name of the directory where tck was cloned
if [ "$PROFILE" = "NOT_SET" ] ; then echo "Missing profile. Valid profiles are $AVAILABLE_PROFILES"; exit; fi
if [ "${DIR}" = "NOT_SET" ] ; then DIR="stormpath-framework-tck"; fi
echo "Setting TCK properties"
echo "Using profile: ${PROFILE}"
cd ${DIR}
echo "Running TCK now!"
mvn -Prun-ITs -P$PROFILE clean post-integration-test # skipping 'verify' until all of the ITs pass or are grouped out for Okta use
EXIT_STATUS="$?"
if [ "$EXIT_STATUS" -ne 0 ]; then
echo "TCK found errors! :^(. Exit status was $EXIT_STATUS"
exit $EXIT_STATUS
fi
echo "TCK ran successfully, no errors found!"
;;
esac