Skip to content

Commit e5213ee

Browse files
committed
restructure component tests and add separate workflow
1 parent e588e7e commit e5213ee

19 files changed

Lines changed: 163 additions & 64 deletions

File tree

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# ********************************************************************************
2+
# Copyright (c) 2025 Contributors to the Eclipse Foundation
3+
#
4+
# See the NOTICE file(s) distributed with this work for additional
5+
# information regarding copyright ownership.
6+
#
7+
# This program and the accompanying materials are made available under the
8+
# terms of the Apache License Version 2.0 which is available at
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# SPDX-License-Identifier: Apache-2.0
12+
# ********************************************************************************
13+
14+
name: Component Tests
15+
16+
on:
17+
schedule:
18+
# Run nightly at 02:00 UTC
19+
- cron: "0 2 * * *"
20+
workflow_dispatch: {}
21+
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
25+
jobs:
26+
component-tests:
27+
name: Run Component Tests
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout code
31+
uses: actions/checkout@v4.2.2
32+
33+
- name: Setup Bazel
34+
uses: bazel-contrib/setup-bazel@0.15.0
35+
with:
36+
bazelisk-version: 1.26.0
37+
disk-cache: true
38+
repository-cache: true
39+
bazelisk-cache: true
40+
41+
- name: Bazel info (discover paths)
42+
id: bazel-info
43+
run: |
44+
echo "BAZEL_OUTPUT_BASE=$(bazel info output_base)" >> $GITHUB_ENV
45+
echo "BAZEL_REPO_CACHE=$(bazel info repository_cache)" >> $GITHUB_ENV
46+
bazel info
47+
48+
- name: Cache Bazel output base
49+
uses: actions/cache@v4
50+
with:
51+
path: |
52+
${{ env.BAZEL_OUTPUT_BASE }}/action_cache
53+
${{ env.BAZEL_OUTPUT_BASE }}/bazel-out
54+
${{ env.BAZEL_OUTPUT_BASE }}/external
55+
${{ env.BAZEL_OUTPUT_BASE }}/execroot
56+
key: bazel-ob-component-v1-${{ runner.os }}-${{ hashFiles('.bazelversion', 'MODULE.bazel', 'MODULE.bazel.lock', '**/*.bzl') }}
57+
restore-keys: |
58+
bazel-ob-component-v1-${{ runner.os }}-
59+
60+
- name: Run component tests
61+
run: |
62+
bazel test --lockfile_mode=error --config x86_64-linux \
63+
--test_tag_filters=integration \
64+
--test_output=errors \
65+
//score/test/component/...
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# ********************************************************************************
2+
# Copyright (c) 2025 Contributors to the Eclipse Foundation
3+
#
4+
# See the NOTICE file(s) distributed with this work for additional
5+
# information regarding copyright ownership.
6+
#
7+
# This program and the accompanying materials are made available under the
8+
# terms of the Apache License Version 2.0 which is available at
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# SPDX-License-Identifier: Apache-2.0
12+
# ********************************************************************************
13+
14+
load("//score/test/component:defs.bzl", "py_logging_itf_test")
15+
16+
py_logging_itf_test(
17+
name = "test_datarouter_filters",
18+
srcs = ["test_datarouter_filters.py"],
19+
filesystem = "//score/test/component/filters_app:filtertest_filesystem",
20+
target_compatible_with = select({
21+
"//score/datarouter/build_configuration_flags:config_datarouter_nonverbose_dlt": [],
22+
"//conditions:default": ["@platforms//:incompatible"],
23+
}),
24+
deps = ["@score_itf//score/itf/plugins/dlt"],
25+
)

score/test/component/filters/test_datarouter_filters.py renamed to score/test/component/datarouter/test_datarouter_filters.py

File renamed without changes.

score/test/component/mw_log_kfile/BUILD renamed to score/test/component/dlt_generator_app/BUILD

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# *******************************************************************************
1+
# ********************************************************************************
22
# Copyright (c) 2025 Contributors to the Eclipse Foundation
33
#
44
# See the NOTICE file(s) distributed with this work for additional
@@ -9,11 +9,10 @@
99
# https://www.apache.org/licenses/LICENSE-2.0
1010
#
1111
# SPDX-License-Identifier: Apache-2.0
12-
# *******************************************************************************
12+
# ********************************************************************************
1313

