Skip to content

Commit

Permalink
Updating github-config
Browse files Browse the repository at this point in the history
  • Loading branch information
cf-buildpacks-eng authored and ryanmoran committed Aug 31, 2021
1 parent ee696ba commit 9817643
Showing 1 changed file with 6 additions and 44 deletions.
50 changes: 6 additions & 44 deletions scripts/integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,15 @@ readonly ROOTDIR
source "${ROOTDIR}/scripts/.util/tools.sh"

function main() {
local src stack harness
local src stack
src="$(find "${ROOTDIR}/src" -mindepth 1 -maxdepth 1 -type d )"
stack="${CF_STACK:-$(jq -r -S .stack "${ROOTDIR}/config.json")}"
harness="$(jq -r -S .integration.harness "${ROOTDIR}/config.json")"

IFS=$'\n' read -r -d '' -a matrix < <(
jq -r -S -c .integration.matrix[] "${ROOTDIR}/config.json" \
&& printf "\0"
)

util::tools::ginkgo::install --directory "${ROOTDIR}/.bin"
util::tools::buildpack-packager::install --directory "${ROOTDIR}/.bin"
util::tools::cf::install --directory "${ROOTDIR}/.bin"

Expand All @@ -32,16 +30,15 @@ function main() {

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

specs::run "${harness}" "${cached}" "${parallel}" "${stack}"
specs::run "${cached}" "${parallel}" "${stack}"
done
}

function specs::run() {
local harness cached parallel stack
harness="${1}"
cached="${2}"
parallel="${3}"
stack="${4}"
local cached parallel stack
cached="${1}"
parallel="${2}"
stack="${3}"

local nodes cached_flag serial_flag
cached_flag="--cached=${cached}"
Expand All @@ -56,21 +53,6 @@ function specs::run() {
local buildpack_file
buildpack_file="$(buildpack::package "1.2.3" "${cached}" "${stack}")"

if [[ "${harness}" == "gotest" ]]; then
specs::gotest::run "${nodes}" "${cached_flag}" "${serial_flag}" "${buildpack_file}" "${stack}"
else
specs::ginkgo::run "${nodes}" "${cached_flag}" "${serial_flag}" "${buildpack_file}" "${stack}"
fi
}

function specs::gotest::run() {
local nodes cached_flag serial_flag buildpack_file stack
nodes="${1}"
cached_flag="${2}"
serial_flag="${3}"
buildpack_file="${4}"
stack="${5}"

CF_STACK="${stack}" \
BUILDPACK_FILE="${BUILDPACK_FILE:-"${buildpack_file}"}" \
GOMAXPROCS="${GOMAXPROCS:-"${nodes}"}" \
Expand All @@ -84,26 +66,6 @@ function specs::gotest::run() {
"${serial_flag}"
}

function specs::ginkgo::run(){
local nodes cached_flag serial_flag buildpack_file stack
nodes="${1}"
cached_flag="${2}"
serial_flag="${3}"
buildpack_file="${4}"
stack="${5}"

CF_STACK="${stack}" \
BUILDPACK_FILE="${BUILDPACK_FILE:-"${buildpack_file}"}" \
ginkgo \
-r \
-mod vendor \
--flakeAttempts "${GINKGO_ATTEMPTS:-2}" \
-nodes "${nodes}" \
--slowSpecThreshold 60 \
"${src}/integration" \
-- "${cached_flag}" "${serial_flag}"
}

function buildpack::package() {
local version cached stack
version="${1}"
Expand Down

0 comments on commit 9817643

Please sign in to comment.