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

Decouple CAS process management from integration tests #31

Merged
merged 4 commits into from
Sep 16, 2013
Merged

Decouple CAS process management from integration tests #31

merged 4 commits into from
Sep 16, 2013

Conversation

hannahwhy
Copy link
Contributor

This PR contains an another approach to getting Aker's test suite running in ActiveSupport 4.0 (and better future-proofing it). My previous approach was #30; it should be ignored.

This approach uses a pair of URL generation programs to set ports for all test-related services. These generated URLs are paired with tasks to start a CAS callback and server manager. Finally, the CI script has been changed to download, start, and stop CAS servers.

David Yip added 2 commits September 11, 2013 13:11
Credentials are pairs (username, password).  Valid credentials are those
in which username == password.

This intentionally coincides with Jasig CAS Server's test mode.
@hannahwhy
Copy link
Contributor Author

I have run this new configuration using

  • CI_RUBY=1.9.3 ACTIVESUPPORT_VERSION=as_3.2
  • CI_RUBY=2.0.0 ACTIVESUPPORT_VERSION=as_4.0

Both test suite runs passed.

CI_RUBY=jruby ACTIVESUPPORT_VERSION=as_4.0 had one error:

SSL_connect SYSCALL returned=5 errno=0 state=SSLv3 read finished A (OpenSSL::SSL::SSLError)
/Users/dwy870/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:918:in `connect'
/Users/dwy870/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:918:in `block in connect'
/Users/dwy870/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/timeout.rb:52:in `timeout'
/Users/dwy870/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:918:in `connect'
/Users/dwy870/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:862:in `do_start'
/Users/dwy870/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:857:in `start'
./features/support/mechanize_test.rb:35:in `/^I have logged into CAS using "([^\"]*)" \/ "([^\"]*)"$/'
features/cas.feature:56:in `Given I have logged into CAS using "mr296" / "mr296"'

I don't know if this is related to the changes in this PR.

@hannahwhy
Copy link
Contributor Author

Strike that. Looks like I wasn't using JRuby after all for that test run. Actually using JRuby results in this:

rake aborted!
wrong exec option: [:out, :err]

I keep forgetting that mucking about in Process is dangerous territory when you cross the Ruby -> JRuby line. I'll look for the best workaround.

@hannahwhy
Copy link
Contributor Author

OK, now things seem to be happy (ish) on JRuby.

The spawned CAS processes still don't die when they're told to die; it looks like there's something funny with Process.spawn on JRuby. (Said processes correctly die on MRI 1.9/2.0.) We might just have to rely on Jenkins to clean up the mess for the JRuby case.

@rsutphin: any comments?

@rsutphin
Copy link
Contributor

I have not tried running it myself, but the code looks reasonable to me.

David Yip added 2 commits September 16, 2013 13:02
Also add URL generation tasks for CAS and ladle-controlled LDAP.
This doesn't really do the same thing as the previous form, and it
doesn't actually do anything in JRuby 1.7.x.

However, the [:out, :err] => "/dev/null" form causes a program abort in
JRuby 1.7.x.  This form doesn't.
@hannahwhy
Copy link
Contributor Author

Alright, I'll merge this.

hannahwhy added a commit that referenced this pull request Sep 16, 2013
Decouple CAS process management from integration tests
@hannahwhy hannahwhy merged commit 09a3087 into NUBIC:master Sep 16, 2013
@hannahwhy hannahwhy deleted the decouple-cas branch September 16, 2013 18:04
@hannahwhy
Copy link
Contributor Author

@rsutphin
Copy link
Contributor

Nice work.

hannahwhy pushed a commit that referenced this pull request Sep 16, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants