Skip to content

Commit

Permalink
Merge pull request #5383 from oasisprotocol/gw0/fix-buildkite-trap-on…
Browse files Browse the repository at this point in the history
…-failed-e2e-test

buildkite: Fix uploading artifacts when E2E test fails or timeouts
  • Loading branch information
gw0 authored Oct 5, 2023
2 parents b82fbf0 + a7ee9ce commit 6723ffd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 17 deletions.
27 changes: 11 additions & 16 deletions .buildkite/code.pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@ steps:
depends_on:
- "build-rust-runtimes"
command:
- trap 'buildkite-agent artifact upload "coverage-*.txt;/tmp/oasis-node-test_*/test-node.log"' EXIT
- .buildkite/go/test_and_coverage.sh
- buildkite-agent artifact upload "coverage-*.txt;/tmp/oasis-node-test_*/test-node.log"
retry:
<<: *retry_agent_failure
plugins:
Expand All @@ -217,16 +217,15 @@ steps:
- "build-rust-runtimes"
branches: "!master !stable/*"
parallelism: 5
timeout_in_minutes: 20
command:
- trap 'buildkite-agent artifact upload "coverage-merged-e2e-*.txt;/tmp/e2e/**/*.log;/tmp/e2e/**/genesis.json;/tmp/e2e/**/runtime_genesis.json"' EXIT
- .buildkite/scripts/download_e2e_test_artifacts.sh
# Needed as the trust-root test rebuilds the enclave with embedded trust root data.
- cargo install --locked --path tools
- export CFLAGS_x86_64_fortanix_unknown_sgx="-isystem/usr/include/x86_64-linux-gnu -mlvi-hardening -mllvm -x86-experimental-lvi-inline-asm-hardening"
- export CC_x86_64_fortanix_unknown_sgx=clang-11
# Only run runtime scenarios as others do not use SGX.
- .buildkite/scripts/test_e2e.sh --scenario e2e/runtime/runtime-encryption --scenario e2e/runtime/trust-root/.+ --scenario e2e/runtime/keymanager-.+
- buildkite-agent artifact upload "coverage-merged-e2e-*.txt;/tmp/e2e/**/*.log;/tmp/e2e/**/genesis.json;/tmp/e2e/**/runtime_genesis.json"
- .buildkite/scripts/test_e2e.sh --timeout 20m --scenario e2e/runtime/runtime-encryption --scenario e2e/runtime/trust-root/.+ --scenario e2e/runtime/keymanager-.+
env:
# Unsafe flags needed as the trust-root test rebuilds the enclave with embedded trust root data.
OASIS_UNSAFE_SKIP_AVR_VERIFY: "1"
Expand All @@ -247,14 +246,13 @@ steps:
- "build-rust-runtimes"
branches: master stable/*
parallelism: 20
timeout_in_minutes: 20
command:
- trap 'buildkite-agent artifact upload "coverage-merged-e2e-*.txt;/tmp/e2e/**/*.log;/tmp/e2e/**/genesis.json;/tmp/e2e/**/runtime_genesis.json"' EXIT
- .buildkite/scripts/download_e2e_test_artifacts.sh
# Needed as the trust-root test rebuilds the enclave with embedded trust root data.
- cargo install --locked --path tools
# Only run runtime scenarios as others do not use SGX.
- .buildkite/scripts/test_e2e.sh --scenario e2e/runtime/.*
- buildkite-agent artifact upload "coverage-merged-e2e-*.txt;/tmp/e2e/**/*.log;/tmp/e2e/**/genesis.json;/tmp/e2e/**/runtime_genesis.json"
- .buildkite/scripts/test_e2e.sh --timeout 20m --scenario e2e/runtime/.*
env:
# Unsafe flags needed as the trust-root test rebuilds the enclave with embedded trust root data.
OASIS_UNSAFE_SKIP_AVR_VERIFY: "1"
Expand All @@ -278,11 +276,10 @@ steps:
- "build-rust-runtime-loader"
- "build-rust-runtimes"
parallelism: 30
timeout_in_minutes: 20
command:
- trap 'buildkite-agent artifact upload "coverage-merged-e2e-*.txt;/tmp/e2e/**/*.log;/tmp/e2e/**/genesis.json;/tmp/e2e/**/runtime_genesis.json"' EXIT
- .buildkite/scripts/download_e2e_test_artifacts.sh
- .buildkite/scripts/test_e2e.sh
- buildkite-agent artifact upload "coverage-merged-e2e-*.txt;/tmp/e2e/**/*.log;/tmp/e2e/**/genesis.json;/tmp/e2e/**/runtime_genesis.json"
- .buildkite/scripts/test_e2e.sh --timeout 20m
env:
OASIS_E2E_COVERAGE: enable
# Since the trust-root scenarios are tested in SGX mode (for which they are actually relevant)
Expand All @@ -300,11 +297,10 @@ steps:
- "build-go"
- "build-rust-runtime-loader"
- "build-rust-runtimes"
timeout_in_minutes: 20
command:
- trap 'buildkite-agent artifact upload "coverage-merged-e2e-*.txt;/tmp/e2e/**/*.log;/tmp/e2e/**/genesis.json;/tmp/e2e/**/runtime_genesis.json"' EXIT
- .buildkite/scripts/download_e2e_test_artifacts.sh
- .buildkite/scripts/test_e2e.sh --scenario e2e/runtime/txsource-multi-short
- buildkite-agent artifact upload "coverage-merged-e2e-*.txt;/tmp/e2e/**/*.log;/tmp/e2e/**/genesis.json;/tmp/e2e/**/runtime_genesis.json"
- .buildkite/scripts/test_e2e.sh --timeout 20m --scenario e2e/runtime/txsource-multi-short
env:
OASIS_E2E_COVERAGE: enable
TEST_BASE_DIR: /tmp
Expand All @@ -318,10 +314,9 @@ steps:
###########################################
- label: E2E tests - sgx1 - IAS
branches: master stable/*
timeout_in_minutes: 20
command:
- .buildkite/scripts/sgx_ias_tests.sh
- buildkite-agent artifact upload "coverage-merged-e2e-*.txt;/tmp/e2e/**/*.log;/tmp/e2e/**/genesis.json;/tmp/e2e/**/runtime_genesis.json"
- trap 'buildkite-agent artifact upload "coverage-merged-e2e-*.txt;/tmp/e2e/**/*.log;/tmp/e2e/**/genesis.json;/tmp/e2e/**/runtime_genesis.json"' EXIT
- .buildkite/scripts/sgx_ias_tests.sh --timeout 20m
# A unique string to identify the step. The value is available in the
# BUILDKITE_STEP_KEY and is used to ensure the generated coverage file
# names are unique across this pipeline.
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/scripts/sgx_ias_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ export OASIS_UNSAFE_ALLOW_DEBUG_ENCLAVES=1
export OASIS_TEE_HARDWARE=intel-sgx

make all
.buildkite/scripts/test_e2e.sh --scenario e2e/runtime/runtime-encryption
.buildkite/scripts/test_e2e.sh --scenario e2e/runtime/runtime-encryption "$@"
Empty file added .changelog/5383.trivial.md
Empty file.

0 comments on commit 6723ffd

Please sign in to comment.