Skip to content

Commit

Permalink
Reduce the verbosity of integration test logging
Browse files Browse the repository at this point in the history
Ensure that the test-logback.xml is used in the integration tests, and that we use the jul-to-slf4j bridge where appropriate

Signed-off-by: Tim Ward <timothyjward@apache.org>
  • Loading branch information
timothyjward committed Jan 31, 2024
1 parent 6a65e83 commit aa0e8fc
Show file tree
Hide file tree
Showing 25 changed files with 89 additions and 91 deletions.
4 changes: 1 addition & 3 deletions northbound/filters/ldap/integration-test.bndrun
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@

-runee: JavaSE-11
-runfw: org.apache.felix.framework

# This blacklist ensures consistent resolution locally and in CI
-runblacklist: bnd.identity;id='org.osgi.service.cm'
-runproperties: logback.configurationFile=${project.build.testOutputDirectory}/logback-test.xml

# This will help us keep -runbundles sorted
-runstartlevel: \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</encoder>
</appender>

<root level="ERROR">
<root level="INFO">
<appender-ref ref="STDOUT"/>
</root>
</configuration>
6 changes: 1 addition & 5 deletions northbound/query-handler/integration-test.bndrun
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@
bnd.identity;id='ch.qos.logback.classic'
-resolve.effective: active

# These packages are also provided by the gecko.emf.osgi.component project
# so we blacklist the API for resolve consistency
-runblacklist: bnd.identity;id='org.gecko.emf.osgi.api',\
bnd.identity;id='org.osgi.service.cm'

-runee: JavaSE-11
-runfw: org.apache.felix.framework
-runproperties: logback.configurationFile=${project.build.testOutputDirectory}/logback-test.xml

# This will help us keep -runbundles sorted
-runstartlevel: \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</encoder>
</appender>

<root level="ERROR">
<root level="INFO">
<appender-ref ref="STDOUT"/>
</root>
</configuration>
14 changes: 6 additions & 8 deletions northbound/rest/integration-test.bndrun
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,14 @@
bnd.identity;id='org.eclipse.osgitech.rest.jetty',\
bnd.identity;id='org.eclipse.parsson.jakarta.json',\
bnd.identity;id='org.eclipse.sensinact.gateway.northbound.filters.ldap',\
bnd.identity;id='ch.qos.logback.classic'
bnd.identity;id='ch.qos.logback.classic',\
bnd.identity;id='jul.to.slf4j'

-resolve.effective: active

-runee: JavaSE-11
-runfw: org.apache.felix.framework

# These packages are also provided by the gecko.emf.osgi.component project
# so we blacklist the API for resolve consistency
-runblacklist: bnd.identity;id='org.gecko.emf.osgi.api',\
bnd.identity;id='org.osgi.service.cm'
-runproperties: logback.configurationFile=${project.build.testOutputDirectory}/logback-test.xml

