Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump com.github.luben:zstd-jni from 1.5.5-11 to 1.5.6-2 #505

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 122 additions & 0 deletions .github/workflows/build-reusable.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF 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.
#

name: build-reusable

on:
workflow_call:
inputs:
java-version:
description: The Java compiler version
default: 17
type: string
site-enabled:
description: Flag indicating if Maven `site` goal should be run
default: false
type: boolean
secrets:
CODECOV_TOKEN:
description: Codecov.io token
required: true

jobs:

build:

runs-on: ubuntu-latest

strategy:
fail-fast: false

steps:

- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # 4.1.1
with:
# When running on `pull_request` use the PR branch, not the target branch
ref: ${{ github.event_name == 'pull_request_target' && github.head_ref || github.ref }}

- name: Set up Java
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # 3.7.0
with:
distribution: temurin
java-version: ${{ inputs.java-version }}
java-package: jdk
architecture: x64
cache: maven

# We could have used `verify`, but `clean install` is required while generating the build reproducibility report, which is performed in the next step.
# For details, see: https://maven.apache.org/guides/mini/guide-reproducible-builds.html#how-to-test-my-maven-build-reproducibility
- name: Build
id: build
shell: bash
run: |
./mvnw \
--show-version --batch-mode --errors --no-transfer-progress \
-DtrimStackTrace=false \
-DinstallAtEnd=true \
clean install

- name: Build the website
if: inputs.site-enabled
shell: bash
run: |
./mvnw \
--show-version --batch-mode --errors --no-transfer-progress \
site

- name: Upload test coverage
uses: codecov/codecov-action@0cfda1dd0a4ad9efc75517f399d859cd1ea4ced1 # 4.0.2
with:
fail_ci_if_error: true
slug: ppkarwasz/logging-log4j2
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true

# We upload tests results if the build fails.
- name: Upload test results
if: failure() && steps.build.conclusion == 'failure'
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # 4.3.1
with:
name: surefire-${{matrix.os}}-${{github.run_number}}-${{github.run_attempt}}
path: |
**/target/surefire-reports
**/target/logs

# `clean verify artifact:compare` is required to generate the build reproducibility report.
# For details, see: https://maven.apache.org/guides/mini/guide-reproducible-builds.html#how-to-test-my-maven-build-reproducibility
- name: Verify build reproducibility
id: reproducibility
shell: bash
run: |
./mvnw \
--show-version --batch-mode --errors --no-transfer-progress \
-DskipTests=true \
clean verify artifact:compare

