-
Notifications
You must be signed in to change notification settings - Fork 325
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: bump version.log4j from 2.12.4 to 2.24.0 (#3792)
* build: bump version.log4j from 2.12.4 to 2.24.0 Bumps `version.log4j` from 2.12.4 to 2.24.0. Updates `org.apache.logging.log4j:log4j-core` from 2.12.4 to 2.24.0 Updates `org.apache.logging.log4j:log4j-slf4j-impl` from 2.12.4 to 2.24.0 --- updated-dependencies: - dependency-name: org.apache.logging.log4j:log4j-core dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: org.apache.logging.log4j:log4j-slf4j-impl dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * revert the change * Fix classpath for log4j2 tests * Upgrade log4j2 tests to JUnit5, disable broken tests * Fix error capturing test for 2.6 --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: jackshirazi <[email protected]> Co-authored-by: Jonas Kunz <[email protected]>
- Loading branch information
1 parent
2f99ecc
commit 81eea87
Showing
13 changed files
with
130 additions
and
328 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
apm-agent-plugins/apm-logging-plugin/apm-log4j2-plugin-tests/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<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/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>co.elastic.apm</groupId> | ||
<artifactId>apm-logging-plugin</artifactId> | ||
<version>1.51.1-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>apm-log4j2-plugin-tests</artifactId> | ||
<name>${project.groupId}:${project.artifactId}</name> | ||
|
||
<properties> | ||
<apm-agent-parent.base.dir>${project.basedir}/../../..</apm-agent-parent.base.dir> | ||
</properties> | ||
|
||
<!-- | ||
This module contains just the tests for apm-log4j2-plugin. | ||
The reason a separate module is required because the plugin needs to be written against the latest version | ||
of log4j2, but during tests the version required by the agent needs to be on classpath. | ||
Because maven doesn't support different versions of the same dependency for compilation and testing, | ||
we need to use separate modules. | ||
--> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>${project.groupId}</groupId> | ||
<artifactId>apm-log4j2-plugin</artifactId> | ||
<version>${project.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.logging.log4j</groupId> | ||
<artifactId>log4j-core</artifactId> | ||
<version>${version.log4j}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>${project.groupId}</groupId> | ||
<artifactId>apm-logging-plugin-common</artifactId> | ||
<version>${project.version}</version> | ||
<type>test-jar</type> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.ivy</groupId> | ||
<artifactId>ivy</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
|
||
</project> |
55 changes: 55 additions & 0 deletions
55
...4j2-plugin-tests/src/test/java/co/elastic/apm/agent/log4j2/Log4j2InstrumentationTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you 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. | ||
*/ | ||
package co.elastic.apm.agent.log4j2; | ||
|
||
import co.elastic.apm.agent.testutils.TestClassWithDependencyRunner; | ||
import org.junit.jupiter.api.condition.DisabledOnOs; | ||
import org.junit.jupiter.api.condition.OS; | ||
import org.junit.jupiter.params.ParameterizedTest; | ||
import org.junit.jupiter.params.provider.ValueSource; | ||
|
||
import java.util.List; | ||
|
||
@DisabledOnOs(OS.WINDOWS) | ||
public class Log4j2InstrumentationTest { | ||
|
||
@ParameterizedTest | ||
@ValueSource(strings = {"2.6", "2.17.1", "2.24.0"}) | ||
public void testInstrumentation(String version) throws Exception { | ||
List<String> dependencies = List.of( | ||
"org.apache.logging.log4j:log4j-core:" + version, | ||
"org.apache.logging.log4j:log4j-api:" + version, | ||
"co.elastic.logging:log4j2-ecs-layout:1.3.2" | ||
); | ||
new TestClassWithDependencyRunner(dependencies, Log4j2InstrumentationTestDefinitions.class.getName(), | ||
Log4j2InstrumentationTestDefinitions.Log4j2LoggerFacade.class.getName()) | ||
.run(); | ||
} | ||
|
||
@ParameterizedTest | ||
@ValueSource(strings = {"2.6", "2.17.1", "2.24.0"}) | ||
public void testErrorCapture(String version) throws Exception { | ||
List<String> dependencies = List.of( | ||
"org.apache.logging.log4j:log4j-core:" + version, | ||
"org.apache.logging.log4j:log4j-api:" + version | ||
); | ||
new TestClassWithDependencyRunner(dependencies, Log4j2LoggerErrorCapturingInstrumentationTest.class.getName()) | ||
.run(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
118 changes: 0 additions & 118 deletions
118
...2-plugin/src/test/java/co/elastic/apm/agent/log4j2/Log4j2InstrumentationTestVersions.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.