1414
load("@rules_cc//cc:cc_binary.bzl", "cc_binary")
1515
load("@rules_pkg//pkg:tar.bzl", "pkg_tar")
16-
load("//score/test/component:defs.bzl", "py_logging_itf_test")
1716

1817
cc_binary(
1918
name = "dlt_generator",
@@ -35,17 +34,9 @@ pkg_tar(
3534

3635
pkg_tar(
3736
name = "dlt_generator_filesystem",
37+
visibility = ["//score/test/component:__subpackages__"],
3838
deps = [
3939
":dlt_generator_bin_pkg",
4040
":dlt_generator_config_pkg",
4141
],
4242
)
43-
44-
py_logging_itf_test(
45-
name = "test_mw_log_kfile",
46-
srcs = ["test_mw_log_kfile.py"],
47-
filesystem = ":dlt_generator_filesystem",
48-
deps = [
49-
"@score_itf//third_party/python_dlt",
50-
],
51-
)

score/test/component/mw_log_kfile/dlt_generator.cpp renamed to score/test/component/dlt_generator_app/dlt_generator.cpp

File renamed without changes.
File renamed without changes.
Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# *******************************************************************************
1+
# ********************************************************************************
22
# Copyright (c) 2025 Contributors to the Eclipse Foundation
33
#
44
# See the NOTICE file(s) distributed with this work for additional
@@ -9,20 +9,22 @@
99
# https://www.apache.org/licenses/LICENSE-2.0
1010
#
1111
# SPDX-License-Identifier: Apache-2.0
12-
# *******************************************************************************
12+
# ********************************************************************************
1313

1414
load("@rules_cc//cc:defs.bzl", "cc_binary")
1515
load("@rules_pkg//pkg:tar.bzl", "pkg_tar")
16-
load("//score/test/component:defs.bzl", "py_logging_itf_test")
1716

17+
# ---------------------------------------------------------------------------
18+
# mwfiltertest — used by mw_log verbose filter tests
19+
# ---------------------------------------------------------------------------
1820
cc_binary(
1921
name = "mwfiltertest",
2022
srcs = ["mwfiltertest.cpp"],
2123
deps = ["//score/mw/log"],
2224
)
2325

2426
pkg_tar(
25-
name = "mwfiltertest_pkg",
27+
name = "mwfiltertest_bin_pkg",
2628
srcs = [":mwfiltertest"],
2729
package_dir = "opt/test_apps/mwfiltertest/bin",
2830
)
@@ -35,19 +37,16 @@ pkg_tar(
3537

3638
pkg_tar(
3739
name = "mwfiltertest_filesystem",
40+
visibility = ["//score/test/component:__subpackages__"],
3841
deps = [
42+
":mwfiltertest_bin_pkg",
3943
":mwfiltertest_config_pkg",
40-
":mwfiltertest_pkg",
4144
],
4245
)
4346

44-
py_logging_itf_test(
45-
name = "test_mw_verbose_filters",
46-
srcs = ["test_mw_verbose_filters.py"],
47-
filesystem = ":mwfiltertest_filesystem",
48-
)
49-
50-
# NOTE: Requires --//score/datarouter/build_configuration_flags:enable_nonverbose_dlt=True
47+
# ---------------------------------------------------------------------------
48+
# filtertest — used by datarouter non-verbose filter tests
49+
# ---------------------------------------------------------------------------
5150
cc_binary(
5251
name = "filtertest",
5352
srcs = [
@@ -89,20 +88,10 @@ pkg_tar(
8988

9089
pkg_tar(
9190
name = "filtertest_filesystem",
91+
visibility = ["//score/test/component:__subpackages__"],
9292
deps = [
9393
":filtertest_bin_pkg",
9494
":filtertest_classid_pkg",
9595
":filtertest_config_pkg",
9696
],
9797
)
98-
99-
py_logging_itf_test(
100-
name = "test_datarouter_filters",
101-
srcs = ["test_datarouter_filters.py"],
102-
filesystem = ":filtertest_filesystem",
103-
target_compatible_with = select({
104-
"//score/datarouter/build_configuration_flags:config_datarouter_nonverbose_dlt": [],
105-
"//conditions:default": ["@platforms//:incompatible"],
106-
}),
107-
deps = ["@score_itf//score/itf/plugins/dlt"],
108-
)
File renamed without changes.

score/test/component/filters/etc/filtertest_logging.json renamed to score/test/component/filters_app/etc/filtertest_logging.json

File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)