# We reproducibility results if the build fails.
- name: Upload reproducibility results
if: failure() && steps.reproducibility.conclusion == 'failure'
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # 4.3.1
with:
name: reproducibility-${{matrix.os}}-${{github.run_number}}-${{github.run_attempt}}
path: |
**/target/bom.xml
**/target/*.buildcompare
**/target/*.jar
**/target/*.zip
**/target/reference/**
49 changes: 5 additions & 44 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,60 +21,21 @@ on:
push:
branches:
- "2.x"
- "release/*"
paths-ignore:
- "**.adoc"
- "**.md"
- "**.txt"
pull_request:
paths-ignore:
- "**.adoc"
- "**.md"
- "**.txt"
- "main"
- "fix/*"
- "feature/*"

permissions: read-all

jobs:

build:
if: github.actor != 'dependabot[bot]'
uses: apache/logging-parent/.github/workflows/build-reusable.yaml@rel/10.6.0
uses: ppkarwasz/logging-log4j2/.github/workflows/build-reusable.yaml@2.x
with:
java-version: |
8
17
site-enabled: true

deploy-snapshot:
needs: build
if: github.repository == 'apache/logging-log4j2' && github.ref_name == '2.x'
uses: apache/logging-parent/.github/workflows/deploy-snapshot-reusable.yaml@rel/10.6.0
# Secrets for deployments
secrets:
NEXUS_USER: ${{ secrets.NEXUS_USER }}
NEXUS_PW: ${{ secrets.NEXUS_PW }}
with:
java-version: |
8
17

deploy-release:
needs: build
if: github.repository == 'apache/logging-log4j2' && startsWith(github.ref_name, 'release/')
uses: apache/logging-parent/.github/workflows/deploy-release-reusable.yaml@rel/10.6.0
# Secrets for deployments
secrets:
GPG_SECRET_KEY: ${{ secrets.LOGGING_GPG_SECRET_KEY }}
LOGGING_STAGE_DEPLOYER_USER: ${{ secrets.LOGGING_STAGE_DEPLOYER_USER }}
LOGGING_STAGE_DEPLOYER_PW: ${{ secrets.LOGGING_STAGE_DEPLOYER_PW }}
SVN_USERNAME: ${{ secrets.LOGGING_SVN_DEV_USERNAME }}
SVN_PASSWORD: ${{ secrets.LOGGING_SVN_DEV_PASSWORD }}
# Write permissions to allow the Maven `revision` property update, changelog release, etc.
permissions:
contents: write
with:
java-version: |
8
17
project-id: log4j
site-enabled: true
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
18 changes: 18 additions & 0 deletions log4j-api-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,24 @@
<build>
<plugins>

<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>report-test-coverage</id>
<phase>none</phase>
</execution>
<execution>
<id>report-aggregate-test-coverage</id>
<goals>
<goal>report-aggregate</goal>
</goals>
<phase>verify</phase>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF 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 org.apache.logging.log4j.test.junit;

/**
* A set of tags for JUnit 5 tests.
*/
public final class Tags {

/**
* Marks tests that don't modify the global environment.
* <p>
* These tests can safely be run in parallel.
* </p>
*/
public static final String PARALLEL = "parallel";

private Tags() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the license.
*/
@Export
@Version("2.23.1")
@Version("2.24.0")
package org.apache.logging.log4j.test.junit;

import org.osgi.annotation.bundle.Export;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
*/
public class TestProvider extends Provider {
public TestProvider() {
super(0, "2.6.0", TestLoggerContextFactory.class);
super(5, CURRENT_VERSION, TestLoggerContextFactory.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@
import static org.junit.jupiter.api.Assertions.fail;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;
import org.apache.logging.log4j.util.ReadOnlyStringMap;
import org.apache.logging.log4j.util.TriConsumer;
import org.junit.jupiter.api.Test;

Expand Down Expand Up @@ -238,32 +240,18 @@ public void testEqualsWhenOneValueDiffers() {

@Test
public void testForEachBiConsumer_JavaUtil() {
UnmodifiableArrayBackedMap map = UnmodifiableArrayBackedMap.EMPTY_MAP.copyAndPutAll(getTestParameters());
Set<String> keys = new HashSet<>();
java.util.function.BiConsumer<String, String> java_util_action =
new java.util.function.BiConsumer<String, String>() {
@Override
public void accept(String key, String value) {
keys.add(key);
}
};
map.forEach(java_util_action);
final Map<String, String> map = UnmodifiableArrayBackedMap.EMPTY_MAP.copyAndPutAll(getTestParameters());
final Collection<String> keys = new HashSet<>();
map.forEach((key, value) -> keys.add(key));
assertEquals(map.keySet(), keys);
}

@Test
public void testForEachBiConsumer_Log4jUtil() {
UnmodifiableArrayBackedMap map = UnmodifiableArrayBackedMap.EMPTY_MAP.copyAndPutAll(getTestParameters());
Set<String> keys = new HashSet<>();
org.apache.logging.log4j.util.BiConsumer<String, String> log4j_util_action =
new org.apache.logging.log4j.util.BiConsumer<String, String>() {
@Override
public void accept(String key, String value) {
keys.add(key);
}
};
map.forEach(log4j_util_action);
assertEquals(map.keySet(), keys);
final ReadOnlyStringMap map = UnmodifiableArrayBackedMap.EMPTY_MAP.copyAndPutAll(getTestParameters());
final Collection<String> keys = new HashSet<>();
map.forEach((key, value) -> keys.add(key));
assertEquals(map.toMap().keySet(), keys);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,8 @@

import java.util.HashMap;
import java.util.Map;
import org.apache.logging.log4j.test.junit.InitializesThreadContext;
import org.apache.logging.log4j.test.junit.SetTestProperty;
import org.apache.logging.log4j.test.junit.UsingThreadContextMap;
import org.junit.jupiter.api.Test;
import org.junitpioneer.jupiter.ClearSystemProperty;

/**
* Tests the {@code DefaultThreadContextMap} class.
Expand Down Expand Up @@ -217,26 +214,4 @@ public void testToStringShowsMapContext() {
map.put("key2", "value2");
assertEquals("{key2=value2}", map.toString());
}

@Test
@ClearSystemProperty(key = DefaultThreadContextMap.INHERITABLE_MAP)
@InitializesThreadContext
public void testThreadLocalNotInheritableByDefault() {
ThreadContextMapFactory.init();
final ThreadLocal<Map<String, String>> threadLocal = DefaultThreadContextMap.createThreadLocalMap(true);
assertFalse(threadLocal instanceof InheritableThreadLocal<?>);
}

@Test
@SetTestProperty(key = DefaultThreadContextMap.INHERITABLE_MAP, value = "true")
@InitializesThreadContext
public void testThreadLocalInheritableIfConfigured() {
ThreadContextMapFactory.init();
try {
final ThreadLocal<Map<String, String>> threadLocal = DefaultThreadContextMap.createThreadLocalMap(true);
assertTrue(threadLocal instanceof InheritableThreadLocal<?>);
} finally {
System.clearProperty(DefaultThreadContextMap.INHERITABLE_MAP);
}
}
}
Loading
Loading