Skip to content

feat: add TimeDaemon CIT with pip hub infrastructure - #122

Open
gordon9901 wants to merge 8 commits into
eclipse-score:mainfrom
gordon9901:ecarx_time_daemon_cit
Open

feat: add TimeDaemon CIT with pip hub infrastructure#122
gordon9901 wants to merge 8 commits into
eclipse-score:mainfrom
gordon9901:ecarx_time_daemon_cit

Conversation

@gordon9901

@gordon9901 gordon9901 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

This PR adds TimeDaemon component integration tests with pip hub infrastructure (part 1 of 3):

  • Add three independent pip hubs for TimeDaemon, TimeSlave, and MIT test suites
  • Add score_test_scenarios framework dependency with compatibility patch for score_baselibs 0.2.7
  • Add TimeDaemon CIT covering daemon lifecycle, control flow, IPC, SVT, and verification pipeline
  • Fix visibility for shm_ptp_engine and svt_handler to allow access from test scenarios

Part of #56

test QNX

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

License Check Results

🚀 The license check job ran with the Bazel command:

bazel run //:license-check

Status: ⚠️ Needs Review

Click to expand output
[License Check Output]
Extracting Bazel installation...
Starting local Bazel server (8.6.0) and connecting to it...
INFO: Invocation ID: a9545459-efd5-41ab-9c32-7573183fe9ed
Computing main repo mapping: 
WARNING: /home/runner/work/time/time/MODULE.bazel:13:7: The attribute 'compatibility_level' in module() is a no-op and will be removed in a future Bazel release. Please remove it from your MODULE.bazel file.
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Loading: 
Loading: 3 packages loaded
Loading: 3 packages loaded
    currently loading: 
Loading: 3 packages loaded
    currently loading: 
Loading: 3 packages loaded
    currently loading: 
Loading: 3 packages loaded
    currently loading: 
Analyzing: target //:license-check (4 packages loaded, 0 targets configured)
Analyzing: target //:license-check (4 packages loaded, 0 targets configured)

Analyzing: target //:license-check (33 packages loaded, 10 targets configured)

Analyzing: target //:license-check (101 packages loaded, 277 targets configured)

Analyzing: target //:license-check (149 packages loaded, 3113 targets configured)

Analyzing: target //:license-check (153 packages loaded, 6745 targets configured)

Analyzing: target //:license-check (154 packages loaded, 9218 targets configured)

Analyzing: target //:license-check (156 packages loaded, 9238 targets configured)

Analyzing: target //:license-check (165 packages loaded, 9284 targets configured)

Analyzing: target //:license-check (165 packages loaded, 9284 targets configured)

Analyzing: target //:license-check (165 packages loaded, 9284 targets configured)

Analyzing: target //:license-check (169 packages loaded, 11296 targets configured)

INFO: Analyzed target //:license-check (170 packages loaded, 11422 targets configured).
[12 / 16] JavaToolchainCompileClasses external/rules_java+/toolchains/platformclasspath_classes; 0s disk-cache, processwrapper-sandbox ... (2 actions, 1 running)
INFO: From Generating Dash formatted dependency file ...:
INFO: Successfully converted 2 packages from Cargo.lock to bazel-out/k8-fastbuild/bin/formatted.txt
[14 / 16] JavaToolchainCompileBootClasspath external/rules_java+/toolchains/platformclasspath.jar; 0s disk-cache, processwrapper-sandbox
[15 / 16] Building license.check.license_check.jar (); 0s disk-cache, multiplex-worker
INFO: Found 1 target...
Target //:license.check.license_check up-to-date:
  bazel-bin/license.check.license_check
  bazel-bin/license.check.license_check.jar
INFO: Elapsed time: 27.726s, Critical Path: 2.82s
INFO: 16 processes: 12 internal, 3 processwrapper-sandbox, 1 worker.
INFO: Build completed successfully, 16 total actions
INFO: Running command line: bazel-bin/license.check.license_check ./formatted.txt <args omitted>
usage: org.eclipse.dash.licenses.cli.Main [-batch <int>] [-cd <url>]
       [-confidence <int>] [-ef <url>] [-excludeSources <sources>] [-help] [-lic
       <url>] [-project <shortname>] [-repo <url>] [-review] [-summary <file>]
       [-timeout <seconds>] [-token <token>]

@github-actions

