Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: add revocation tests to pipeline 2 #3563

Merged
merged 4 commits into from
Dec 31, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .buildkite/hooks/pre-command
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ echo "Clean existing environment"

if [ "$BUILDKITE_PIPELINE_SLUG" == "scionproto2" ]; then
export ACCEPTANCE_ARTIFACTS="$PWD/accept_artifacts"
mkdir -p "$ACCEPTANCE_ARTIFACTS"
fi

echo "Starting bazel remote cache proxy"
Expand Down
21 changes: 20 additions & 1 deletion .buildkite/pipeline2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ gen_acceptance() {
name="$(basename ${test%_acceptance})"
echo " - label: \"Acceptance: $name\""
echo " command:"
echo " - \"mkdir -p \$\$ACCEPTANCE_ARTIFACTS\""
echo " - ./acceptance/ctl gsetup"
echo " - ./acceptance/ctl grun $name"
echo " key: ${name}_acceptance"
Expand All @@ -23,5 +22,25 @@ gen_acceptance() {
done
}

# gen_acceptance2 generates steps for bazel tests in acceptance folder.
gen_acceptance2() {
for test in $(bazel query 'kind(sh_test, //acceptance/...)' 2>/dev/null); do
# test has the format //acceptance/<name>:<name>_test
name=$(echo $test | cut -d ':' -f 1)
name=${name#'//acceptance/'}
echo " - label: \"Acceptance: $name\""
echo " command:"
echo " - bazel test --action_env=ACCEPTANCE_ARTIFACTS $test"
echo " key: ${name}_acceptance"
echo " artifact_paths:"
echo " - \"artifacts.out/**/*\""
echo " retry:"
echo " automatic:"
echo " - exit_status: -1 # Agent was lost"
echo " - exit_status: 255 # Forced agent shutdown"
done
}

cat .buildkite/pipeline_buildlint.yml
gen_acceptance2
gen_acceptance
45 changes: 17 additions & 28 deletions .buildkite/pipeline_buildlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,22 @@ steps:
timeout_in_minutes: 10
- label: "Check generated go_deps.bzl file is up to date with go.mod"
command:
- "rm -rf /tmp/$BUILDKITE_STEP_ID/"
- "mkdir -p /tmp/$BUILDKITE_STEP_ID/"
- "cp go.mod go.sum go_deps.bzl /tmp/$BUILDKITE_STEP_ID/"
- "make godeps -B"
- "cp go.mod go.sum go_deps.bzl $$ACCEPTANCE_ARTIFACTS/"
- make godeps -B
- "bazel-${BUILDKITE_PIPELINE_SLUG}/external/go_sdk/bin/go mod tidy"
- "diff -u /tmp/$BUILDKITE_STEP_ID/go.mod go.mod"
- "diff -u /tmp/$BUILDKITE_STEP_ID/go.sum go.sum"
- "diff -u /tmp/$BUILDKITE_STEP_ID/go_deps.bzl go_deps.bzl"
- "diff -u $$ACCEPTANCE_ARTIFACTS/go.mod go.mod"
- "diff -u $$ACCEPTANCE_ARTIFACTS/go.sum go.sum"
- "diff -u $$ACCEPTANCE_ARTIFACTS/go_deps.bzl go_deps.bzl"
key: go_deps_lint
retry:
automatic:
- exit_status: -1 # Agent was lost
- exit_status: 255 # Forced agent shutdown
- label: "Check generated go/proto files in git"
command:
- "rm -rf /tmp/$BUILDKITE_STEP_ID/"
- "mkdir -p /tmp/$BUILDKITE_STEP_ID/"
- "cp -R go/proto/ /tmp/$BUILDKITE_STEP_ID/"
- "make gogen"
- "diff -ur /tmp/$BUILDKITE_STEP_ID/proto/ go/proto/"
- "cp -R go/proto/ $$ACCEPTANCE_ARTIFACTS"
- make gogen
- "diff -ur $$ACCEPTANCE_ARTIFACTS/proto/ go/proto/"
key: go_gen_lint
retry:
automatic:
Expand All @@ -53,26 +49,19 @@ steps:
automatic:
- exit_status: -1 # Agent was lost
- exit_status: 255 # Forced agent shutdown
- label: "Acceptance: sig_failover"
- label: "Revocation tests"
command:
- mkdir -p $$ACCEPTANCE_ARTIFACTS
- bazel test --action_env=ACCEPTANCE_ARTIFACTS //acceptance/sig_failover:sig_failover_test
key: sig_failover
retry:
automatic:
- exit_status: -1 # Agent was lost
- exit_status: 255 # Forced agent shutdown
- 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/end2end_integration -log.console warn
- ./integration/revocation_test.sh
key: revocation_tests
artifact_paths:
- "artifacts.out/**/*"
- label: "Acceptance: sig_short_exp_time"
command:
- mkdir -p $$ACCEPTANCE_ARTIFACTS
- bazel test --action_env=ACCEPTANCE_ARTIFACTS //acceptance/sig_short_exp_time:sig_short_exp_time_test
key: sig_short_exp_time
retry:
automatic:
- exit_status: -1 # Agent was lost
- exit_status: 255 # Forced agent shutdown
artifact_paths:
- "artifacts.out/**/*"