From 0d79331c47097427fbafa772e6f08141ec45a579 Mon Sep 17 00:00:00 2001 From: Konstantinos Date: Fri, 3 Jan 2020 16:19:20 +0100 Subject: [PATCH] ci: add go integration tests with supervisord (#3526) In the new pipeline version --- .buildkite/hooks/pre-artifact | 35 +++++++++++++++---------------- .buildkite/pipeline_buildlint.yml | 19 +++++++++++++++++ .gitignore | 3 +++ 3 files changed, 39 insertions(+), 18 deletions(-) diff --git a/.buildkite/hooks/pre-artifact b/.buildkite/hooks/pre-artifact index 20a523a4ea..df25a1dfaf 100755 --- a/.buildkite/hooks/pre-artifact +++ b/.buildkite/hooks/pre-artifact @@ -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} in + scionproto2 | scion ) + ;; + *) + 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. @@ -24,22 +26,16 @@ 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" @@ -47,4 +43,7 @@ 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" +rm -rf artifacts + +echo "Output tar= artifacts.out/$ARTIFACTS.tar.gz" diff --git a/.buildkite/pipeline_buildlint.yml b/.buildkite/pipeline_buildlint.yml index 48a9f2cc87..e4a8f3cbd8 100644 --- a/.buildkite/pipeline_buildlint.yml +++ b/.buildkite/pipeline_buildlint.yml @@ -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 diff --git a/.gitignore b/.gitignore index 4e03346273..5bc1fd0323 100644 --- a/.gitignore +++ b/.gitignore @@ -73,3 +73,6 @@ tags # bazel artifacts /bazel-* /.bazel-cache + +# local buildkite run +/artifacts.out