# This will help us keep -runbundles sorted
-runstartlevel: \
Expand All @@ -40,6 +38,7 @@
jakarta.ws.rs-api;version='[3.1.0,3.1.1)',\
jakarta.xml.bind-api;version='[4.0.0,4.0.1)',\
javassist;version='[3.29.2,3.29.3)',\
jul.to.slf4j;version='[2.0.11,2.0.12)',\
junit-jupiter-api;version='[5.10.1,5.10.2)',\
junit-jupiter-engine;version='[5.10.1,5.10.2)',\
junit-jupiter-params;version='[5.10.1,5.10.2)',\
Expand All @@ -53,16 +52,15 @@
org.apache.felix.cm.json;version='[2.0.0,2.0.1)',\
org.apache.felix.configadmin;version='[1.9.24,1.9.25)',\
org.apache.felix.configurator;version='[1.0.18,1.0.19)',\
org.apache.felix.http.jetty;version='[5.0.4,5.0.5)',\
org.apache.felix.http.servlet-api;version='[2.1.0,2.1.1)',\
org.apache.felix.scr;version='[2.2.2,2.2.3)',\
org.eclipse.emf.common;version='[2.29.0,2.29.1)',\
org.eclipse.emf.ecore;version='[2.35.0,2.35.1)',\
org.eclipse.emf.ecore.xmi;version='[2.36.0,2.36.1)',\
org.eclipse.jetty.http;version='[11.0.13,11.0.14)',\
org.eclipse.jetty.io;version='[11.0.13,11.0.14)',\
org.eclipse.jetty.security;version='[11.0.13,11.0.14)',\
org.eclipse.jetty.server;version='[11.0.13,11.0.14)',\
org.eclipse.jetty.servlet;version='[11.0.13,11.0.14)',\
org.eclipse.jetty.util;version='[11.0.13,11.0.14)',\
org.eclipse.osgitech.rest;version='[1.2.2,1.2.3)',\
org.eclipse.osgitech.rest.jetty;version='[1.2.2,1.2.3)',\
Expand Down
6 changes: 6 additions & 0 deletions northbound/rest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jul-to-slf4j</artifactId>
<version>${slf4j.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
Expand Down
6 changes: 5 additions & 1 deletion northbound/rest/src/test/resources/logback-test.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
<configuration>
<import class="ch.qos.logback.classic.jul.LevelChangePropagator"/>
<contextListener class="LevelChangePropagator">
<resetJUL>true</resetJUL>
</contextListener>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>

<root level="ERROR">
<root level="INFO">
<appender-ref ref="STDOUT"/>
</root>
</configuration>
8 changes: 2 additions & 6 deletions northbound/security/openid-connect/integration-test.bndrun
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,8 @@
-runee: JavaSE-11
-runfw: org.apache.felix.framework
-runproperties: \
org.osgi.framework.bootdelegation=org.mockito.internal.creation.bytebuddy.inject

# These packages are also provided by the gecko.emf.osgi.component project
# so we blacklist the API for resolve consistency
-runblacklist: bnd.identity;id='org.gecko.emf.osgi.api',\
bnd.identity;id='org.osgi.service.cm'
org.osgi.framework.bootdelegation=org.mockito.internal.creation.bytebuddy.inject,\
logback.configurationFile=${project.build.testOutputDirectory}/logback-test.xml

# This will help us keep -runbundles sorted
-runstartlevel: \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</encoder>
</appender>

<root level="ERROR">
<root level="INFO">
<appender-ref ref="STDOUT"/>
</root>
</configuration>
11 changes: 4 additions & 7 deletions northbound/sensorthings/mqtt/integration-test.bndrun
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,14 @@

-runrequires: \
bnd.identity;id='${project.groupId}.${project.artifactId}-tests',\
bnd.identity;id='ch.qos.logback.classic'
bnd.identity;id='ch.qos.logback.classic',\
bnd.identity;id='jul.to.slf4j'

-resolve.effective: active

# These packages are also provided by the gecko.emf.osgi.component project
# so we blacklist the API for resolve consistency
-runblacklist: bnd.identity;id='org.gecko.emf.osgi.api',\
bnd.identity;id='org.osgi.service.cm',\
bnd.identity;id='slf4j.reload4k'

-runee: JavaSE-11
-runfw: org.apache.felix.framework
-runproperties: logback.configurationFile=${project.build.testOutputDirectory}/logback-test.xml

# This will help us keep -runbundles sorted
-runstartlevel: \
Expand All @@ -38,6 +34,7 @@
io.netty.transport;version='[4.1.77,4.1.78)',\
io.netty.transport-classes-epoll;version='[4.1.77,4.1.78)',\
io.netty.transport-native-unix-common;version='[4.1.77,4.1.78)',\
jul.to.slf4j;version='[2.0.11,2.0.12)',\
junit-jupiter-api;version='[5.10.1,5.10.2)',\
junit-jupiter-engine;version='[5.10.1,5.10.2)',\
junit-jupiter-params;version='[5.10.1,5.10.2)',\
Expand Down
8 changes: 8 additions & 0 deletions northbound/sensorthings/mqtt/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
</exclusion>
</exclusions>
</dependency>

<!-- Test dependencies -->
<dependency>
<groupId>org.eclipse.paho</groupId>
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
Expand All @@ -66,6 +68,12 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jul-to-slf4j</artifactId>
<version>${slf4j.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
<configuration>

<import class="ch.qos.logback.classic.jul.LevelChangePropagator"/>
<contextListener class="LevelChangePropagator">
<resetJUL>true</resetJUL>
</contextListener>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>

<root level="ERROR">
<root level="INFO">
<appender-ref ref="STDOUT"/>
</root>
</configuration>
15 changes: 6 additions & 9 deletions northbound/sensorthings/rest.gateway/integration-test.bndrun
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,20 @@
bnd.identity;id='org.eclipse.osgitech.rest.jetty',\
bnd.identity;id='org.eclipse.parsson.jakarta.json',\
bnd.identity;id='org.eclipse.sensinact.gateway.southbound.history.timescale-provider',\
bnd.identity;id='ch.qos.logback.classic'
bnd.identity;id='ch.qos.logback.classic',\
bnd.identity;id='jul.to.slf4j'

-resolve.effective: active

-runee: JavaSE-11
-runfw: org.apache.felix.framework

# These packages are also provided by the gecko.emf.osgi.component project
# so we blacklist the API for resolve consistency
-runblacklist: bnd.identity;id='org.gecko.emf.osgi.api',\
bnd.identity;id='org.osgi.service.cm'
-runproperties: logback.configurationFile=${project.build.testOutputDirectory}/logback-test.xml

# This will help us keep -runbundles sorted
-runstartlevel: \
order=sortbynameversion,\
begin=-1


-runbundles: \
ch.qos.logback.classic;version='[1.4.14,1.4.15)',\
ch.qos.logback.core;version='[1.4.14,1.4.15)',\
Expand All @@ -43,6 +39,7 @@
jakarta.ws.rs-api;version='[3.1.0,3.1.1)',\
jakarta.xml.bind-api;version='[4.0.0,4.0.1)',\
javassist;version='[3.29.2,3.29.3)',\
jul.to.slf4j;version='[2.0.11,2.0.12)',\
junit-jupiter-api;version='[5.10.1,5.10.2)',\
junit-jupiter-engine;version='[5.10.1,5.10.2)',\
junit-jupiter-params;version='[5.10.1,5.10.2)',\
Expand All @@ -57,17 +54,16 @@
org.apache.felix.cm.json;version='[2.0.0,2.0.1)',\
org.apache.felix.configadmin;version='[1.9.24,1.9.25)',\
org.apache.felix.configurator;version='[1.0.18,1.0.19)',\
org.apache.felix.http.jetty;version='[5.0.4,5.0.5)',\
org.apache.felix.http.servlet-api;version='[2.1.0,2.1.1)',\
org.apache.felix.scr;version='[2.2.2,2.2.3)',\
org.apache.servicemix.bundles.junit;version='[4.13.2,4.13.3)',\
org.eclipse.emf.common;version='[2.29.0,2.29.1)',\
org.eclipse.emf.ecore;version='[2.35.0,2.35.1)',\
org.eclipse.emf.ecore.xmi;version='[2.36.0,2.36.1)',\
org.eclipse.jetty.http;version='[11.0.13,11.0.14)',\
org.eclipse.jetty.io;version='[11.0.13,11.0.14)',\
org.eclipse.jetty.security;version='[11.0.13,11.0.14)',\
org.eclipse.jetty.server;version='[11.0.13,11.0.14)',\
org.eclipse.jetty.servlet;version='[11.0.13,11.0.14)',\
org.eclipse.jetty.util;version='[11.0.13,11.0.14)',\
org.eclipse.osgitech.rest;version='[1.2.2,1.2.3)',\
org.eclipse.osgitech.rest.jetty;version='[1.2.2,1.2.3)',\
Expand Down Expand Up @@ -105,6 +101,7 @@
org.locationtech.spatial4j;version='[0.8.0,0.8.1)',\
org.objectweb.asm;version='[9.6.0,9.6.1)',\
org.opentest4j;version='[1.3.0,1.3.1)',\
org.osgi.service.cm;version='[1.6.1,1.6.2)',\
org.osgi.service.component;version='[1.5.0,1.5.1)',\
org.osgi.service.jakartars;version='[2.0.0,2.0.1)',\
org.osgi.service.typedevent;version='[1.0.0,1.0.1)',\
Expand Down
6 changes: 6 additions & 0 deletions northbound/sensorthings/rest.gateway/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@
<version>${sensinact.core.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jul-to-slf4j</artifactId>
<version>${slf4j.version}</version>
<scope>test</scope>
</dependency>

<!-- OSGi -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>

<root level="ERROR">
<appender-ref ref="STDOUT"/>
</root>
<import
class="ch.qos.logback.classic.jul.LevelChangePropagator" />
<contextListener class="LevelChangePropagator">
<resetJUL>true</resetJUL>
</contextListener>

<appender name="STDOUT"
class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>

<root level="INFO">
<appender-ref ref="STDOUT" />
</root>
</configuration>
13 changes: 7 additions & 6 deletions northbound/websocket/integration-test.bndrun
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,7 @@

-runee: JavaSE-11
-runfw: org.apache.felix.framework

# These packages are also provided by the gecko.emf.osgi.component project
# so we blacklist the API for resolve consistency
-runblacklist: bnd.identity;id='org.gecko.emf.osgi.api',\
bnd.identity;id='org.osgi.service.cm',\
bnd.identity;id='org.eclipse.jetty.http'
-runproperties: logback.configurationFile=${project.build.testOutputDirectory}/logback-test.xml

# This will help us keep -runbundles sorted
-runstartlevel: \
Expand Down Expand Up @@ -56,9 +51,15 @@
org.eclipse.emf.ecore;version='[2.35.0,2.35.1)',\
org.eclipse.emf.ecore.xmi;version='[2.36.0,2.36.1)',\
org.eclipse.jetty.alpn.client;version='[11.0.13,11.0.14)',\
org.eclipse.jetty.annotations;version='[11.0.13,11.0.14)',\
org.eclipse.jetty.client;version='[11.0.13,11.0.14)',\
org.eclipse.jetty.http;version='[11.0.13,11.0.14)',\
org.eclipse.jetty.jndi;version='[11.0.13,11.0.14)',\
org.eclipse.jetty.plus;version='[11.0.13,11.0.14)',\
org.eclipse.jetty.security;version='[11.0.13,11.0.14)',\
org.eclipse.jetty.server;version='[11.0.13,11.0.14)',\
org.eclipse.jetty.servlet;version='[11.0.13,11.0.14)',\
org.eclipse.jetty.servlet-api;version='[5.0.2,5.0.3)',\
org.eclipse.jetty.util;version='[11.0.13,11.0.14)',\
org.eclipse.jetty.webapp;version='[11.0.13,11.0.14)',\
org.eclipse.jetty.websocket.api;version='[11.0.13,11.0.14)',\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@

-runee: JavaSE-11
-runfw: org.apache.felix.framework

# These packages are also provided by the gecko.emf.osgi.component project
# so we blacklist the API for resolve consistency
-runblacklist: bnd.identity;id='org.gecko.emf.osgi.api',\
bnd.identity;id='org.osgi.service.cm'
-runproperties: logback.configurationFile=${project.build.testOutputDirectory}/logback-test.xml

# This will help us keep -runbundles sorted
-runstartlevel: \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</encoder>
</appender>

<root level="ERROR">
<root level="INFO">
<appender-ref ref="STDOUT"/>
</root>
</configuration>

0 comments on commit aa0e8fc

Please sign in to comment.