From a547115ca5ce85f70a62f322290af5f39de84b35 Mon Sep 17 00:00:00 2001 From: Geod24 Date: Thu, 27 Aug 2020 11:37:25 +0900 Subject: [PATCH] testsuite: Use built dub, not system one in more tests Some places were missed during the last fixups. --- test/fetchzip.sh | 18 +++++++++--------- test/issue1401-filesystem-supplier.sh | 16 ++++++++-------- test/issue1416-maven-repo-pkg-supplier.sh | 14 +++++++------- .../issue1524-maven-upgrade-dependency-tree.sh | 12 ++++++------ test/issue1567-fetch-sub-package.sh | 6 +++--- 5 files changed, 33 insertions(+), 33 deletions(-) diff --git a/test/fetchzip.sh b/test/fetchzip.sh index 214ed5e26..6d5e75592 100755 --- a/test/fetchzip.sh +++ b/test/fetchzip.sh @@ -5,23 +5,23 @@ DIR=$(dirname "${BASH_SOURCE[0]}") PORT=$(getRandomPort) -$DUB remove gitcompatibledubpackage --non-interactive 2>/dev/null || true +${DUB} remove gitcompatibledubpackage --non-interactive 2>/dev/null || true -"$DUB" build --single "$DIR"/test_registry.d +${DUB} build --single "$DIR"/test_registry.d "$DIR"/test_registry --folder="$DIR/issue1336-registry" --port=$PORT & PID=$! sleep 1 trap 'kill $PID 2>/dev/null || true' exit echo "Trying to download gitcompatibledubpackage (1.0.4)" -timeout 1s "$DUB" fetch gitcompatibledubpackage --version=1.0.4 --skip-registry=all --registry=http://localhost:$PORT +timeout 1s ${DUB} fetch gitcompatibledubpackage --version=1.0.4 --skip-registry=all --registry=http://localhost:$PORT if [ $? -eq 124 ]; then die $LINENO 'Fetching from responsive registry should not time-out.' fi -$DUB remove gitcompatibledubpackage --non-interactive --version=1.0.4 +${DUB} remove gitcompatibledubpackage --non-interactive --version=1.0.4 echo "Downloads should be retried when the zip is corrupted - gitcompatibledubpackage (1.0.3)" -zipOut=$(! timeout 1s "$DUB" fetch gitcompatibledubpackage --version=1.0.3 --skip-registry=all --registry=http://localhost:$PORT 2>&1) +zipOut=$(! timeout 1s ${DUB} fetch gitcompatibledubpackage --version=1.0.3 --skip-registry=all --registry=http://localhost:$PORT 2>&1) rc=$? if ! zipCount=$(grep -Fc 'Failed to extract zip archive' <<<"$zipOut") || [ "$zipCount" -lt 3 ] ; then @@ -32,12 +32,12 @@ if ! zipCount=$(grep -Fc 'Failed to extract zip archive' <<<"$zipOut") || [ "$zi elif [ $rc -eq 124 ]; then die $LINENO 'DUB timed out unexpectedly.' fi -if dub remove gitcompatibledubpackage --non-interactive 2>/dev/null; then +if ${DUB} remove gitcompatibledubpackage --non-interactive 2>/dev/null; then die $LINENO 'DUB should not have installed a broken package.' fi echo "HTTP status errors on downloads should be retried - gitcompatibledubpackage (1.0.2)" -retryOut=$(! timeout 1s "$DUB" fetch gitcompatibledubpackage --version=1.0.2 --skip-registry=all --registry=http://localhost:$PORT --vverbose 2>&1) +retryOut=$(! timeout 1s ${DUB} fetch gitcompatibledubpackage --version=1.0.2 --skip-registry=all --registry=http://localhost:$PORT --vverbose 2>&1) rc=$? if ! retryCount=$(echo "$retryOut" | grep -Fc 'Bad Gateway') || [ "$retryCount" -lt 3 ] ; then echo '========== +Output was ==========' >&2 @@ -47,7 +47,7 @@ if ! retryCount=$(echo "$retryOut" | grep -Fc 'Bad Gateway') || [ "$retryCount" elif [ $rc -eq 124 ]; then die $LINENO 'DUB timed out unexpectedly.' fi -if $DUB remove gitcompatibledubpackage --non-interactive 2>/dev/null; then +if ${DUB} remove gitcompatibledubpackage --non-interactive 2>/dev/null; then die $LINENO 'DUB should not have installed a package.' fi @@ -56,4 +56,4 @@ timeout 1s "$DUB" fetch gitcompatibledubpackage --version=1.0.2 --skip-registry= if [ $? -eq 124 ]; then die $LINENO 'Fetching from responsive registry should not time-out.' fi -$DUB remove gitcompatibledubpackage --non-interactive --version=1.0.2 +${DUB} remove gitcompatibledubpackage --non-interactive --version=1.0.2 diff --git a/test/issue1401-filesystem-supplier.sh b/test/issue1401-filesystem-supplier.sh index 3120392f3..9811c32df 100755 --- a/test/issue1401-filesystem-supplier.sh +++ b/test/issue1401-filesystem-supplier.sh @@ -3,26 +3,26 @@ DIR=$(dirname "${BASH_SOURCE[0]}") . "$DIR"/common.sh -dub remove fs-json-dubpackage --non-interactive 2>/dev/null || true -dub remove fs-sdl-dubpackage --non-interactive 2>/dev/null || true +${DUB} remove fs-json-dubpackage --non-interactive 2>/dev/null || true +${DUB} remove fs-sdl-dubpackage --non-interactive 2>/dev/null || true echo "Trying to get fs-sdl-dubpackage (1.0.5)" -"$DUB" fetch fs-sdl-dubpackage --version=1.0.5 --skip-registry=all --registry=file://"$DIR"/issue1401-file-system-pkg-supplier +${DUB} fetch fs-sdl-dubpackage --version=1.0.5 --skip-registry=all --registry=file://"$DIR"/issue1401-file-system-pkg-supplier -if ! dub remove fs-sdl-dubpackage --non-interactive --version=1.0.5 2>/dev/null; then +if ! ${DUB} remove fs-sdl-dubpackage --non-interactive --version=1.0.5 2>/dev/null; then die $LINENO 'DUB did not install package from file system.' fi echo "Trying to get fs-sdl-dubpackage (latest)" -"$DUB" fetch fs-sdl-dubpackage --skip-registry=all --registry=file://"$DIR"/issue1401-file-system-pkg-supplier +${DUB} fetch fs-sdl-dubpackage --skip-registry=all --registry=file://"$DIR"/issue1401-file-system-pkg-supplier -if ! dub remove fs-sdl-dubpackage --non-interactive --version=1.0.6 2>/dev/null; then +if ! ${DUB} remove fs-sdl-dubpackage --non-interactive --version=1.0.6 2>/dev/null; then die $LINENO 'DUB did not install latest package from file system.' fi echo "Trying to get fs-json-dubpackage (1.0.7)" -"$DUB" fetch fs-json-dubpackage --version=1.0.7 --skip-registry=all --registry=file://"$DIR"/issue1401-file-system-pkg-supplier +${DUB} fetch fs-json-dubpackage --version=1.0.7 --skip-registry=all --registry=file://"$DIR"/issue1401-file-system-pkg-supplier -if ! dub remove fs-json-dubpackage --non-interactive --version=1.0.7 2>/dev/null; then +if ! ${DUB} remove fs-json-dubpackage --non-interactive --version=1.0.7 2>/dev/null; then die $LINENO 'DUB did not install package from file system.' fi diff --git a/test/issue1416-maven-repo-pkg-supplier.sh b/test/issue1416-maven-repo-pkg-supplier.sh index 7771e81e7..4e0b32d1d 100755 --- a/test/issue1416-maven-repo-pkg-supplier.sh +++ b/test/issue1416-maven-repo-pkg-supplier.sh @@ -5,27 +5,27 @@ DIR=$(dirname "${BASH_SOURCE[0]}") PORT=$(getRandomPort) -$DUB remove maven-dubpackage --non-interactive 2>/dev/null || true +${DUB} remove maven-dubpackage --non-interactive 2>/dev/null || true -"$DUB" build --single "$DIR"/test_registry.d +${DUB} build --single "$DIR"/test_registry.d "$DIR"/test_registry --folder="$DIR/issue1416-maven-repo-pkg-supplier" --port=$PORT & PID=$! sleep 1 trap 'kill $PID 2>/dev/null || true' exit echo "Trying to download maven-dubpackage (1.0.5)" -"$DUB" fetch maven-dubpackage --version=1.0.5 --skip-registry=all --registry=mvn+http://localhost:$PORT/maven/release/dubpackages +${DUB} fetch maven-dubpackage --version=1.0.5 --skip-registry=all --registry=mvn+http://localhost:$PORT/maven/release/dubpackages -if ! dub remove maven-dubpackage --non-interactive --version=1.0.5 2>/dev/null; then +if ! ${DUB} remove maven-dubpackage --non-interactive --version=1.0.5 2>/dev/null; then die $LINENO 'DUB did not install package from maven registry.' fi echo "Trying to download maven-dubpackage (latest)" -"$DUB" fetch maven-dubpackage --skip-registry=all --registry=mvn+http://localhost:$PORT/maven/release/dubpackages +${DUB} fetch maven-dubpackage --skip-registry=all --registry=mvn+http://localhost:$PORT/maven/release/dubpackages -if ! dub remove maven-dubpackage --non-interactive --version=1.0.6 2>/dev/null; then +if ! ${DUB} remove maven-dubpackage --non-interactive --version=1.0.6 2>/dev/null; then die $LINENO 'DUB fetch did not install latest package from maven registry.' fi echo "Trying to search (exact) maven-dubpackage" -"$DUB" search maven-dubpackage --skip-registry=all --registry=mvn+http://localhost:$PORT/maven/release/dubpackages | grep -c "maven-dubpackage (1.0.6)" +${DUB} search maven-dubpackage --skip-registry=all --registry=mvn+http://localhost:$PORT/maven/release/dubpackages | grep -c "maven-dubpackage (1.0.6)" diff --git a/test/issue1524-maven-upgrade-dependency-tree.sh b/test/issue1524-maven-upgrade-dependency-tree.sh index 8cd64743a..a8b2c32b6 100755 --- a/test/issue1524-maven-upgrade-dependency-tree.sh +++ b/test/issue1524-maven-upgrade-dependency-tree.sh @@ -5,23 +5,23 @@ DIR=$(dirname "${BASH_SOURCE[0]}") PORT=$(getRandomPort) -dub remove maven-dubpackage-a --non-interactive 2>/dev/null || true -dub remove maven-dubpackage-b --non-interactive 2>/dev/null || true +${DUB} remove maven-dubpackage-a --non-interactive 2>/dev/null || true +${DUB} remove maven-dubpackage-b --non-interactive 2>/dev/null || true -"$DUB" build --single "$DIR"/test_registry.d +${DUB} build --single "$DIR"/test_registry.d "$DIR"/test_registry --folder="$DIR/issue1524-maven-upgrade-dependency-tree" --port=$PORT & PID=$! sleep 1 trap 'kill $PID 2>/dev/null || true' exit echo "Trying to download maven-dubpackage-a (1.0.5) with dependency to maven-dubpackage-b (1.0.6)" -"$DUB" upgrade --root "$DIR/issue1524-maven-upgrade-dependency-tree" --skip-registry=standard --registry=mvn+http://localhost:$PORT/maven/release/dubpackages +${DUB} upgrade --root "$DIR/issue1524-maven-upgrade-dependency-tree" --skip-registry=standard --registry=mvn+http://localhost:$PORT/maven/release/dubpackages -if ! dub remove maven-dubpackage-a --non-interactive --version=1.0.5 2>/dev/null; then +if ! ${DUB} remove maven-dubpackage-a --non-interactive --version=1.0.5 2>/dev/null; then die $LINENO 'DUB did not install package "maven-dubpackage-a" from maven registry.' fi -if ! dub remove maven-dubpackage-b --non-interactive --version=1.0.6 2>/dev/null; then +if ! ${DUB} remove maven-dubpackage-b --non-interactive --version=1.0.6 2>/dev/null; then die $LINENO 'DUB did not install package "maven-dubpackage-b" from maven registry.' fi diff --git a/test/issue1567-fetch-sub-package.sh b/test/issue1567-fetch-sub-package.sh index e7760dfe6..544ef6394 100755 --- a/test/issue1567-fetch-sub-package.sh +++ b/test/issue1567-fetch-sub-package.sh @@ -4,9 +4,9 @@ DIR=$(dirname "${BASH_SOURCE[0]}") packname="fetch-sub-package-dubpackage" sub_packagename="my-sub-package" -$DUB remove $packname --non-interactive 2>/dev/null || true -$DUB fetch "$packname:$sub_packagename" --skip-registry=all --registry=file://"$DIR"/issue1567-fetch-sub-package +${DUB} remove $packname --non-interactive 2>/dev/null || true +${DUB} fetch "$packname:$sub_packagename" --skip-registry=all --registry=file://"$DIR"/issue1567-fetch-sub-package -if ! dub remove $packname --non-interactive --version=1.0.1 2>/dev/null; then +if ! ${DUB} remove $packname --non-interactive --version=1.0.1 2>/dev/null; then die $LINENO 'DUB did not install package $packname:$sub_packagename.' fi