NUBIC / aker

A flexible security framework for Rack (and Rails) apps. Good for integration with legacy systems, CAS SSO (including proxying), machine and interactive authentication, and much more.
MIT License
1 stars 2 forks source link

Decouple CAS process management from integration tests #31

Closed hannahwhy closed 11 years ago

hannahwhy commented 11 years ago

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 https://github.com/NUBIC/aker/pull/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.

hannahwhy commented 11 years ago

I have run this new configuration using

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 commented 11 years ago

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 commented 11 years ago

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 commented 11 years ago

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

hannahwhy commented 11 years ago

Alright, I'll merge this.

hannahwhy commented 11 years ago

Hey, neat:

https://public-ci.nubic.northwestern.edu/job/Aker/877/

rsutphin commented 11 years ago

Nice work.