Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 5 additions & 15 deletions scripts/integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,14 @@ OPTIONS
--help -h prints the command usage
--github-token <token> GitHub token to use when making API requests
--platform <cf|docker> Switchblade platform to execute the tests against
--keep-failed-containers Preserve failed test containers for debugging (default: false)
USAGE
}

function main() {
local src stack platform token cached parallel keep_failed
local src stack platform token cached parallel
src="$(find "${ROOTDIR}/src" -mindepth 1 -maxdepth 1 -type d )"
stack="${CF_STACK:-$(jq -r -S .stack "${ROOTDIR}/config.json")}"
platform="cf"
keep_failed="false"

while [[ "${#}" != 0 ]]; do
case "${1}" in
Expand All @@ -54,11 +52,6 @@ function main() {
shift 2
;;

--keep-failed-containers)
keep_failed="true"
shift 1
;;

--help|-h)
shift 1
usage
Expand Down Expand Up @@ -101,26 +94,24 @@ function main() {

echo "Running integration suite (cached: ${cached}, parallel: ${parallel})"

specs::run "${cached}" "${parallel}" "${stack}" "${platform}" "${token:-}" "${keep_failed}"
specs::run "${cached}" "${parallel}" "${stack}" "${platform}" "${token:-}"
done
}

function specs::run() {
local cached parallel stack platform token keep_failed
local cached parallel stack platform token
cached="${1}"
parallel="${2}"
stack="${3}"
platform="${4}"
token="${5}"
keep_failed="${6}"

local nodes cached_flag serial_flag platform_flag stack_flag token_flag keep_failed_flag
local nodes cached_flag serial_flag platform_flag stack_flag token_flag
cached_flag="--cached=${cached}"
serial_flag="--serial=true"
platform_flag="--platform=${platform}"
stack_flag="--stack=${stack}"
token_flag="--github-token=${token}"
keep_failed_flag="--keep-failed-containers=${keep_failed}"
nodes=1

if [[ "${parallel}" == "true" ]]; then
Expand All @@ -144,8 +135,7 @@ function specs::run() {
"${platform_flag}" \
"${token_flag}" \
"${stack_flag}" \
"${serial_flag}" \
"${keep_failed_flag}"
"${serial_flag}"
}

function buildpack::package() {
Expand Down
Loading