Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions .github/workflows/component_tests_nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,3 @@ jobs:
--test_tag_filters=integration \
--test_output=errors \
//score/test/component/...

# QNX integration tests — requires a self-hosted runner with QEMU + tap0 bridge.
Comment thread
rmaddikery marked this conversation as resolved.
# Enable once integration_tests.yml is available in cicd-workflows.
# - name: Run QNX component tests
# uses: eclipse-score/cicd-workflows/.github/workflows/qnx-test.yml@main
# with:
# bazel-target: '//score/test/component/...'
# bazel-config: 'x86_64-qnx'
# test-tag-filters: 'integration'
100 changes: 89 additions & 11 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,97 @@ on:
types: [checks_requested]
workflow_dispatch: {}

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request_target' }}

jobs:
approval:
if: github.event_name == 'pull_request_target' && (github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name)
environment: workflow-approval
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
steps:
- name: Blocking on approval
run: 'true'

integration-tests-qnx:
uses: eclipse-score/cicd-workflows/.github/workflows/qnx-build.yml@main
name: QNX Integration Tests (x86_64-qnx)
needs: approval
if: ${{ !cancelled() }}
runs-on: ${{ vars.runner_labels_ghub_standard_x64 && fromJSON(vars.runner_labels_ghub_standard_x64) || vars.REPO_RUNNER_LABELS && fromJSON(vars.REPO_RUNNER_LABELS) || 'ubuntu-latest' }}
permissions:
contents: read
pull-requests: read
with:
bazel-target: '//score/test/component/...'
bazel-config: x86_64-qnx
extra-bazel-flags: '--lockfile_mode=error --test_tag_filters=integration'
credential-helper: 'scripts/internal/qnx_creds.py'
environment-name: 'workflow-approval'
secrets:
score-qnx-license: ${{ secrets.SCORE_QNX_LICENSE }}
score-qnx-user: ${{ secrets.SCORE_QNX_USER }}
score-qnx-password: ${{ secrets.SCORE_QNX_PASSWORD }}
steps:
- name: Clean disk space
uses: eclipse-score/more-disk-space@6a3b48901846bf7f8cc985925157d71a8973e61f # v1
with:
level: 4