Copy link
Copy Markdown

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

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
tags = ["QM"],
visibility = ["//score/time_daemon:__subpackages__"],
visibility = [
"//score/tests/test_scenarios/cpp:__pkg__",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed? //score/tests/test_scenarios/cpp doesn't exist

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch — this visibility entry is needed for the MIT test in part 3 (which links against shm_ptp_engine directly). I'll remove it from this PR and add it in PR3 instead where the package actually exists.

visibility = ["//visibility:public"],
- deps = ["@score_baselibs//score/json:json_parser"],
+ deps = [
+ "@score_baselibs//score/json:json",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you are missing this dependency, could you add it to your target to avoid the patch?
or, if you think, the proper place to the dependency is on baselibs side, please, create a ticket towards them and put it here to keep track, when we could drop the patch

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The missing json dependency was a bug in score_test_scenarios upstream. It's fixed in v0.4.1, so the patch is no longer needed. Upgraded to v0.4.1 and removed the patch file and the entire score/tests/patches/ directory.

from testing_utils import LogContainer, ScenarioResult


class TestControlFlowPtpDivider(TimeDaemonCitScenario):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would believe that one and many others (all?) is not the Integration tests but SW Componenet ones.
it doesn't mean, we don't need them, but they are just on differnt level and should be put to differnet folder not to confuse

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. These tests verify interactions between internal Machines within TimeDaemon (intra-process), not cross-component communication — they are SW Component Tests. Renamed the directory integration_tests/ → component_tests/ to reflect the correct level and avoid confusion. All Bazel targets and references updated accordingly.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't need it anymore.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, removed.

Comment thread MODULE.bazel Outdated

## Component Integration Test framework

bazel_dep(name = "score_test_scenarios", version = "0.3.0", dev_dependency = True)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you fix the version to the 0.3.0?
I think in the 0.4.1 (?) the issue with json is solved, you will then need no patch any more

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. Upgraded to v0.4.1 (fec712d4) — the json dependency issue is fixed upstream so the patch is no longer needed either.

Comment thread MODULE.bazel

bazel_dep(name = "score_test_scenarios", version = "0.3.0", dev_dependency = True)
git_override(
module_name = "score_test_scenarios",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the end I would have some doubts about the framework.

the tests which I see here, they do not verify the interaction between differnet sw components, but rather, how the subcompoenents in oecomponent interating between each other.
so, it is the SW Component test, which could be (and even is) implemented by the unit tests (gtests)
cross check for hte test duplication.

for the real integration tests (TimeSlave <-> TimeDameon <-> CustomerApp) I would propose to use score_itf framework which provides the possibility to execute tests on host and on the target platfrom

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understood. The tests in this PR are intentionally SW Component Test level — they verify interactions between internal Machines (VerificationMachine, ControlFlowDivider, IPCMachine, etc.) using in-process stubs, not cross-process IPC. The full plan is three layers:

PR1 (this PR): TimeDaemon component tests — intra-process, score_test_scenarios
PR2: TimeSlave component tests — same level, same framework
PR3: TimeSlave ↔ TimeDaemon module integration test — cross-process, will use score_itf

Cross-check with existing gtests is a good point — will review for duplication before PR3.

psutil
pytest-metadata
pytest-env
testing-utils @ git+https://github.com/eclipse-score/testing_tools.git@v0.3.0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would be better to use the githash, not the tag to make the build reproducable

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Replaced @v0.3.0 with the pinned commit hash a2f9cded3deb636f5dc800bf7a47131487119721.

catch (const std::exception& ex)
{
std::cerr << ex.what() << std::endl;
return 101;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what 101 means here?
is it handled anywhere?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

101 is reserved for framework-level crashes — an unhandled C++ exception during scenario runner setup, distinct from test logic results (0 = all pass, 1 = test failure). Added static constexpr int kFrameworkError = 101 to make the intent explicit. The Python side treats any non-zero exit as a setup/framework error.

print("Building C++ test scenarios executable...")
bazel_tools = BazelTools(option_prefix="cpp", build_timeout=build_timeout)
cpp_target_name = session.config.getoption("--cpp-target-name")
bazel_tools.build(cpp_target_name, "--config=time-x86_64-linux")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shall we make the bazel config paramterized? now the linux config is hardcoded

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Extracted to a --bazel-config pytest CLI option with default time-x86_64-linux. Can be overridden at invocation, e.g. pytest --build-scenarios --bazel-config=time-arm64-qnx.

"src/**/*.cpp",
"src/**/*.hpp",
]),
copts = ["-g"],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we really need it always?
shall it be controlled from bazel cli?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed. Debug symbols can be enabled at the Bazel CLI level with --copt=-g or --compilation_mode=dbg when needed.

Comment thread MODULE.bazel
)
use_repo(pip, "pip_time_daemon_venv")

bazel_dep(name = "rules_cc", version = "0.2.17", dev_dependency = True)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need it?
it wasn't there and assumption, it will come form the project

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rules_cc is needed explicitly here because @score_test_scenarios//test_scenarios_cpp loads @rules_cc//cc:cc_library.bzl directly. Since score_test_scenarios is a new dev dependency not present on main, rules_cc must also be declared. Without it the build fails when resolving the module graph.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

3 participants