diff --git a/.github/workflows/analyse-pr.yml b/.github/workflows/analyse-pr.yml index cfcc445370b0..99b97a2cc98b 100644 --- a/.github/workflows/analyse-pr.yml +++ b/.github/workflows/analyse-pr.yml @@ -4,6 +4,8 @@ env: MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3 -Dmaven.wagon.httpconnectionManager.ttlSeconds=125 # PR → quiet (unless ci-verbose label), push/schedule → info, workflow_dispatch → user choice MAVEN_ARGS: ${{ (inputs.maven_log == 'debug' && '-X') || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'ci-verbose') && '-q') || (inputs.maven_log == 'quiet' && '-q') || '' }} + # Controls log4j2 suppression of expected test errors. ci-verbose label sets to error to show them. + TEST_LOG_SUPPRESSED_LEVEL: ${{ (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'ci-verbose') && 'error') || (inputs.maven_log == 'debug' && 'error') || 'off' }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.DHIS2_BOT_SONARCLOUD_TOKEN }} on: diff --git a/.github/workflows/run-api-analytics-tests-doris.yml b/.github/workflows/run-api-analytics-tests-doris.yml index 3dfb9bb9e258..73aaac4b21f7 100644 --- a/.github/workflows/run-api-analytics-tests-doris.yml +++ b/.github/workflows/run-api-analytics-tests-doris.yml @@ -4,6 +4,8 @@ env: MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3 -Dmaven.wagon.httpconnectionManager.ttlSeconds=125 # PR → quiet (unless ci-verbose label), push/schedule → info, workflow_dispatch → user choice MAVEN_ARGS: ${{ (inputs.maven_log == 'debug' && '-X') || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'ci-verbose') && '-q') || (inputs.maven_log == 'quiet' && '-q') || '' }} + # Controls log4j2 suppression of expected test errors. ci-verbose label sets to error to show them. + TEST_LOG_SUPPRESSED_LEVEL: ${{ (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'ci-verbose') && 'error') || (inputs.maven_log == 'debug' && 'error') || 'off' }} on: pull_request: diff --git a/.github/workflows/run-api-analytics-tests.yml b/.github/workflows/run-api-analytics-tests.yml index 7692ac46533c..357f87178dd7 100644 --- a/.github/workflows/run-api-analytics-tests.yml +++ b/.github/workflows/run-api-analytics-tests.yml @@ -4,6 +4,8 @@ env: MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3 -Dmaven.wagon.httpconnectionManager.ttlSeconds=125 # PR → quiet (unless ci-verbose label), push/schedule → info, workflow_dispatch → user choice MAVEN_ARGS: ${{ (inputs.maven_log == 'debug' && '-X') || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'ci-verbose') && '-q') || (inputs.maven_log == 'quiet' && '-q') || '' }} + # Controls log4j2 suppression of expected test errors. ci-verbose label sets to error to show them. + TEST_LOG_SUPPRESSED_LEVEL: ${{ (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'ci-verbose') && 'error') || (inputs.maven_log == 'debug' && 'error') || 'off' }} on: pull_request: diff --git a/.github/workflows/run-api-tests.yml b/.github/workflows/run-api-tests.yml index e1632e9c0608..d1e44729040e 100644 --- a/.github/workflows/run-api-tests.yml +++ b/.github/workflows/run-api-tests.yml @@ -4,6 +4,8 @@ env: MAVEN_OPTS: -Xmx1024m -Xms1024m -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3 -Dmaven.wagon.httpconnectionManager.ttlSeconds=125 # PR → quiet (unless ci-verbose label), push/schedule → info, workflow_dispatch → user choice MAVEN_ARGS: ${{ (inputs.maven_log == 'debug' && '-X') || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'ci-verbose') && '-q') || (inputs.maven_log == 'quiet' && '-q') || '' }} + # Controls log4j2 suppression of expected test errors. ci-verbose label sets to error to show them. + TEST_LOG_SUPPRESSED_LEVEL: ${{ (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'ci-verbose') && 'error') || (inputs.maven_log == 'debug' && 'error') || 'off' }} on: push: diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index ab224db0ab68..652bb1fe6e52 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -4,6 +4,8 @@ env: MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3 -Dmaven.wagon.httpconnectionManager.ttlSeconds=125 # PR → quiet (unless ci-verbose label), push/schedule → info, workflow_dispatch → user choice MAVEN_ARGS: ${{ (inputs.maven_log == 'debug' && '-X') || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'ci-verbose') && '-q') || (inputs.maven_log == 'quiet' && '-q') || '' }} + # Controls log4j2 suppression of expected test errors. ci-verbose label sets to error to show them. + TEST_LOG_SUPPRESSED_LEVEL: ${{ (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'ci-verbose') && 'error') || (inputs.maven_log == 'debug' && 'error') || 'off' }} on: push: branches: diff --git a/dhis-2/dhis-support/dhis-support-test/src/main/resources/log4j2-test.xml b/dhis-2/dhis-support/dhis-support-test/src/main/resources/log4j2-test.xml index 9dd20813d726..672012e504ed 100644 --- a/dhis-2/dhis-support/dhis-support-test/src/main/resources/log4j2-test.xml +++ b/dhis-2/dhis-support/dhis-support-test/src/main/resources/log4j2-test.xml @@ -5,6 +5,9 @@ %d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n + + ${env:TEST_LOG_SUPPRESSED_LEVEL:-off} @@ -17,6 +20,23 @@ + + + + + + + + + + + + + + + + ${env:TEST_LOG_SUPPRESSED_LEVEL:-off} @@ -14,6 +17,23 @@ + + + + + + + + + + + + + + + + + ${env:TEST_LOG_SUPPRESSED_LEVEL:-off} @@ -18,6 +21,23 @@ + + + + + + + + + + + + + + + + + + + +