-
Notifications
You must be signed in to change notification settings - Fork 287
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make upstream tests as separate make target
- Loading branch information
Showing
3 changed files
with
70 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#!/bin/bash | ||
# | ||
# IMAGE_NAME specifies a name of the candidate image used for testing. | ||
# The image has to be available before this script is executed. | ||
# | ||
# For each client package test, XXX_REVISION specifies which | ||
# branch or tag should be tested; by default it uses the latest | ||
# released version as reported by `npm show XXX version` where | ||
# XXX is the name of the npm package. | ||
# | ||
THISDIR="$(dirname ${BASH_SOURCE[0]})" | ||
source "${THISDIR}/test-lib.sh" | ||
source "${THISDIR}/test-lib-nodejs.sh" | ||
|
||
test -n "$IMAGE_NAME" -a -n "$VERSION" | ||
|
||
# define the client npm packages to be tested. For | ||
# each entry XXX in the list a corresponding value for | ||
# XXX_REVISION and XXX_REPO must be defined below | ||
TEST_LIST_CLIENTS="\ | ||
test_client_express | ||
test_client_prom | ||
test_client_opossum | ||
test_client_kube | ||
test_client_faas | ||
test_client_cloudevents | ||
test_client_fastify | ||
" | ||
|
||
readonly EXPRESS_REVISION="${EXPRESS_REVISION:-$(docker run --rm "${IMAGE_NAME}" -- npm show express version)}" | ||
readonly EXPRESS_REPO="https://github.com/expressjs/express.git" | ||
readonly PINO_REVISION=v"${PINO_REVISION:-$(docker run --rm "${IMAGE_NAME}" -- npm show pino version)}" | ||
readonly PINO_REPO="https://github.com/pinojs/pino.git" | ||
readonly PROMCLIENT_REVISION=v"${PROMCLIENT_REVISION:-$(docker run --rm "${IMAGE_NAME}" -- npm show prom-client version)}" | ||
readonly PROMCLIENT_REPO="https://github.com/siimon/prom-client.git" | ||
readonly OPOSSUM_REVISION="v${OPOSSUM_REVISION:-$(docker run --rm "${IMAGE_NAME}" -- npm show opossum version)}" | ||
readonly OPOSSUM_REPO="https://github.com/nodeshift/opossum.git" | ||
readonly KUBESERVICEBINDINGS_REVISION="v${KUBESERVICEBINDINGS_REVISION:-$(docker run --rm "${IMAGE_NAME}" -- npm show kube-service-bindings version)}" | ||
readonly KUBESERVICEBINDINGS_REPO="https://github.com/nodeshift/kube-service-bindings.git" | ||
readonly FAASJSRUNTIME_REVISION="v${FAASJSRUNTIME_REVISION:-$(docker run --rm "${IMAGE_NAME}" -- npm show faas-js-runtime version)}" | ||
readonly FAASJSRUNTIME_REPO="https://github.com/nodeshift/faas-js-runtime.git" | ||
readonly CLOUDEVENTS_REVISION="v${CLOUDEVENTS_REVISION:-$(docker run --rm "${IMAGE_NAME}" -- npm show cloudevents version)}" | ||
readonly CLOUDEVENTS_REPO="https://github.com/cloudevents/sdk-javascript.git" | ||
readonly FASTIFY_REVISION="v${FASTIFY_REVISION:-$(docker run --rm "${IMAGE_NAME}" -- npm show fastify version)}" | ||
readonly FASTIFY_REPO="https://github.com/fastify/fastify.git" | ||
|
||
# Since we built the candidate image locally, we don't want S2I attempt to pull | ||
# it from a registry | ||
s2i_args="--pull-policy=never " | ||
|
||
# TODO: This should be part of the image metadata | ||
test_port=8080 | ||
|
||
# Common git configuration | ||
readonly -A gitconfig=( | ||
[user.name]="builder" | ||
[user.email]="build@localhost" | ||
[commit.gpgsign]="false" | ||
) | ||
|
||
[[ -n "$DEBUG" ]] && set -x | ||
|
||
ct_init | ||
cid_file=$CID_FILE_DIR/$(mktemp -u -p . --suffix=.cid) | ||
|
||
TEST_SET=${TESTS:-$TEST_LIST_CLIENTS} ct_run_tests_from_testset "clients" |