Skip to content

Commit

Permalink
ci: add go integration tests with supervisord
Browse files Browse the repository at this point in the history
  • Loading branch information
karampok committed Jan 3, 2020
1 parent 37e5464 commit 6fef942
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 19 deletions.
33 changes: 15 additions & 18 deletions .buildkite/hooks/pre-artifact
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

set -eo pipefail

# Currently this is only needed for the new pipeline, so if we aren't on the new
# pipeline just exit.
if [ ! "$BUILDKITE_PIPELINE_SLUG" == "scionproto2" ]; then
exit 0
fi
case ${BUILDKITE_PIPELINE_SLUG:-local} in
scionproto2 | local )
;;
*)
exit 0 # If we aren't on the new pipeline, then just exit.
;;
esac

# Now we build the artifact name next, for this we first need TARGET and BUILD,
# see below.
Expand All @@ -24,27 +26,22 @@ BUILD="build-${BUILDKITE_BUILD_NUMBER}"
[ -n "$NIGHTLY" ] && BUILD=nightly-"$(date +%s)"
echo "\$BUILD=$BUILD"

ARTIFACTS="buildkite.${BUILDKITE_ORGANIZATION_SLUG}.${TARGET}.${BUILD}.${BUILDKITE_STEP_KEY}.${BUILDKITE_JOB_ID}"
echo "\$ARTIFACTS=$ARTIFACTS"

ARTIFACTS_DIR="artifacts"
echo "\$ARTIFACTS_DIR=$ARTIFACTS_DIR"
ARTIFACTS="buildkite.${BUILDKITE_ORGANIZATION_SLUG}.${TARGET}.${BUILD}.${BUILDKITE_STEP_KEY:-unset}.${BUILDKITE_JOB_ID}"
mkdir -p "artifacts/$ARTIFACTS" artifacts.out

function save {
if [ -d "$1" ]; then
echo Found artifacts: "$1"
find "$1"
cp -R "$1" "$ARTIFACTS_DIR/$ARTIFACTS"
fi
if [ -d "$1" ]; then
echo Found artifacts: "$1"
cp -R "$1" "artifacts/$ARTIFACTS"
fi
}

mkdir -p "$ARTIFACTS_DIR/$ARTIFACTS" artifacts.out

save "bazel-testlogs"
save "logs"
save "traces"
save "gen"
save "gen-cache"
save "$TEST_ARTIFACTS"

tar chaf "artifacts.out/$ARTIFACTS.tar.gz" -C "$ARTIFACTS_DIR" "$ARTIFACTS"
tar chaf "artifacts.out/$ARTIFACTS.tar.gz" -C artifacts "$ARTIFACTS"
echo "Output tar= artifacts.out/$ARTIFACTS.tar.gz"
2 changes: 1 addition & 1 deletion .buildkite/hooks/pre-exit
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ docker network prune -f
echo "Remove leftover volumes"
docker volume prune -f

rm -rf bazel-testlogs logs/* traces gen gen-cache "$TEST_ARTIFACTS"
rm -rf bazel-testlogs logs/* traces gen gen-cache "$TEST_ARTIFACTS" artifacts
19 changes: 19 additions & 0 deletions .buildkite/pipeline_buildlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,22 @@ steps:
automatic:
- exit_status: -1 # Agent was lost
- exit_status: 255 # Forced agent shutdown
- label: "Integration: {cert_req,pp,end2end,scmp}_integration"
command:
- bazel --bazelrc=.bazelrc_ci build //:scion //:scion-ci >/dev/null 2>&1
- tar -kxf bazel-bin/scion.tar -C bin --overwrite
- tar -kxf bazel-bin/scion-ci.tar -C bin --overwrite
- ./scion.sh topology nobuild
- ./scion.sh run nobuild && sleep 10
- ./bin/cert_req_integration -log.console warn
- ./bin/pp_integration -log.console warn
- ./bin/scmp_integration -log.console warn
- ./bin/end2end_integration -log.console warn
artifact_paths:
- "artifacts.out/**/*"
timeout_in_minutes: 5
key: integration_tests
retry:
automatic:
- exit_status: -1 # Agent was lost
- exit_status: 255 # Forced agent shutdown
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Thumbs.db
/gen/
/gen-cache/
/gen-certs/
/gen-test/
/traces/

# Python generated files #
Expand Down Expand Up @@ -73,3 +74,6 @@ tags
# bazel artifacts
/bazel-*
/.bazel-cache

# buildkite
artifacts.out

0 comments on commit 6fef942

Please sign in to comment.