KEYCLOAK-5143 Run auth-server-wildfly profile on Travis (#4317)
This commit is contained in:
1 parent
286fb688eb
commit
badba7adaf
9 files changed
+162
-61
No files matched your search
+9
-16
@@ -1,33 +1,26 @@
|
|||||||
language: java
|
language: java
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
directories:
|
cache: false
|
||||||
- $HOME/.m2
|
|
||||||
|
|
||||||
before_cache:
|
|
||||||
- rm -rf $HOME/.m2/repository/org/keycloak
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
- MAVEN_SKIP_RC=true
|
- MAVEN_SKIP_RC=true
|
||||||
- MAVEN_OPTS="-Xms512m -Xmx2048m"
|
- MAVEN_OPTS="-Xms512m -Xmx1536m"
|
||||||
matrix:
|
matrix:
|
||||||
- TESTS=group1
|
- TESTS=unit
|
||||||
- TESTS=group2
|
- TESTS=server-group1
|
||||||
- TESTS=group3
|
- TESTS=server-group2
|
||||||
- TESTS=group4
|
- TESTS=server-group3
|
||||||
|
- TESTS=server-group4
|
||||||
- TESTS=old
|
- TESTS=old
|
||||||
|
|
||||||
jdk:
|
jdk:
|
||||||
- oraclejdk8
|
- oraclejdk8
|
||||||
|
|
||||||
before_script:
|
install: true
|
||||||
- export MAVEN_SKIP_RC=true
|
|
||||||
|
|
||||||
install:
|
script:
|
||||||
- travis_wait 60 mvn install --no-snapshot-updates -Pdistribution -DskipTestsuite -B -V -q
|
|
||||||
|
|
||||||
script:
|
|
||||||
- ./travis-run-tests.sh $TESTS
|
- ./travis-run-tests.sh $TESTS
|
||||||
|
|
||||||
sudo: false
|
sudo: false
|
||||||
@@ -30,6 +30,14 @@
|
|||||||
<artifactId>integration-arquillian-servers-auth-server-wildfly</artifactId>
|
<artifactId>integration-arquillian-servers-auth-server-wildfly</artifactId>
|
||||||
|
|
||||||
<name>Auth Server - JBoss - Wildfly</name>
|
<name>Auth Server - JBoss - Wildfly</name>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.keycloak</groupId>
|
||||||
|
<artifactId>keycloak-server-dist</artifactId>
|
||||||
|
<type>zip</type>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<auth.server.jboss>wildfly</auth.server.jboss>
|
<auth.server.jboss>wildfly</auth.server.jboss>
|
||||||
|
|||||||
+15
-10
@@ -42,6 +42,7 @@ import org.keycloak.representations.idm.RealmRepresentation;
|
|||||||
import org.keycloak.testsuite.AbstractKeycloakTest;
|
import org.keycloak.testsuite.AbstractKeycloakTest;
|
||||||
import org.keycloak.testsuite.ActionURIUtils;
|
import org.keycloak.testsuite.ActionURIUtils;
|
||||||
import org.keycloak.testsuite.runonserver.RunOnServerDeployment;
|
import org.keycloak.testsuite.runonserver.RunOnServerDeployment;
|
||||||
|
import org.keycloak.testsuite.runonserver.ServerVersion;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
@@ -63,7 +64,7 @@ public class LoginStatusIframeEndpointTest extends AbstractKeycloakTest {
|
|||||||
|
|
||||||
@Deployment
|
@Deployment
|
||||||
public static WebArchive deploy() {
|
public static WebArchive deploy() {
|
||||||
return RunOnServerDeployment.create(LoginStatusIframeEndpointTest.class);
|
return RunOnServerDeployment.create(LoginStatusIframeEndpointTest.class, ServerVersion.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -197,20 +198,24 @@ public class LoginStatusIframeEndpointTest extends AbstractKeycloakTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void checkIframeCache() throws IOException {
|
public void checkIframeCache() throws IOException {
|
||||||
String version = testingClient.server().fetch(session -> Version.RESOURCES_VERSION, String.class);
|
String version = testingClient.server().fetch(new ServerVersion());
|
||||||
|
|
||||||
CloseableHttpClient client = HttpClients.createDefault();
|
CloseableHttpClient client = HttpClients.createDefault();
|
||||||
HttpGet get = new HttpGet(suiteContext.getAuthServerInfo().getContextRoot() + "/auth/realms/master/protocol/openid-connect/login-status-iframe.html");
|
try {
|
||||||
CloseableHttpResponse response = client.execute(get);
|
HttpGet get = new HttpGet(suiteContext.getAuthServerInfo().getContextRoot() + "/auth/realms/master/protocol/openid-connect/login-status-iframe.html");
|
||||||
|
CloseableHttpResponse response = client.execute(get);
|
||||||
|
|
||||||
assertEquals(200, response.getStatusLine().getStatusCode());
|
assertEquals(200, response.getStatusLine().getStatusCode());
|
||||||
assertEquals("no-cache, must-revalidate, no-transform, no-store", response.getHeaders("Cache-Control")[0].getValue());
|
assertEquals("no-cache, must-revalidate, no-transform, no-store", response.getHeaders("Cache-Control")[0].getValue());
|
||||||
|
|
||||||
get = new HttpGet(suiteContext.getAuthServerInfo().getContextRoot() + "/auth/realms/master/protocol/openid-connect/login-status-iframe.html?version=" + version);
|
get = new HttpGet(suiteContext.getAuthServerInfo().getContextRoot() + "/auth/realms/master/protocol/openid-connect/login-status-iframe.html?version=" + version);
|
||||||
response = client.execute(get);
|
response = client.execute(get);
|
||||||
|
|
||||||
assertEquals(200, response.getStatusLine().getStatusCode());
|
assertEquals(200, response.getStatusLine().getStatusCode());
|
||||||
assertTrue(response.getHeaders("Cache-Control")[0].getValue().contains("max-age"));
|
assertTrue(response.getHeaders("Cache-Control")[0].getValue().contains("max-age"));
|
||||||
|
} finally {
|
||||||
|
client.close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+22
@@ -0,0 +1,22 @@
|
|||||||
|
package org.keycloak.testsuite.runonserver;
|
||||||
|
|
||||||
|
import org.keycloak.common.Version;
|
||||||
|
import org.keycloak.models.utils.ModelToRepresentation;
|
||||||
|
import org.keycloak.representations.idm.ComponentRepresentation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by st on 26.01.17.
|
||||||
|
*/
|
||||||
|
public class ServerVersion implements FetchOnServerWrapper<String> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FetchOnServer getRunOnServer() {
|
||||||
|
return (FetchOnServer) session -> Version.RESOURCES_VERSION;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<String> getResultClass() {
|
||||||
|
return String.class;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -21,21 +21,15 @@ log4j.appender.keycloak=org.apache.log4j.ConsoleAppender
|
|||||||
log4j.appender.keycloak.layout=org.apache.log4j.PatternLayout
|
log4j.appender.keycloak.layout=org.apache.log4j.PatternLayout
|
||||||
log4j.appender.keycloak.layout.ConversionPattern=%d{HH:mm:ss,SSS} %-5p [%c] %m%n
|
log4j.appender.keycloak.layout.ConversionPattern=%d{HH:mm:ss,SSS} %-5p [%c] %m%n
|
||||||
|
|
||||||
log4j.appender.testsuite=org.apache.log4j.ConsoleAppender
|
|
||||||
log4j.appender.testsuite.layout=org.apache.log4j.PatternLayout
|
|
||||||
log4j.appender.testsuite.layout.ConversionPattern=%d{HH:mm:ss,SSS} %-5p [%C{1}] %m%n
|
|
||||||
|
|
||||||
# Logging with "info" when running test from IDE, but disabled when running test with "mvn" . Both cases can be overriden by use system property "keycloak.logging.level" (eg. -Dkeycloak.logging.level=debug )
|
# Logging with "info" when running test from IDE, but disabled when running test with "mvn" . Both cases can be overriden by use system property "keycloak.logging.level" (eg. -Dkeycloak.logging.level=debug )
|
||||||
keycloak.logging.level=info
|
log4j.logger.org.keycloak=${keycloak.logging.level:info}
|
||||||
log4j.logger.org.keycloak=${keycloak.logging.level}
|
|
||||||
|
|
||||||
log4j.logger.org.jboss.resteasy.resteasy_jaxrs.i18n=off
|
log4j.logger.org.jboss.resteasy.resteasy_jaxrs.i18n=off
|
||||||
|
|
||||||
#log4j.logger.org.keycloak.keys.DefaultKeyManager=trace
|
#log4j.logger.org.keycloak.keys.DefaultKeyManager=trace
|
||||||
#log4j.logger.org.keycloak.services.managers.AuthenticationManager=trace
|
#log4j.logger.org.keycloak.services.managers.AuthenticationManager=trace
|
||||||
|
|
||||||
log4j.logger.org.keycloak.testsuite=debug, testsuite
|
log4j.logger.org.keycloak.testsuite=${keycloak.testsuite.logging.level:debug}
|
||||||
log4j.additivity.org.keycloak.testsuite=false
|
|
||||||
|
|
||||||
# Enable to view events
|
# Enable to view events
|
||||||
# log4j.logger.org.keycloak.events=debug
|
# log4j.logger.org.keycloak.events=debug
|
||||||
|
|||||||
@@ -53,6 +53,7 @@
|
|||||||
<module>integration</module>
|
<module>integration</module>
|
||||||
<module>tomcat8</module>
|
<module>tomcat8</module>
|
||||||
<module>integration-arquillian</module>
|
<module>integration-arquillian</module>
|
||||||
|
<module>utils</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<profiles>
|
<profiles>
|
||||||
|
|||||||
Executable
+36
@@ -0,0 +1,36 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<!--
|
||||||
|
~ Copyright 2016 Red Hat, Inc. and/or its affiliates
|
||||||
|
~ and other contributors as indicated by the @author tags.
|
||||||
|
~
|
||||||
|
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
~ you may not use this file except in compliance with the License.
|
||||||
|
~ You may obtain a copy of the License at
|
||||||
|
~
|
||||||
|
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
~
|
||||||
|
~ Unless required by applicable law or agreed to in writing, software
|
||||||
|
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
~ See the License for the specific language governing permissions and
|
||||||
|
~ limitations under the License.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||||
|
<parent>
|
||||||
|
<artifactId>keycloak-testsuite-pom</artifactId>
|
||||||
|
<groupId>org.keycloak</groupId>
|
||||||
|
<version>3.3.0.CR1-SNAPSHOT</version>
|
||||||
|
</parent>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<artifactId>keycloak-testsuite-utils</artifactId>
|
||||||
|
<name>Keycloak TestSuite Utils</name>
|
||||||
|
<description />
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.target>1.8</maven.compiler.target>
|
||||||
|
<maven.compiler.source>1.8</maven.compiler.source>
|
||||||
|
</properties>
|
||||||
|
</project>
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package org.keycloak.testsuite;
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by st on 03/07/17.
|
||||||
|
*/
|
||||||
|
public class LogTrimmer {
|
||||||
|
|
||||||
|
public static void main(String[] args) throws IOException {
|
||||||
|
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
|
||||||
|
String testRunning = null;
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
for(String l = br.readLine(); l != null; l = br.readLine()) {
|
||||||
|
if (testRunning == null) {
|
||||||
|
if (l.startsWith("Running")) {
|
||||||
|
testRunning = l.split(" ")[1];
|
||||||
|
System.out.println(l);
|
||||||
|
} else {
|
||||||
|
System.out.println("-- " + l);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (l.contains("Tests run:")) {
|
||||||
|
if (!(l.contains("Failures: 0") && l.contains("Errors: 0"))) {
|
||||||
|
System.out.println("--------- " + testRunning + " output start ---------");
|
||||||
|
System.out.println(sb.toString());
|
||||||
|
System.out.println("--------- " + testRunning + " output end ---------");
|
||||||
|
}
|
||||||
|
System.out.println(l);
|
||||||
|
|
||||||
|
|
||||||
|
testRunning = null;
|
||||||
|
sb = new StringBuilder();
|
||||||
|
} else {
|
||||||
|
sb.append(testRunning.substring(testRunning.lastIndexOf('.') + 1) + " ++ " + l);
|
||||||
|
sb.append("\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+25
-27
@@ -1,42 +1,40 @@
|
|||||||
#!/bin/bash -e
|
#!/bin/bash -e
|
||||||
|
|
||||||
mvn install --no-snapshot-updates -DskipTests=true -f testsuite
|
function run-server-tests {
|
||||||
|
cd testsuite/integration-arquillian
|
||||||
|
mvn install -B -nsu -Pauth-server-wildfly -DskipTests
|
||||||
|
|
||||||
|
cd tests/base
|
||||||
|
mvn test -B -nsu -Pauth-server-wildfly -Dtest=$1 2>&1 | java -cp ../../../utils/target/classes org.keycloak.testsuite.LogTrimmer
|
||||||
|
exit ${PIPESTATUS[0]}
|
||||||
|
}
|
||||||
|
|
||||||
|
mvn install -B -nsu -Pdistribution -DskipTests -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
|
||||||
|
|
||||||
if [ $1 == "old" ]; then
|
if [ $1 == "old" ]; then
|
||||||
mvn test -B --no-snapshot-updates -f testsuite/integration
|
cd testsuite
|
||||||
mvn test -B --no-snapshot-updates -f testsuite/jetty
|
mvn test -B -nsu -f integration
|
||||||
mvn test -B --no-snapshot-updates -f testsuite/tomcat6
|
mvn test -B -nsu -f jetty
|
||||||
mvn test -B --no-snapshot-updates -f testsuite/tomcat7
|
mvn test -B -nsu -f tomcat7
|
||||||
mvn test -B --no-snapshot-updates -f testsuite/tomcat8
|
mvn test -B -nsu -f tomcat8
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $1 == "group1" ]; then
|
if [ $1 == "unit" ]; then
|
||||||
cd testsuite/integration-arquillian/tests/base
|
mvn -B test -DskipTestsuite
|
||||||
mvn test -B --no-snapshot-updates -Dtest=org.keycloak.testsuite.ad*.**.*Test
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $1 == "group2" ]; then
|
if [ $1 == "server-group1" ]; then
|
||||||
cd testsuite/integration-arquillian/tests/base
|
run-server-tests org.keycloak.testsuite.ad*.**.*Test,!**/adapter/undertow/**/*Test
|
||||||
mvn test -B --no-snapshot-updates -Dtest=org.keycloak.testsuite.ac*.**.*Test,org.keycloak.testsuite.b*.**.*Test,org.keycloak.testsuite.cli*.**.*Test,org.keycloak.testsuite.co*.**.*Test
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $1 == "group3" ]; then
|
if [ $1 == "server-group2" ]; then
|
||||||
cd testsuite/integration-arquillian/tests/base
|
run-server-tests org.keycloak.testsuite.ac*.**.*Test,org.keycloak.testsuite.b*.**.*Test,org.keycloak.testsuite.cli*.**.*Test,org.keycloak.testsuite.co*.**.*Test
|
||||||
mvn test -B --no-snapshot-updates -Dtest=org.keycloak.testsuite.au*.**.*Test,org.keycloak.testsuite.d*.**.*Test,org.keycloak.testsuite.e*.**.*Test,org.keycloak.testsuite.f*.**.*Test,org.keycloak.testsuite.i*.**.*Test
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $1 == "group4" ]; then
|
if [ $1 == "server-group3" ]; then
|
||||||
cd testsuite/integration-arquillian/tests/base
|
run-server-tests org.keycloak.testsuite.au*.**.*Test,org.keycloak.testsuite.d*.**.*Test,org.keycloak.testsuite.e*.**.*Test,org.keycloak.testsuite.f*.**.*Test,org.keycloak.testsuite.i*.**.*Test
|
||||||
mvn test -B --no-snapshot-updates -Dtest=org.keycloak.testsuite.k*.**.*Test,org.keycloak.testsuite.m*.**.*Test,org.keycloak.testsuite.o*.**.*Test,org.keycloak.testsuite.s*.**.*Test
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $1 == "adapter" ]; then
|
if [ $1 == "server-group4" ]; then
|
||||||
cd testsuite/integration-arquillian/tests/other/adapters
|
run-server-tests org.keycloak.testsuite.k*.**.*Test,org.keycloak.testsuite.m*.**.*Test,org.keycloak.testsuite.o*.**.*Test,org.keycloak.testsuite.s*.**.*Test
|
||||||
mvn test -B --no-snapshot-updates
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $1 == "console" ]; then
|
|
||||||
cd testsuite/integration-arquillian/tests/other/console
|
|
||||||
mvn test -B --no-snapshot-updates
|
|
||||||
fi
|
|
||||||
|
|
||||||
Reference in new issue
Block a user