Various improvements to the testing shell scripts#1368
Open
wilzbach wants to merge 4 commits intodlang:masterfrom
Open
Various improvements to the testing shell scripts#1368wilzbach wants to merge 4 commits intodlang:masterfrom
wilzbach wants to merge 4 commits intodlang:masterfrom
Conversation
Collaborator
|
Thanks for your pull request, @wilzbach! |
Member
|
Your first commit seems to have some merge problems (note the 2 re-arranged if-then-s): diff --git test/fetchzip.sh test/fetchzip.sh
index 723e698..4bbac58 100755
--- test/fetchzip.sh
+++ test/fetchzip.sh
@@ -5,7 +5,7 @@ DIR=$(dirname "${BASH_SOURCE[0]}")
PORT=$(($$ + 1024)) # PID + 1024
-dub remove gitcompatibledubpackage --non-interactive --version=* 2>/dev/null || true
+"$DUB" remove gitcompatibledubpackage --non-interactive --version=* 2>/dev/null || true
"$DUB" build --single "$DIR"/test_registry.d
"$DIR"/test_registry --folder="$DIR/issue1336-registry" --port=$PORT &
@@ -18,7 +18,7 @@ timeout 1s "$DUB" fetch gitcompatibledubpackage --version=1.0.4 --skip-registry=
if [ $? -eq 124 ]; then
die '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)
@@ -32,8 +32,8 @@ if ! zipCount=$(grep -Fc 'Failed to extract zip archive' <<<"$zipOut") || [ "$zi
elif [ $rc -eq 124 ]; then
die 'DUB timed out unexpectedly.'
fi
-if dub remove gitcompatibledubpackage --non-interactive --version=* 2>/dev/null; then
die 'DUB should not have installed a broken package.'
+if "$DUB" remove gitcompatibledubpackage --non-interactive --version=* 2>/dev/null; then
fi
echo "HTTP status errors on downloads should be retried - gitcompatibledubpackage (1.0.2)"
@@ -47,8 +47,8 @@ if ! retryCount=$(echo "$retryOut" | grep -Fc 'Bad Gateway') || [ "$retryCount"
elif [ $rc -eq 124 ]; then
die 'DUB timed out unexpectedly.'
fi
-if dub remove gitcompatibledubpackage --non-interactive --version=* 2>/dev/null; then
die 'DUB should not have installed a package.'
+if "$DUB" remove gitcompatibledubpackage --non-interactive --version=* 2>/dev/null; then
fi
echo "HTTP status errors on downloads should retry with fallback mirror - gitcompatibledubpackage (1.0.2)"
@@ -56,4 +56,4 @@ timeout 1s "$DUB" fetch gitcompatibledubpackage --version=1.0.2 --skip-registry=
if [ $? -eq 124 ]; then
die '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
Fixed: diff --git test/fetchzip.sh test/fetchzip.sh
index 4bbac58..6839a44 100755
--- test/fetchzip.sh
+++ test/fetchzip.sh
@@ -32,8 +32,8 @@ if ! zipCount=$(grep -Fc 'Failed to extract zip archive' <<<"$zipOut") || [ "$zi
elif [ $rc -eq 124 ]; then
die 'DUB timed out unexpectedly.'
fi
- die 'DUB should not have installed a broken package.'
if "$DUB" remove gitcompatibledubpackage --non-interactive --version=* 2>/dev/null; then
+ die 'DUB should not have installed a broken package.'
fi
echo "HTTP status errors on downloads should be retried - gitcompatibledubpackage (1.0.2)"
@@ -47,8 +47,8 @@ if ! retryCount=$(echo "$retryOut" | grep -Fc 'Bad Gateway') || [ "$retryCount"
elif [ $rc -eq 124 ]; then
die 'DUB timed out unexpectedly.'
fi
- die 'DUB should not have installed a package.'
if "$DUB" remove gitcompatibledubpackage --non-interactive --version=* 2>/dev/null; then
+ die 'DUB should not have installed a package.'
fi
echo "HTTP status errors on downloads should retry with fallback mirror - gitcompatibledubpackage (1.0.2)"And rebased. |
6eaa1c3 to
e02f89d
Compare
Member
|
I have resolved the merge conflicts (more like redid the PR from the beginning 😄 ) and I will push an update soon |
e02f89d to
7ab6c02
Compare
0babc44 to
8367462
Compare
36641fe to
36ad3b2
Compare
* Add comments to the script * Print information on the detected HOST_DUB and DC env variables
36ad3b2 to
2f9101b
Compare
Geod24
reviewed
Nov 27, 2020
Member
Geod24
left a comment
There was a problem hiding this comment.
Looks about right, just a few nits / questions
| } | ||
|
|
||
| if [ "$COVERAGE" = true ]; then | ||
| if [ "${COVERAGE:-}" = true ]; then |
Member
There was a problem hiding this comment.
You don't need the quotes then, do you ?
| ## Here the `COVERAGE` variable is abused for this purpose, | ||
| ## as it's only defined once in the whole Travis matrix | ||
| if [ "$COVERAGE" = true ]; then | ||
| if [ "${COVERAGE:-}" = true ]; then |
Comment on lines
+13
to
+15
| export HOST_DUB | ||
| HOST_DUB="$(command -v dub)" || | ||
| { echo >&2 "[ERROR] 'dub' should be available"; exit 1; } |
| hash -p /dev/null/dub dub | ||
|
|
||
| # 2/3 Verify that both 'dub' and "$DUB" are not available: | ||
| dub > /dev/null 2>&1 || command -v "${DUB:-}" >/dev/null && \ |
|
|
||
| # 2/3 Verify that both 'dub' and "$DUB" are not available: | ||
| dub > /dev/null 2>&1 || command -v "${DUB:-}" >/dev/null && \ | ||
| { echo >&2 "[ERROR] 'dub' shouldn't be available"; exit 1; } |
Member
There was a problem hiding this comment.
shouldn't be available "anymore" ?
Otherwise the error message might be confusing.
| HOST_DUB="$(command -v dub)" || | ||
| { echo >&2 "[ERROR] 'dub' should be available"; exit 1; } | ||
| unset DUB | ||
| hash -p /dev/null/dub dub |
Member
There was a problem hiding this comment.
I've no idea what this does. Do you have a link for me ?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See also: #1339
setup-dlangGitHub org name