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

test(e2e): take registry logs when e2e fails #830

Merged
merged 11 commits into from
Feb 22, 2023
15 changes: 12 additions & 3 deletions test/e2e/scripts/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,28 @@ 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
ginkgo -r -p --succinct suite || test_fail=true
if [ "$test_fail" = 'true' ]; then
qweeah marked this conversation as resolved.
Show resolved Hide resolved
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