Skip to content

Commit

Permalink
KEYCLOAK-6796 Not able to run tests without -Pwildfly-managed
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-kanis committed Mar 21, 2018
1 parent bca91a1 commit de3bfdc
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 9 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,13 @@ static {

If you don't have access to admin's credentials, please import the `quickstart-realm.json` from `src/test/resources`.

After that run integration tests:
To run integration tests for Wildfly managed quickstarts use the following command:
```
mvn clean install -Pwildfly-managed -Denforcer.skip=true
```

If you want to run the tests for a quickstart that doesn't need Wildfly, you have to use appropriate profile. See a particular quickstart's README for more details.



Examples
Expand Down
2 changes: 1 addition & 1 deletion app-authz-rest-springboot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,4 @@ Integration test of the Quickstart
1. Make sure you have an Keycloak server running with an admin user in the `master` realm or use the provided docker image
2. Be sure to set the `TestHelper.keycloakBaseUrl` in the `createArchive` method (default URL is localhost:8180/auth).
3. Set accordingly the correct url for the `keycloak.auth-server-url` in the test [application.properties](src/test/resources/application.properties).
4. Run `mvn test`
4. Run `mvn test -Pspring-boot`
2 changes: 1 addition & 1 deletion app-authz-springboot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,4 @@ Integration test of the Quickstart
1. Make sure you have an <span>Keycloak</span> server running with an admin user in the `master` realm or use the provided docker image
2. Be sure to set the `TestHelper.keycloakBaseUrl` in the `createArchive` method (default URL is localhost:8180/auth).
3. Set accordingly the correct url for the `keycloak.auth-server-url` in the test [application.properties](src/test/resources/application.properties).
4. Run `mvn test`
4. Run `mvn test -Pspring-boot`
2 changes: 1 addition & 1 deletion app-springboot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,4 @@ Integration test of the Quickstart
2. Be sure to set the `TestHelper.keycloakBaseUrl` in the `createArchive` method (default URL is localhost:8180/auth).
3. Set accordingly the correct url for the `keycloak.auth-server-url` in the test [application.properties](src/test/resources/application.properties).
4. Maker sure the [service-springboot-rest](../service-springboot-rest) is running
4. Run `mvn test`
4. Run `mvn test -Pspring-boot`
28 changes: 28 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,34 @@
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${version.surefire.plugin}</version>
<configuration>
<redirectTestOutputToFile>false</redirectTestOutputToFile>
<skipTests>false</skipTests>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<!-- Springboot profile -->
<profile>
<id>spring-boot</id>
<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${version.surefire.plugin}</version>
<configuration>
<redirectTestOutputToFile>false</redirectTestOutputToFile>
<skipTests>false</skipTests>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
2 changes: 1 addition & 1 deletion service-springboot-rest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,5 @@ Integration test of the Quickstart
1. Make sure you have an <span>Keycloak</span> server running with an admin user in the `master` realm or use the provided docker image
2. Be sure to set the `TestHelper.keycloakBaseUrl` in the `createArchive` method (default URL is localhost:8180/auth).
3. Set accordingly the correct url for the `keycloak.auth-server-url` in the test [application.properties](src/test/resources/application.properties).
4. Run `mvn test`
4. Run `mvn test -Pspring-boot`

8 changes: 4 additions & 4 deletions travis-run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ if [ $1 == "group3" ]; then
fi

if [ $1 == "group4" ]; then
cd app-authz-springboot && mvn -B -s ../maven-settings.xml clean test
cd app-authz-rest-springboot && mvn -B -s ../maven-settings.xml clean test
cd ../service-springboot-rest && mvn -B -s ../maven-settings.xml clean test
cd app-authz-springboot && mvn -B -s ../maven-settings.xml clean test -Pspring-boot
cd app-authz-rest-springboot && mvn -B -s ../maven-settings.xml clean test -Pspring-boot
cd ../service-springboot-rest && mvn -B -s ../maven-settings.xml clean test -Pspring-boot
mvn spring-boot:run&
cd ../app-springboot
mvn -B -s ../maven-settings.xml clean test
mvn -B -s ../maven-settings.xml clean test -Pspring-boot
fi

if [ $1 == "group5" ]; then
Expand Down

0 comments on commit de3bfdc

Please sign in to comment.