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

adds prompt for version script and a little more documentation #1729

Merged
merged 1 commit into from
May 17, 2016
Merged

adds prompt for version script and a little more documentation #1729

merged 1 commit into from
May 17, 2016

Conversation

cgmckeever
Copy link
Contributor

Purpose

Wanted to pause version tester script on failures, and allow to halt execution.

Changes

adds a read/condition to failure case

@@ -74,9 +74,11 @@ 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)
Copy link
Member

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

Copy link
Contributor Author

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 😩

Copy link
Member

@bf4 bf4 May 17, 2016

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 list

Copy link
Member

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.

Copy link
Member

Choose a reason for hiding this comment

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

(save this script somewhere executable and run from top of AMS repository)

can we make this even easier?

@NullVoxPopuli
Copy link
Contributor

LGTM!


```bash
#!/bin/bash
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps #!/usr/bin/env bash instead.

@remear
Copy link
Member

remear commented May 17, 2016

Some of my thoughts on this...

My preference would be to report failures at the end by version as I like to fire off this script and work on something else until it's finished. Maybe wwtd could do this. The prompt requires someone to sit there and acknowledge the failures before moving on to the next version. I'm not sure I'd ever bail out at such a prompt since it's been helpful in the past to know in a single run of the script that something passes on some versions and not others.

better version handling

looks up via yml
#!/usr/bin/env bash

rcommand='puts YAML.load_file("./.travis.yml")["env"]["matrix"].join(" ").gsub("RAILS_VERSION=", "")'
versions=$(ruby -ryaml -e "$rcommand")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bf4 looking up versions based on your yml suggestion

@NullVoxPopuli NullVoxPopuli merged commit ec23518 into rails-api:master May 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants