-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
adds prompt for version script and a little more documentation #1729
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,10 +74,15 @@ Run a single test | |
`$ rake test TEST=path/to/test.rb TESTOPTS="--name=test_something"` | ||
|
||
Run tests against different Rails versions by setting the RAILS_VERSION variable | ||
and bundling gems. | ||
and bundling gems. (save this script somewhere executable and run from top of AMS repository) | ||
|
||
```bash | ||
for version in 4.0 4.1 4.2 master; do | ||
#!/usr/bin/env bash | ||
|
||
rcommand='puts YAML.load_file("./.travis.yml")["env"]["matrix"].join(" ").gsub("RAILS_VERSION=", "")' | ||
versions=$(ruby -ryaml -e "$rcommand") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @bf4 looking up versions based on your yml suggestion |
||
|
||
for version in ${versions[@]}; do | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @cgmckeever I am envious of your bash skills. I've never seen that and it is awesome |
||
export RAILS_VERSION="$version" | ||
rm -f Gemfile.lock | ||
bundle check || bundle --local || bundle | ||
|
@@ -88,7 +93,12 @@ for version in 4.0 4.1 4.2 master; do | |
else | ||
# red in ANSI | ||
echo -e "\033[31m **** Tests failed against Rails ${RAILS_VERSION} **** \033[0m" | ||
fi | ||
read -p '[Enter] any key to continue, [q] to quit...' prompt | ||
if [ "$prompt" = 'q' ]; then | ||
unset RAILS_VERSION | ||
exit 1 | ||
fi | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @remear totally understand your thoughts on leaving this auto-pilot. My only counter argument is, that this script is really nice to get a new contributor going - and jumping on errors right away (for me) was nice. As an experienced contributor, you probably have some more advanced tools in your belt (ie wwtd)) and/or can just comment out L96 to skip the prompt. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. agreed. but if we make it too nice, then it should just go in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought about this, but wasnt sure about a script floating around a gem, so I just left it in the docs |
||
fi | ||
unset RAILS_VERSION | ||
done | ||
``` | ||
|
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.
nice. I just wrote this as something to paste into the console.
I think a better solution to recommend something more robust would be to recommend using wwtd and just use the current Ruby
wwtd --local
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.
Dont know much about WWTD .... I was originally gonna run it in the console, but found it simpler just to
../ams_tester.sh
and bail out when something crapped out 😩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.
for example, this script is now out of date since we don't run on 4.0 anymore. wwtd just using the travis file as a source of truth. you could, of course do something like
ruby -ryaml -e 'puts YAML.load_file("./.travis.yml")["env"]["matrix"].join(" ")'
instead to make the listThere 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.
wwtd sounds like a great idea. Also, pulling the versions from .travis.yml would be very nice.
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.
can we make this even easier?