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

Fixes for release_pass test #6572

Merged
merged 1 commit into from
Oct 5, 2016
Merged

Conversation

glevand
Copy link
Contributor

@glevand glevand commented Oct 3, 2016

No description provided.

@glevand glevand force-pushed the for-merge-release_pass branch 2 times, most recently from fe01dbb to 08ba05f Compare October 3, 2016 22:08
Copy link
Contributor

@heyitsanthony heyitsanthony left a 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
Copy link
Contributor

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
Copy link
Contributor

@heyitsanthony heyitsanthony Oct 3, 2016

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...

Copy link
Contributor Author

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.

Copy link
Contributor

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
Copy link
Contributor

@heyitsanthony heyitsanthony Oct 3, 2016

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

Copy link
Contributor Author

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.

Copy link
Contributor

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
Copy link
Contributor

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

Copy link
Contributor Author

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
Copy link
Contributor

@heyitsanthony heyitsanthony Oct 3, 2016

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.

Copy link
Contributor Author

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
Copy link
Contributor

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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/MACHINE_ARCH/GOARCH/ ?

@glevand glevand force-pushed the for-merge-release_pass branch from 08ba05f to 8f2c943 Compare October 4, 2016 18:15
@glevand
Copy link
Contributor Author

glevand commented Oct 4, 2016

Rebased to latest, addressed comments so far.

@heyitsanthony
Copy link
Contributor

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]>
@glevand glevand force-pushed the for-merge-release_pass branch from 8f2c943 to 25f1088 Compare October 4, 2016 20:43
@glevand
Copy link
Contributor Author

glevand commented Oct 4, 2016

Rebased to latest, squashed to a single patch.

@xiang90 xiang90 merged commit d5cd563 into etcd-io:master Oct 5, 2016
@glevand glevand deleted the for-merge-release_pass branch October 5, 2016 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants