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 12, 2021
1 parent 36258b7 commit 308a50c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
27 changes: 16 additions & 11 deletions scripts/integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ source "${ROOTDIR}/scripts/.util/tools.sh"
function main() {
local src stack harness
src="$(find "${ROOTDIR}/src" -mindepth 1 -maxdepth 1 -type d )"
stack="$(jq -r -S .stack "${ROOTDIR}/config.json")"
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 < <(
Expand All @@ -32,15 +32,16 @@ function main() {

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

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

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

local nodes cached_flag serial_flag
cached_flag="--cached=${cached}"
Expand All @@ -53,23 +54,24 @@ function specs::run() {
fi

local buildpack_file
buildpack_file="$(buildpack::package "1.2.3" "${cached}")"
buildpack_file="$(buildpack::package "1.2.3" "${cached}" "${stack}")"

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

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

CF_STACK="${CF_STACK:-"${stack}"}" \
CF_STACK="${stack}" \
BUILDPACK_FILE="${BUILDPACK_FILE:-"${buildpack_file}"}" \
GOMAXPROCS="${GOMAXPROCS:-"${nodes}"}" \
go test \
Expand All @@ -83,13 +85,14 @@ function specs::gotest::run() {
}

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

CF_STACK="${CF_STACK:-"${stack}"}" \
CF_STACK="${stack}" \
BUILDPACK_FILE="${BUILDPACK_FILE:-"${buildpack_file}"}" \
ginkgo \
-r \
Expand All @@ -102,9 +105,10 @@ function specs::ginkgo::run(){
}

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

local name cached_flag
name="buildpack-v${version}-uncached.zip"
Expand All @@ -120,6 +124,7 @@ function buildpack::package() {
bash "${ROOTDIR}/scripts/package.sh" \
--version "${version}" \
--output "${output}" \
--stack "${stack}" \
"${cached_flag}" > /dev/null

printf "%s" "${output}"
Expand Down
5 changes: 5 additions & 0 deletions scripts/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ function main() {

while [[ "${#}" != 0 ]]; do
case "${1}" in
--stack)
stack="${2}"
shift 2
;;

--version)
version="${2}"
shift 2
Expand Down

0 comments on commit 308a50c

Please sign in to comment.