Skip to content

Enable logging integration tests and fix datarouter config packaging - #387

Merged
antonkri merged 5 commits into
mainfrom
fix/logging-datarouter-config
Oct 8, 2026
Merged

antonkri merged 5 commits into
mainfrom
fix/logging-datarouter-config

Conversation

@antonkri

@antonkri antonkri commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

What

Re-enables the score_logging module integration (component) tests in known_good.json and adds a patch that fixes why they could never pass in reference_integration.

Why the datarouter component tests failed here

All 10 @score_logging//score/test/component/... tests failed TimeoutError: Datarouter not ready within 10.0s (3/3 attempts, not flaky). The datarouter runs with cwd=/opt/datarouter and opens ./etc/log-channels.json, but in the reference_integration-built image the config files landed at:

opt/datarouter/external/score_logging+/score/test/component/datarouter/etc/log-channels.json   ❌

instead of

opt/datarouter/etc/log-channels.json   ✅

So ReadStaticDlt fails → DltLogServer is nullptr → "static config is not available, interrupt work" → the unix socket never opens → every test times out.

Root cause

score/test/component/BUILD's _datarouter_conf_pkg used:

pkg_tar(
    ...
    package_dir = "opt/datarouter",
    strip_prefix = "/score/test/component/datarouter",
)

A leading-slash strip_prefix is repo-root-relative and only matches when logging is the root module (its own component_tests.yml CI, where the tests are green). When logging is consumed as an external dependency — exactly reference_integration — the file path is prefixed with external/score_logging+/, the strip matches nothing, and the whole prefix survives under package_dir.

This is why test_datarouter_filters / test_mw_log / test_mw_log_filters pass in logging's own per-PR CI but fail here, and it's the first time these tests ran in reference_integration (added in #385).

The fix

patches/logging/003-fix-datarouter-config-packaging.patch replaces the absolute-strip pkg_tar with a package-relative pkg_files using strip_prefix.from_pkg() (mirroring the already-working QNX datarouter_config_pkg). This resolves to opt/datarouter/etc/* for both root and external consumption. Verified locally by inspecting the built datarouter_pkg.tar.

The fix belongs upstream in eclipse-score/logging; this local patch unblocks reference_integration until logging is bumped to include it.

Changes

  • patches/logging/003-fix-datarouter-config-packaging.patch (new)
  • known_good.json: register patch 003 + restore logging integration_test_targets / integration_test_config (removed in Fix feature integration tests (psutil) and green the pipeline #386)
  • bazel_common/score_modules_target_sw.MODULE.bazel: regenerated via scripts/known_good/update_module_from_known_good.py

Validation

Letting CI exercise the full logging component test suite via the module integration test step.

…kaging

The score_logging datarouter component tests never passed in
reference_integration because the datarouter cannot find its static
config at runtime: it runs with cwd=/opt/datarouter and opens
./etc/log-channels.json, but the config files were packaged under
opt/datarouter/external/score_logging+/score/test/component/datarouter/etc/
instead of opt/datarouter/etc/.

Root cause: score/test/component/BUILD's _datarouter_conf_pkg used
pkg_tar(strip_prefix = "/score/test/component/datarouter"). An absolute
(leading-slash) strip_prefix is repo-root-relative and only matches when
logging is the root module (its own component_tests.yml CI). When logging
is consumed as an external dependency (exactly reference_integration) the
file path is prefixed with external/score_logging+/ so the strip matches
nothing and the whole prefix survives under package_dir.

Fix (patches/logging/003-fix-datarouter-config-packaging.patch): replace
the absolute-strip pkg_tar with a package-relative pkg_files using
strip_prefix.from_pkg(), which resolves to opt/datarouter/etc/* for both
root and external consumption. Verified by inspecting the built
datarouter_pkg.tar.

Re-enable the logging integration_test_targets/integration_test_config in
known_good.json (removed in #386) so CI exercises the component tests.
test_datarouter_filters counts only non-verbose (non-extended) DLT
messages, so it needs the datarouter built with enable_nonverbose_dlt=True.
RI's .bazelrc build:_common forces that flag to False globally, and the
integration run inherits it via --config=linux-x86_64. Override it back to
True in logging's integration_test_config (appended after --config, so it
wins) so the filter test sees the expected 11 non-verbose messages instead
of 0.
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

The created documentation from the pull request is available at: docu-html

antonkri and others added 2 commits October 6, 2026 17:23
…1 & 003

logging#351 (datarouter config packaging) merged upstream, so the local
patch 003 is no longer needed. The bump also pulls in logging's upstream
baselibs target-path migration (3fce1678), making patch 001 obsolete too.
@antonkri
antonkri merged commit 1e6b782 into main Oct 8, 2026
17 of 18 checks passed
@antonkri
antonkri deleted the fix/logging-datarouter-config branch October 8, 2026 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants