Closed slick666 closed 6 years ago
Heya @slick666
This repo is missing a couple of key files to allow the wrapper to work out of the box (as I'm guessing you noticed seeing you got as far as you did). But from what I can figure it's meant to be a grails 3.1.9 project. So based on that I did the following to get it building after a fresh clone (on master branch):
/tmp/grskel
/tmp/grails-spring-security-saml
) remove the gradle
dir/tmp/grskel/gradle
dir into /tmp/grails-spring-security-saml
dir/tmp/grskel/gradle.properties
into /tmp/grails-spring-security-saml
dirAnd then with java 1.8.0_152 I was able to successfully do:
./gradlew clean
followed by./gradlew build
However, with failed integration tests as I'd need to tweak it to talk to my IdP etc. But at least the tests run with no compilation errors.
P.S. And seeing you mention you're new to grails, an easy way to swap between versions (to create the skeleton project for example) is to use SDK man.
P.S.S. Ideally all these files would be in the project, and I see that the fork over at https://github.com/valentingoebel/grails-spring-security-saml/tree/mainlining is doing that (or along those lines).
Further to the above, yes those are a collection of stubbed tests auto generated by grails.
Once we've got the 3.3.x support (see #12) going I'm going to attempt to tidy up the tests.
Take a look at http://docs.grails.org/latest/guide/testing.html#unitTesting
You can add this dependency in build.gradle as a temporary measure:
testCompile "org.grails:grails-test-mixins:3.3.0.RC1"
The tests are able to run but a large number of them are failing.
A long term solution is to convert the tests by following this guide:
https://testing.grails.org/latest/guide/index.html
Key changes:
@TestFor(X)
is now implements ControllerUnitTest<X>
@Mock(X)
is now DomainUnitTest<X>
Turns out this issue even a bit more fun. The tests not only need to be updated to use the new framework, they also need to be converted from jUnit to Spock.
Anyway, with commit 56485a7 the unit tests now compile. Now working through conversion from jUnit.
Did you migrate the integration test?
SpringSamlUserDetailsServiceIntegrationSpec fails to compile for me.
Heya @valentingoebel ,
Not yet, still going - slowed down due to Easter and work bits. But I think I should be able to hammer this down in the next day or so. Progress can be seen on the branch at:
https://github.com/jeffwils/grails-spring-security-saml/tree/issue_14_upgrade_tests
Almost got the unit tests down, just three test failures to fix then I'll jump on the integration tests. But yes integration tests still failing compilation at the moment.
Alright, this has been an insightful process. As a number of tests were failing in odd ways, and it was also interesting all the tests were still jUnit - even though Spock came in around about grails 2.2.
Turns out a lot of this is still the original code from: https://grails.org/plugin/spring-security-saml
Then tweaks have been made over time, and the tests have fallen behind. So where tests have failed, I've fixed them to match the current code - as considering people are using this plugin, we have the assume that's now the way it should work.
Please see PR #30 .
Tests are now all working again on master
. Simply:
./gradlew clean check
And all should pass.
Closing ticket.
Hey All,
I'm new to grails, gradle, so I apologize if this issue is off base. I ran into errors simply cloning and building the plugin
$ ./gradlew clean build
The first round or errors all came from the director below
https://github.com/jeffwils/grails-spring-security-saml/tree/master/src/test/groovy/test
All of these tests seem to be stubbed out tests that don't do anything. After removing that entire directory I got real errors from the rest of the errors but I'm thinking these are all part of a simple environment setting or something simple. I'm hoping someone here will have worked through this before.
Please let me know your thoughts on this issue I suspect it's something simple on my end.
Cheers Landon