- name: Checkout repository (Handle all events)
uses: actions/checkout@v4.2.2
with:
ref: ${{ github.head_ref || github.event.pull_request.head.ref || github.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}

- name: Setup Bazel with shared caching
uses: bazel-contrib/setup-bazel@0.18.0
with:
bazelisk-version: 1.26.0
disk-cache: true
repository-cache: true
bazelisk-cache: true
cache-save: ${{ github.event_name == 'merge_group' }}

- uses: eclipse-score/cicd-actions/unblock-user-namespace-for-linux-sandbox@30ed908edcf367bc38ebff5b386a244f9b6417a7 # 2025-06-04

- name: Setup QNX SDP usage
uses: eclipse-score/cicd-actions/setup-qnx-sdp@a2b3c36fc7d1b9d03880d19935c7ac9cfffe58c6 # 2026-05-19
with:
qnx-license: ${{ secrets.SCORE_QNX_LICENSE }}
qnx-user: ${{ secrets.SCORE_QNX_USER }}
qnx-password: ${{ secrets.SCORE_QNX_PASSWORD }}
qnx-credential-helper: scripts/internal/qnx_creds.py
qnx-license-dir: /opt/score_qnx/license

- name: Install qemu
run: |
sudo apt-get update
sudo apt-get install -y qemu-system

- name: Enable KVM group permissons
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm

- name: Allow unprivileged user namespaces
run: |
sudo sysctl kernel.apparmor_restrict_unprivileged_userns=0

- name: Run integration tests
run: |
set -euo pipefail

bazel test --config x86_64-qnx \
--credential_helper=*.qnx.com="${QNX_CREDENTIAL_HELPER}" \
--lockfile_mode=error --test_tag_filters=integration --test_output=all -- \
//score/test/component/...

- name: Upload QNX ITF test logs
if: always()
uses: actions/upload-artifact@v6
with:
name: qnx-itf-test-logs
path: |
bazel-testlogs/**/test.log
bazel-testlogs/**/test.outputs/**
if-no-files-found: warn
retention-days: 7

- name: Cleanup QNX license
if: always()
run: sudo rm -rf /opt/score_qnx
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,11 @@ toybox
#############################################
### Tools ###
#############################################
awk
devb-ram
devc-pty
fsevmgr
if_up
ifconfig
ln
mkqnx6fs
mqueue
pci-server
Expand Down
8 changes: 5 additions & 3 deletions score/test/component/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pkg_tar(
"@score_itf//third_party/dlt:dlt-receive",
],
target_compatible_with = ["@platforms//os:linux"],
visibility = ["//score/test/component:__subpackages__"],
visibility = ["//score/test:__subpackages__"],
)

pkg_tar(
Expand All @@ -42,7 +42,7 @@ pkg_tar(
pkg_tar(
name = "datarouter_pkg",
target_compatible_with = ["@platforms//os:linux"],
visibility = ["//score/test/component:__subpackages__"],
visibility = ["//score/test:__subpackages__"],
deps = [
":_datarouter_bin_pkg",
":_datarouter_conf_pkg",
Expand All @@ -53,6 +53,7 @@ py_library(
name = "logging_plugin_lib",
srcs = ["logging_plugin.py"],
imports = ["."],
target_compatible_with = ["@platforms//os:linux"],
deps = ["@score_itf//score/itf/plugins/dlt"],
)

Expand All @@ -63,5 +64,6 @@ py_itf_plugin(
],
py_library = ":logging_plugin_lib",
tags = ["integration"],
visibility = ["//score/test/component:__subpackages__"],
target_compatible_with = ["@platforms//os:linux"],
visibility = ["//score/test:__subpackages__"],
)
1 change: 1 addition & 0 deletions score/test/component/datarouter/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ filegroup(
py_logging_itf_test(
name = "test_datarouter_filters",
srcs = ["test_datarouter_filters.py"],
extra_oci_tars = ["//score/test/component/filters_app:filtertest_classid_pkg"],
filesystem = "//score/test/component/filters_app:filtertest_filesystem",
deps = ["@score_itf//score/itf/plugins/dlt"],
)
21 changes: 12 additions & 9 deletions score/test/component/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@ def _extend_list_in_kwargs(kwargs, key, values):
kwargs[key] = kwargs.get(key, []) + values
return kwargs

def py_logging_itf_test(name, srcs, filesystem, **kwargs):
def py_logging_itf_test(name, srcs, filesystem, extra_oci_tars = None, **kwargs):
"""Integration test macro for score_logging (Docker and QNX).

Args:
name: Test target name.
srcs: Python test source files.
filesystem: pkg_tar target with test-specific binaries and configs.
extra_oci_tars: Optional list of additional pkg_tar targets to include
in the Docker OCI image only (not added to the QNX IFS).
**kwargs: Forwarded to py_itf_test.
"""
image_name = "_image_{}".format(name)
Expand All @@ -41,7 +43,7 @@ def py_logging_itf_test(name, srcs, filesystem, **kwargs):
"//score/test/component:dlt_pkg",
"//score/test/component:datarouter_pkg",
filesystem,
],
] + (extra_oci_tars or []),
target_compatible_with = ["@platforms//os:linux"],
)

Expand All @@ -56,20 +58,21 @@ def py_logging_itf_test(name, srcs, filesystem, **kwargs):
qnx_ifs(
name = qnx_image,
srcs = [
filesystem,
"//score/datarouter:datarouter",
"//score/test/component/datarouter:datarouter_test_config_files",
"{}:qnx8_qemu_env".format(_ENV),
],
tars = {
"FILESYSTEM": filesystem,
},
build_file = "{}:init_build".format(_ENV),
ext_repo_maping = {
"FILESYSTEM": "$(location {})".format(filesystem),
"DATAROUTER": "$(location //score/datarouter:datarouter)",
},
target_compatible_with = select({
"@platforms//cpu:x86_64": ["@platforms//cpu:x86_64"],
"@platforms//cpu:arm64": ["@platforms//cpu:arm64"],
}) + ["@platforms//os:qnx"],
target_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:qnx",
],
)

_extend_list_in_kwargs(kwargs, "data", select({
Expand Down Expand Up @@ -104,7 +107,7 @@ def py_logging_itf_test(name, srcs, filesystem, **kwargs):
kwargs["size"] = "enormous"

if "timeout" not in kwargs:
kwargs["timeout"] = "short"
kwargs["timeout"] = "moderate"

py_itf_test(
name = name,
Expand Down
2 changes: 1 addition & 1 deletion score/test/component/dlt_generator_app/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pkg_tar(

pkg_tar(
name = "dlt_generator_filesystem",
visibility = ["//score/test/component:__subpackages__"],
visibility = ["//score/test:__subpackages__"],
deps = [
":dlt_generator_bin_pkg",
":dlt_generator_config_pkg",
Expand Down
8 changes: 7 additions & 1 deletion score/test/component/filters_app/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,20 @@ pkg_tar(
name = "filtertest_classid_pkg",
srcs = ["etc/class-id.json"],
package_dir = "bmw/platform/opt/datarouter/etc",
visibility = ["//score/test/component:__subpackages__"],
)

filegroup(
name = "class_id_json",
srcs = ["etc/class-id.json"],
visibility = ["//score/test/component:__subpackages__"],
)

pkg_tar(
name = "filtertest_filesystem",
visibility = ["//score/test/component:__subpackages__"],
deps = [
":filtertest_bin_pkg",
":filtertest_classid_pkg",
":filtertest_config_pkg",
],
)
Loading