This is an automated email from the ASF dual-hosted git repository. xtsong pushed a commit to branch release-0.2 in repository https://gitbox.apache.org/repos/asf/flink-agents.git
commit 270fa95af1aa52a3eaa3bc885c163c871ce82fcf Author: XL Zhao <[email protected]> AuthorDate: Tue Feb 10 16:55:16 2026 +0800 [infra] Add configurable log level for CI test runs (#518) --- .github/workflows/ci.yml | 8 ++++++++ .../src/test/resources/log4j2-test.properties | 3 ++- runtime/src/test/resources/log4j2-test.properties | 3 ++- tools/ut.sh | 15 +++++++++++---- 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f80840fd..e555fd43 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,6 +76,8 @@ jobs: cd python uv sync --all-extras - name: Run Java Tests + env: + LOG_LEVEL: INFO run: | # Add Python venv to PATH so Java tests can find MCP dependencies export PATH="${{ github.workspace }}/python/.venv/bin:$PATH" @@ -106,6 +108,8 @@ jobs: with: version: "latest" - name: Run Python Tests + env: + LOG_LEVEL: INFO run: tools/ut.sh -p python_it_tests: @@ -170,6 +174,8 @@ jobs: - name: Install ollama run: bash tools/start_ollama_server.sh - name: Run Java IT + env: + LOG_LEVEL: INFO run: tools/ut.sh -j -e -f ${{ matrix.flink-version }} cross_language_tests: @@ -227,6 +233,8 @@ jobs: - name: Install ollama run: bash tools/start_ollama_server.sh - name: Run e2e tests + env: + LOG_LEVEL: INFO run: | export ES_HOST="http://localhost:9200" tools/e2e.sh \ No newline at end of file diff --git a/e2e-test/flink-agents-end-to-end-tests-integration/src/test/resources/log4j2-test.properties b/e2e-test/flink-agents-end-to-end-tests-integration/src/test/resources/log4j2-test.properties index 487984f0..7866928e 100644 --- a/e2e-test/flink-agents-end-to-end-tests-integration/src/test/resources/log4j2-test.properties +++ b/e2e-test/flink-agents-end-to-end-tests-integration/src/test/resources/log4j2-test.properties @@ -18,7 +18,8 @@ # Set root logger level to OFF to not flood build logs # set manually to INFO for debugging purposes -rootLogger.level = OFF +# Can be overridden via LOG_LEVEL environment variable in CI +rootLogger.level = ${env:LOG_LEVEL:-OFF} rootLogger.appenderRef.test.ref = TestLogger appender.testlogger.name = TestLogger diff --git a/runtime/src/test/resources/log4j2-test.properties b/runtime/src/test/resources/log4j2-test.properties index 835c2ec9..459dce90 100644 --- a/runtime/src/test/resources/log4j2-test.properties +++ b/runtime/src/test/resources/log4j2-test.properties @@ -18,7 +18,8 @@ # Set root logger level to OFF to not flood build logs # set manually to INFO for debugging purposes -rootLogger.level = OFF +# Can be overridden via LOG_LEVEL environment variable in CI +rootLogger.level = ${env:LOG_LEVEL:-OFF} rootLogger.appenderRef.test.ref = TestLogger appender.testlogger.name = TestLogger diff --git a/tools/ut.sh b/tools/ut.sh index 134493b3..57d9a1ac 100755 --- a/tools/ut.sh +++ b/tools/ut.sh @@ -219,11 +219,18 @@ python_tests() { if $run_e2e; then # There will be an individual build step before run e2e test for including java dist uv pip install apache-flink~=${version}.0 - uv run --no-sync pytest flink_agents -s -k "e2e_tests_integration" + uv run --no-sync pytest flink_agents \ + -s \ + -k "e2e_tests_integration" \ + -o log_cli=true \ + -o log_cli_level=${LOG_LEVEL:-CRITICAL} else uv sync --extra test uv pip install apache-flink~=${version}.0 - uv run --no-sync pytest flink_agents -k "not e2e_tests" + uv run --no-sync pytest flink_agents \ + -k "not e2e_tests" \ + -o log_cli=true \ + -o log_cli_level=${LOG_LEVEL:-CRITICAL} fi testcode=$? else @@ -242,9 +249,9 @@ python_tests() { echo "Running tests with pytest..." fi if $run_e2e; then - pytest flink_agents -k "e2e_tests_integration" + pytest flink_agents -k "e2e_tests_integration" -o log_cli=true -o log_cli_level=${LOG_LEVEL:-OFF} else - pytest flink_agents -k "not e2e_tests" + pytest flink_agents -k "not e2e_tests" -o log_cli=true -o log_cli_level=${LOG_LEVEL:-OFF} fi testcode=$? fi
