diff --git a/.github/workflows/test_and_docs.yml b/.github/workflows/test_and_docs.yml index ea7d1f21c5c..509bb593f30 100644 --- a/.github/workflows/test_and_docs.yml +++ b/.github/workflows/test_and_docs.yml @@ -52,6 +52,10 @@ jobs: - name: Checkout repository if: ${{ github.event_name != 'pull_request_target' }} uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - name: Set up Docker Buildx + # Required by the platform integration tests below, which run the + # showcases against a Docker target built from //images/linux_x86_64:image. + uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0 - name: Setup Bazel uses: bazel-contrib/setup-bazel@0.18.0 with: @@ -99,6 +103,15 @@ jobs: - name: Execute Feature Integration Tests run: | bazel test --config=linux-x86_64 //feature_integration_tests/test_cases:fit + - name: Execute Platform Integration Tests + # Runs in this job - and before the documentation build below - on purpose: + # the source code linker of the documentation build scans `bazel-testlogs` + # of this very workspace. Only tests executed here contribute their + # PartiallyVerifies/FullyVerifies properties as `testlink` attributes to + # the stakeholder requirement needs, and therefore to the test coverage + # figures of the platform verification report. + run: | + bazel test --lockfile_mode=error --config=linux-x86_64 //platform_integration_tests:pit - name: Install uv (required for SBOM license scanning) uses: astral-sh/setup-uv@v5 with: diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index df3690d5747..e6ef672d947 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -1013,8 +1013,6 @@ "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/rules_swift/2.1.1/MODULE.bazel": "not found", "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/score_devcontainer/1.11.1/MODULE.bazel": "a4d27e121bdee44906e0eac49a74427446482ce16158827802b29c7c3d378150", "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/score_devcontainer/1.11.1/source.json": "0be271286a80b5554628884b1835d6a7b95ce8b9586b572600da95b6c57be428", - "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/score_docs_as_code/8.3.0/MODULE.bazel": "d1fc8b8a089f3bef6e50ab83abb3ae6ba766451e84f749e9c5e87c4b27ff508a", - "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/score_docs_as_code/8.3.0/source.json": "c18aecf1eab38b7ba30f8c9f8c1eb5517f7b88c38c7d57d896851a21e382e5f7", "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/score_format_checker/0.1.1/MODULE.bazel": "1acc254faa90e9f97b79ac69af25b6c21c561f8d6079914f6352b9b20d26bd37", "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/score_format_checker/0.1.1/source.json": "e3d10be878d1a007967b75a5c6d9c3ec3d47c320685904b7f31c689b3cbcdb3a", "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/score_process/2.0.2/MODULE.bazel": "6d2b227bb6880e9f6871cc8cf94c83399e35c188424f7e9b826262de8149ed43", diff --git a/bazel_common/score_modules_tooling.MODULE.bazel b/bazel_common/score_modules_tooling.MODULE.bazel index 5cab525d068..0a73b4bf1e4 100644 --- a/bazel_common/score_modules_tooling.MODULE.bazel +++ b/bazel_common/score_modules_tooling.MODULE.bazel @@ -65,9 +65,10 @@ git_override( ) bazel_dep(name = "score_docs_as_code") -single_version_override( +git_override( module_name = "score_docs_as_code", - version = "8.3.0", + commit = "47f686dcc802cfb89e6472c5fa9f05bfae5d550b", + remote = "https://github.com/eclipse-score/docs-as-code.git", ) bazel_dep(name = "score_process_description") diff --git a/feature_integration_tests/itf/test_showcases.py b/feature_integration_tests/itf/test_showcases.py index 830981489ee..45a011014fd 100644 --- a/feature_integration_tests/itf/test_showcases.py +++ b/feature_integration_tests/itf/test_showcases.py @@ -28,9 +28,3 @@ def test_com_api_example_app_is_running(target): ) logger.info(out) assert exit_code == 0 - - -def test_run_all_showcases(target): - exit_code, out = target.execute("/showcases/bin/cli --examples=all") - logger.info(out) - assert exit_code == 0 diff --git a/images/linux_x86_64/BUILD b/images/linux_x86_64/BUILD index 3eee222f6d6..3aae5abbe77 100644 --- a/images/linux_x86_64/BUILD +++ b/images/linux_x86_64/BUILD @@ -63,5 +63,6 @@ oci_load( repo_tags = ["score_showcases:latest"], visibility = [ "//feature_integration_tests/itf:__pkg__", + "//platform_integration_tests:__subpackages__", ], ) diff --git a/known_good.json b/known_good.json index 8bfe28a313d..f10b87fd044 100644 --- a/known_good.json +++ b/known_good.json @@ -212,7 +212,7 @@ }, "score_docs_as_code": { "repo": "https://github.com/eclipse-score/docs-as-code.git", - "version": "8.3.0" + "hash": "47f686dcc802cfb89e6472c5fa9f05bfae5d550b" }, "score_process_description": { "repo": "https://github.com/eclipse-score/process_description.git", diff --git a/platform_integration_tests/.gitkeep b/platform_integration_tests/.gitkeep deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/platform_integration_tests/BUILD b/platform_integration_tests/BUILD new file mode 100644 index 00000000000..a402feac68b --- /dev/null +++ b/platform_integration_tests/BUILD @@ -0,0 +1,57 @@ +# ******************************************************************************* +# Copyright (c) 2026 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* +load("@rules_python//python:defs.bzl", "py_library") + +package(default_visibility = ["//platform_integration_tests:__subpackages__"]) + +config_setting( + name = "config_linux_x86_64", + constraint_values = [ + "@platforms//os:linux", + "@platforms//cpu:x86_64", + "@score_bazel_platforms//runtime_es:posix", + ], +) + +config_setting( + name = "config_qnx_x86_64", + constraint_values = [ + "@platforms//os:qnx", + "@platforms//cpu:x86_64", + "@score_bazel_platforms//runtime_es:posix", + ], +) + +py_library( + name = "showcase_runner", + srcs = ["showcase_runner.py"], + # Lets sibling packages `import showcase_runner` as a flat top-level + # module instead of `platform_integration_tests.showcase_runner`. + imports = ["."], +) + +# Collects the per-module showcase tests below into the single suite that CI +# runs (see the top-level module docstring of each test for the rationale). +test_suite( + name = "pit", + tags = [ + "manual", + ], + tests = [ + "//platform_integration_tests/communication", + "//platform_integration_tests/kyron", + "//platform_integration_tests/lifecycle", + "//platform_integration_tests/logging", + "//platform_integration_tests/time", + ], +) diff --git a/platform_integration_tests/communication/BUILD b/platform_integration_tests/communication/BUILD new file mode 100644 index 00000000000..9e66577b34b --- /dev/null +++ b/platform_integration_tests/communication/BUILD @@ -0,0 +1,63 @@ +# ******************************************************************************* +# Copyright (c) 2026 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* +load("@score_itf//:defs.bzl", "py_itf_test") + +py_itf_test( + name = "communication", + srcs = ["test_communication_showcase.py"], + args = select( + { + "//platform_integration_tests:config_linux_x86_64": [ + "--docker-image-bootstrap=$(location //images/linux_x86_64:image_load)", + "--docker-image=score_showcases:latest", + ], + "//platform_integration_tests:config_qnx_x86_64": [ + "--qemu-config=$(location //feature_integration_tests/configs:qemu_bridge_config.json)", + "--qemu-image=$(location //images/qnx_x86_64:image)", + ], + }, + no_match_error = "Unsupported platform", + ), + data = select({ + "//platform_integration_tests:config_linux_x86_64": [ + "//images/linux_x86_64:image_load", + ], + "//platform_integration_tests:config_qnx_x86_64": [ + "//feature_integration_tests/configs:qemu_bridge_config.json", + "//images/qnx_x86_64:image", + ], + }), + plugins = select( + { + "//platform_integration_tests:config_linux_x86_64": [ + "@score_itf//score/itf/plugins:docker_plugin", + ], + "//platform_integration_tests:config_qnx_x86_64": [ + "@score_itf//score/itf/plugins:qemu_plugin", + ], + }, + no_match_error = "Unsupported platform", + ) + [ + # Records PartiallyVerifies (via the `@add_test_properties` decorator) + # into the JUnit XML. docs-as-code's source code linker turns those + # properties into `testlink` attributes on the referenced stakeholder + # requirement needs. + "@score_itf//score/itf/plugins:attribute_plugin", + ], + tags = [ + "manual", + ], + deps = [ + "//platform_integration_tests:showcase_runner", + ], +) diff --git a/platform_integration_tests/communication/test_communication_showcase.py b/platform_integration_tests/communication/test_communication_showcase.py new file mode 100644 index 00000000000..0ccd0f6e3da --- /dev/null +++ b/platform_integration_tests/communication/test_communication_showcase.py @@ -0,0 +1,46 @@ +# ******************************************************************************* +# Copyright (c) 2026 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* +"""Platform integration test for the communication showcase. + +These tests exercise the demo applications shipped in ``//showcases`` as +end-to-end platform integration tests. Each test drives one showcase on the +deployed target image through the showcase entrypoint +(``/showcases/bin/cli``) and asserts that it runs to completion. + +Unlike the feature integration tests (which verify individual ``feat_req``), +these tests demonstrate platform-level capabilities and are therefore linked +to the stakeholder requirements (``stkh_req``) they partially verify via +``@add_test_properties``. docs-as-code's source code linker turns those +properties into ``testlink`` attributes on the referenced requirement needs, +which surface in the "Stakeholder Requirements" chapter of the platform +verification report. + +All such tests in this package are combined into a single suite by the +``pit`` target in this package's ``BUILD`` file. +""" + +from attribute_plugin import add_test_properties +from showcase_runner import run_showcases + + +@add_test_properties( + partially_verifies=["stkh_req__communication__inter_process"], + test_type="interface-test", + derivation_technique="requirements-analysis", +) +def test_communication_showcase(target): + """The communication showcase exchanges data between a sender and a + receiver process, demonstrating inter-process communication on the + platform.""" + + run_showcases(target, "Communication Sender Receiver Example") diff --git a/platform_integration_tests/kyron/BUILD b/platform_integration_tests/kyron/BUILD new file mode 100644 index 00000000000..ee499ec18c3 --- /dev/null +++ b/platform_integration_tests/kyron/BUILD @@ -0,0 +1,63 @@ +# ******************************************************************************* +# Copyright (c) 2026 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* +load("@score_itf//:defs.bzl", "py_itf_test") + +py_itf_test( + name = "kyron", + srcs = ["test_async_runtime_showcase.py"], + args = select( + { + "//platform_integration_tests:config_linux_x86_64": [ + "--docker-image-bootstrap=$(location //images/linux_x86_64:image_load)", + "--docker-image=score_showcases:latest", + ], + "//platform_integration_tests:config_qnx_x86_64": [ + "--qemu-config=$(location //feature_integration_tests/configs:qemu_bridge_config.json)", + "--qemu-image=$(location //images/qnx_x86_64:image)", + ], + }, + no_match_error = "Unsupported platform", + ), + data = select({ + "//platform_integration_tests:config_linux_x86_64": [ + "//images/linux_x86_64:image_load", + ], + "//platform_integration_tests:config_qnx_x86_64": [ + "//feature_integration_tests/configs:qemu_bridge_config.json", + "//images/qnx_x86_64:image", + ], + }), + plugins = select( + { + "//platform_integration_tests:config_linux_x86_64": [ + "@score_itf//score/itf/plugins:docker_plugin", + ], + "//platform_integration_tests:config_qnx_x86_64": [ + "@score_itf//score/itf/plugins:qemu_plugin", + ], + }, + no_match_error = "Unsupported platform", + ) + [ + # Records PartiallyVerifies (via the `@add_test_properties` decorator) + # into the JUnit XML. docs-as-code's source code linker turns those + # properties into `testlink` attributes on the referenced stakeholder + # requirement needs. + "@score_itf//score/itf/plugins:attribute_plugin", + ], + tags = [ + "manual", + ], + deps = [ + "//platform_integration_tests:showcase_runner", + ], +) diff --git a/platform_integration_tests/kyron/test_async_runtime_showcase.py b/platform_integration_tests/kyron/test_async_runtime_showcase.py new file mode 100644 index 00000000000..4f604547246 --- /dev/null +++ b/platform_integration_tests/kyron/test_async_runtime_showcase.py @@ -0,0 +1,38 @@ +# ******************************************************************************* +# Copyright (c) 2026 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* +"""Platform integration test for the Kyron async runtime showcases. + +See ``test_communication_showcase`` for background on these platform +integration tests. All such tests in this package are combined into a single +suite by the ``pit`` target in this package's ``BUILD`` file. +""" + +from attribute_plugin import add_test_properties +from showcase_runner import run_showcases + + +@add_test_properties( + partially_verifies=["stkh_req__execution_model__processes"], + test_type="interface-test", + derivation_technique="requirements-analysis", +) +def test_async_runtime_showcase(target): + """The Kyron showcases run asynchronous applications on the safe async + runtime, demonstrating the platform's process and task management.""" + + run_showcases( + target, + "Kyron select example", + "Kyron safety task example", + "Kyron basic example", + ) diff --git a/platform_integration_tests/lifecycle/BUILD b/platform_integration_tests/lifecycle/BUILD new file mode 100644 index 00000000000..3081d6cc4ec --- /dev/null +++ b/platform_integration_tests/lifecycle/BUILD @@ -0,0 +1,63 @@ +# ******************************************************************************* +# Copyright (c) 2026 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* +load("@score_itf//:defs.bzl", "py_itf_test") + +py_itf_test( + name = "lifecycle", + srcs = ["test_lifecycle_showcase.py"], + args = select( + { + "//platform_integration_tests:config_linux_x86_64": [ + "--docker-image-bootstrap=$(location //images/linux_x86_64:image_load)", + "--docker-image=score_showcases:latest", + ], + "//platform_integration_tests:config_qnx_x86_64": [ + "--qemu-config=$(location //feature_integration_tests/configs:qemu_bridge_config.json)", + "--qemu-image=$(location //images/qnx_x86_64:image)", + ], + }, + no_match_error = "Unsupported platform", + ), + data = select({ + "//platform_integration_tests:config_linux_x86_64": [ + "//images/linux_x86_64:image_load", + ], + "//platform_integration_tests:config_qnx_x86_64": [ + "//feature_integration_tests/configs:qemu_bridge_config.json", + "//images/qnx_x86_64:image", + ], + }), + plugins = select( + { + "//platform_integration_tests:config_linux_x86_64": [ + "@score_itf//score/itf/plugins:docker_plugin", + ], + "//platform_integration_tests:config_qnx_x86_64": [ + "@score_itf//score/itf/plugins:qemu_plugin", + ], + }, + no_match_error = "Unsupported platform", + ) + [ + # Records PartiallyVerifies (via the `@add_test_properties` decorator) + # into the JUnit XML. docs-as-code's source code linker turns those + # properties into `testlink` attributes on the referenced stakeholder + # requirement needs. + "@score_itf//score/itf/plugins:attribute_plugin", + ], + tags = [ + "manual", + ], + deps = [ + "//platform_integration_tests:showcase_runner", + ], +) diff --git a/platform_integration_tests/lifecycle/test_lifecycle_showcase.py b/platform_integration_tests/lifecycle/test_lifecycle_showcase.py new file mode 100644 index 00000000000..e6afecb47ce --- /dev/null +++ b/platform_integration_tests/lifecycle/test_lifecycle_showcase.py @@ -0,0 +1,34 @@ +# ******************************************************************************* +# Copyright (c) 2026 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* +"""Platform integration test for the lifecycle showcase. + +See ``test_communication_showcase`` for background on these platform +integration tests. All such tests in this package are combined into a single +suite by the ``pit`` target in this package's ``BUILD`` file. +""" + +from attribute_plugin import add_test_properties +from showcase_runner import run_showcases + + +@add_test_properties( + partially_verifies=["stkh_req__dependability__safety_features_1"], + test_type="interface-test", + derivation_technique="requirements-analysis", +) +def test_lifecycle_showcase(target): + """The lifecycle showcase launches two supervised applications and records + a malfunction, demonstrating the platform's health and lifecycle + management.""" + + run_showcases(target, "Simple Health and lifecycle management example") diff --git a/platform_integration_tests/logging/BUILD b/platform_integration_tests/logging/BUILD new file mode 100644 index 00000000000..fd24a192b90 --- /dev/null +++ b/platform_integration_tests/logging/BUILD @@ -0,0 +1,63 @@ +# ******************************************************************************* +# Copyright (c) 2026 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* +load("@score_itf//:defs.bzl", "py_itf_test") + +py_itf_test( + name = "logging", + srcs = ["test_logging_showcase.py"], + args = select( + { + "//platform_integration_tests:config_linux_x86_64": [ + "--docker-image-bootstrap=$(location //images/linux_x86_64:image_load)", + "--docker-image=score_showcases:latest", + ], + "//platform_integration_tests:config_qnx_x86_64": [ + "--qemu-config=$(location //feature_integration_tests/configs:qemu_bridge_config.json)", + "--qemu-image=$(location //images/qnx_x86_64:image)", + ], + }, + no_match_error = "Unsupported platform", + ), + data = select({ + "//platform_integration_tests:config_linux_x86_64": [ + "//images/linux_x86_64:image_load", + ], + "//platform_integration_tests:config_qnx_x86_64": [ + "//feature_integration_tests/configs:qemu_bridge_config.json", + "//images/qnx_x86_64:image", + ], + }), + plugins = select( + { + "//platform_integration_tests:config_linux_x86_64": [ + "@score_itf//score/itf/plugins:docker_plugin", + ], + "//platform_integration_tests:config_qnx_x86_64": [ + "@score_itf//score/itf/plugins:qemu_plugin", + ], + }, + no_match_error = "Unsupported platform", + ) + [ + # Records PartiallyVerifies (via the `@add_test_properties` decorator) + # into the JUnit XML. docs-as-code's source code linker turns those + # properties into `testlink` attributes on the referenced stakeholder + # requirement needs. + "@score_itf//score/itf/plugins:attribute_plugin", + ], + tags = [ + "manual", + ], + deps = [ + "//platform_integration_tests:showcase_runner", + ], +) diff --git a/platform_integration_tests/logging/test_logging_showcase.py b/platform_integration_tests/logging/test_logging_showcase.py new file mode 100644 index 00000000000..cf599dd2ea3 --- /dev/null +++ b/platform_integration_tests/logging/test_logging_showcase.py @@ -0,0 +1,34 @@ +# ******************************************************************************* +# Copyright (c) 2026 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* +"""Platform integration test for the logging showcase. + +See ``test_communication_showcase`` for background on these platform +integration tests. All such tests in this package are combined into a single +suite by the ``pit`` target in this package's ``BUILD`` file. +""" + +from attribute_plugin import add_test_properties +from showcase_runner import run_showcases + + +@add_test_properties( + partially_verifies=["stkh_req__dev_experience__logging_support"], + test_type="interface-test", + derivation_technique="requirements-analysis", +) +def test_logging_showcase(target): + """The logging showcase runs an application logging via ``mw::log`` with + the console, remote (DLT) and file backends, demonstrating the platform's + logging support.""" + + run_showcases(target, "LoggingApp Demo") diff --git a/platform_integration_tests/showcase_runner.py b/platform_integration_tests/showcase_runner.py new file mode 100644 index 00000000000..9b8ced60119 --- /dev/null +++ b/platform_integration_tests/showcase_runner.py @@ -0,0 +1,38 @@ +# ******************************************************************************* +# Copyright (c) 2026 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* +"""Helper for driving showcases via the showcase CLI entrypoint.""" + +import logging + +logger = logging.getLogger(__name__) + +_CLI = "/showcases/bin/cli" + + +def run_showcases(target, *names: str) -> None: + """Run the named showcases via the showcase entrypoint and assert success. + + ``run_score`` in the showcase CLI prints a per-example completion banner + and exits 0 once every app of an example has been spawned and joined, so + both the exit code and the banner are checked to confirm the showcase ran + end-to-end on the platform. + """ + selection = ",".join(names) + exit_code, out = target.execute(f"{_CLI} --examples='{selection}'") + output = out.decode(errors="replace") + logger.info(output) + assert exit_code == 0, f"Showcase CLI exited with {exit_code}:\n{output}" + for name in names: + assert f"Example '{name}' finished successfully" in output, ( + f"Showcase '{name}' did not finish successfully:\n{output}" + ) diff --git a/platform_integration_tests/time/BUILD b/platform_integration_tests/time/BUILD new file mode 100644 index 00000000000..e34def13680 --- /dev/null +++ b/platform_integration_tests/time/BUILD @@ -0,0 +1,63 @@ +# ******************************************************************************* +# Copyright (c) 2026 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* +load("@score_itf//:defs.bzl", "py_itf_test") + +py_itf_test( + name = "time", + srcs = ["test_vehicle_time_showcase.py"], + args = select( + { + "//platform_integration_tests:config_linux_x86_64": [ + "--docker-image-bootstrap=$(location //images/linux_x86_64:image_load)", + "--docker-image=score_showcases:latest", + ], + "//platform_integration_tests:config_qnx_x86_64": [ + "--qemu-config=$(location //feature_integration_tests/configs:qemu_bridge_config.json)", + "--qemu-image=$(location //images/qnx_x86_64:image)", + ], + }, + no_match_error = "Unsupported platform", + ), + data = select({ + "//platform_integration_tests:config_linux_x86_64": [ + "//images/linux_x86_64:image_load", + ], + "//platform_integration_tests:config_qnx_x86_64": [ + "//feature_integration_tests/configs:qemu_bridge_config.json", + "//images/qnx_x86_64:image", + ], + }), + plugins = select( + { + "//platform_integration_tests:config_linux_x86_64": [ + "@score_itf//score/itf/plugins:docker_plugin", + ], + "//platform_integration_tests:config_qnx_x86_64": [ + "@score_itf//score/itf/plugins:qemu_plugin", + ], + }, + no_match_error = "Unsupported platform", + ) + [ + # Records PartiallyVerifies (via the `@add_test_properties` decorator) + # into the JUnit XML. docs-as-code's source code linker turns those + # properties into `testlink` attributes on the referenced stakeholder + # requirement needs. + "@score_itf//score/itf/plugins:attribute_plugin", + ], + tags = [ + "manual", + ], + deps = [ + "//platform_integration_tests:showcase_runner", + ], +) diff --git a/platform_integration_tests/time/test_vehicle_time_showcase.py b/platform_integration_tests/time/test_vehicle_time_showcase.py new file mode 100644 index 00000000000..06471d52f5c --- /dev/null +++ b/platform_integration_tests/time/test_vehicle_time_showcase.py @@ -0,0 +1,34 @@ +# ******************************************************************************* +# Copyright (c) 2026 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* +"""Platform integration test for the vehicle time showcase. + +See ``test_communication_showcase`` for background on these platform +integration tests. All such tests in this package are combined into a single +suite by the ``pit`` target in this package's ``BUILD`` file. +""" + +from attribute_plugin import add_test_properties +from showcase_runner import run_showcases + + +@add_test_properties( + partially_verifies=["stkh_req__time__vehicle_time_api"], + test_type="interface-test", + derivation_technique="requirements-analysis", +) +def test_vehicle_time_showcase(target): + """The vehicle time showcase obtains a combined snapshot of the + PTP-synchronized vehicle time and the local monotonic time, demonstrating + the platform's vehicle time base API.""" + + run_showcases(target, "Vehicle Time Example")