-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
Fixes for release_pass test #6572
Conversation
fe01dbb
to
08ba05f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some simplification suggestions
@@ -33,6 +33,20 @@ TEST_PKGS=`find . -name \*_test.go | while read a; do dirname $a; done | sort | | |||
FORMATTABLE=`find . -name \*.go | while read a; do echo $(dirname $a)/"*.go"; done | sort | uniq | egrep -v "$IGNORE_PKGS" | sed "s|\./||g"` | |||
TESTABLE_AND_FORMATTABLE=`echo "$TEST_PKGS" | egrep -v "$INTEGRATION_PKGS"` | |||
|
|||
case "$(uname --machine)" in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this breaks on osx; stick with -m
esac | ||
|
||
tar xzvf /tmp/$file -C /tmp/ --strip-components=1 | ||
mkdir -p ./bin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do this? test
should always run from the etcd repo root...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I mentioned in the commit message, if you run PASSES="release" ./test
, the test will fail. This is because there is no bin directory in the etcd repo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
local file="etcd-$UPGRADE_VER-linux-$MACHINE_ARCH.tar.gz" | ||
echo "Downloading $file" | ||
|
||
set +e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why bother with this and the extra error checking? it's simpler to let the non-zero exit take down the process; the output from the curl command should be enough error output
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A curl return of 22 (file not found) is success, so we need to check for that, and then in that case just return and not run tar.
If we keep ``set e` on, then curl's return of 22 will result in test failure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
echo "Downloading $file" | ||
|
||
set +e | ||
curl --fail --progress-bar -L https://github.com/coreos/etcd/releases/download/$UPGRADE_VER/$file -o /tmp/$file 2>&1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no progress bar? it'll mess up the output when piped to a file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I can remove it. I added that to cleanup the screen output when curl returns file not found.
echo "Unknown machine" | ||
exit 255 | ||
;; | ||
esac |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this code block necessary? Listing stuff out is tedious. How about if [ -z "$GOARCH" ]; then GOARCH=$(go env GOARCH); fi
? I think treating the GOARCH as the machine arch is fine for the test script.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
RACE="--race" | ||
fi | ||
elif [ "$GOARCH" == "amd64" ]; then | ||
if [ "$GOARCH" == "amd64" ] || [[ -z "$GOARCH" && "$MACHINE_ARCH" == "amd64" ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can just be if [ "$GOARCH" == "amd64" ]; then
if you use the GOARCH suggestion
curl -L https://github.com/coreos/etcd/releases/download/$UPGRADE_VER/etcd-$UPGRADE_VER-linux-amd64.tar.gz -o /tmp/etcd-$UPGRADE_VER-linux-amd64.tar.gz | ||
tar xzvf /tmp/etcd-$UPGRADE_VER-linux-amd64.tar.gz -C /tmp/ --strip-components=1 | ||
|
||
local file="etcd-$UPGRADE_VER-linux-$MACHINE_ARCH.tar.gz" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/MACHINE_ARCH/GOARCH/ ?
08ba05f
to
8f2c943
Compare
Rebased to latest, addressed comments so far. |
lgtm after squashing. Thanks! |
Some fixes related to release_pass: o Create the output directory ./bin if it does not exist. o Define the GOARCH variable if it is not defined. o Simplify the race detection test. o Download the relese archive based on GOARCH. o If the release file is not found, return success. This will allow the tests to continue. Signed-off-by: Geoff Levand <[email protected]>
8f2c943
to
25f1088
Compare
Rebased to latest, squashed to a single patch. |
No description provided.