From 7acd1606faeed544be04ae2a3c26e72733d48835 Mon Sep 17 00:00:00 2001 From: Billy Zha Date: Wed, 22 Feb 2023 08:59:53 +0800 Subject: [PATCH] test(e2e): take registry logs when e2e fails (#830) Signed-off-by: Billy Zha --- test/e2e/scripts/e2e.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/test/e2e/scripts/e2e.sh b/test/e2e/scripts/e2e.sh index bf9c69b2c..f434cfc92 100755 --- a/test/e2e/scripts/e2e.sh +++ b/test/e2e/scripts/e2e.sh @@ -41,19 +41,27 @@ if [ "$clean_up" = '--clean' ]; then trap "try_clean_up oras-e2e oras-e2e-fallback" EXIT fi +oras_container_name="oras-e2e" +upstream_container_name="oras-e2e-fallback" echo " === preparing oras distribution === " run_registry \ ${repo_root}/test/e2e/testdata/distribution/mount \ ghcr.io/oras-project/registry:v1.0.0-rc.4 \ - oras-e2e \ + $oras_container_name \ $ORAS_REGISTRY_PORT echo " === preparing upstream distribution === " run_registry \ ${repo_root}/test/e2e/testdata/distribution/mount_fallback \ registry:2.8.1 \ - oras-e2e-fallback \ + $upstream_container_name \ $ORAS_REGISTRY_FALLBACK_PORT echo " === run tests === " -ginkgo -r -p --succinct suite \ No newline at end of file +if ! ginkgo -r -p --succinct suite; then + echo '-------- oras distribution trace -------------' + docker logs -t --tail 200 $oras_container_name + echo '-------- upstream distribution trace -------------' + docker logs -t --tail 200 $upstream_container_name + exit 1 +fi