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 Jul 15, 2021
1 parent 345f7d2 commit 039bed4
Showing 1 changed file with 35 additions and 6 deletions.
41 changes: 35 additions & 6 deletions scripts/integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,25 @@ function specs::run() {
serial_flag=""
fi

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

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

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

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

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

CF_STACK="${CF_STACK:-"${stack}"}" \
BUILDPACK_FILE="${UNCACHED_BUILDPACK_FILE:-}" \
BUILDPACK_FILE="${BUILDPACK_FILE:-"${buildpack_file}"}" \
ginkgo \
-r \
-mod vendor \
Expand All @@ -96,4 +101,28 @@ function specs::ginkgo::run(){
-- "${cached_flag}" "${serial_flag}"
}

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

local name cached_flag
name="buildpack-v${version}-uncached.zip"
cached_flag=""
if [[ "${cached}" == "true" ]]; then
cached_flag="--cached"
name="buildpack-v${version}-cached.zip"
fi

local output
output="$(mktemp -d)/${name}"

bash "${ROOTDIR}/scripts/package.sh" \
--version "${version}" \
--output "${output}" \
"${cached_flag}" > /dev/null

printf "%s" "${output}"
}

main "${@:-}"

0 comments on commit 039bed4

Please sign in to comment.