Skip to content
Open
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
10 changes: 7 additions & 3 deletions .github/workflows/coverage_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,13 @@ jobs:
unique-cache-name: ${{ github.workflow }}-${{ github.job }}
- name: Run Bazel Coverage
run: |
readarray -t TARGETS < <(python3 -c \
"import json; [print(t) for t in json.load(open('score/config_management/deps_acceptlist.json'))['test_targets']]")
bazel coverage --config=host_gcc "${TARGETS[@]}"
bazel coverage \
--config=host_gcc \
--test_tag_filters=-mw_com \
//score/config_management/... \
-- \
-//score/config_management/config_provider/... \
-//score/config_management/dependability/...
- name: Generate HTML Coverage Report
run: |
genhtml "$(bazel info output_path)/_coverage/_coverage_report.dat" \
Expand Down
96 changes: 0 additions & 96 deletions .github/workflows/deps-acceptlist-check.yml

This file was deleted.

11 changes: 7 additions & 4 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,14 @@ jobs:
# the bazel-target depends on your repo specific docs_targets configuration (e.g. "suffix")
# --define=LOBSTER_SOURCE_ROOT sets the GitHub blob URL prefix for source links in the LOBSTER traceability report
# TEMPORARY WORKAROUND (patch): score/config_management/** is synced from an internal source and cannot be
# edited directly from OSS, so the LOBSTER unit() wiring lives only in bazel/patches/wire_unit_test_to_lobster.patch.
# edited directly from OSS, so this fix lives only as a patch applied here:
# - bazel/patches/wire_unit_test_to_lobster.patch: the LOBSTER unit() wiring (config_daemon_app_unit /
# config_provider_details_unit) that score/config_management/dependability/BUILD's component() targets
# reference.
# The reusable docs workflow exposes no pre-build hook, so we apply the patch as a side effect of a
# command substitution (redirected to stderr so it contributes nothing to the bazel command line) before
# `bazel run` executes, purely so the generated report reflects the intended wiring. The --check guard
# makes this a no-op (skips silently) once the real change lands via sync, so it never fails the build.
# Remove this workaround once the patch's content is synced into score/config_management/ for real.
# `bazel run` executes. The --check guard makes this a no-op (skips silently) once the real change lands
# via sync, so it never fails the build. Remove this workaround once the patch's content is synced into
# score/config_management/ for real.
bazel-target: "$(git apply --check bazel/patches/wire_unit_test_to_lobster.patch 2>/dev/null && git apply bazel/patches/wire_unit_test_to_lobster.patch 1>&2) //:docs --define=LOBSTER_SOURCE_ROOT=https://github.com/${{ github.repository_owner }}/${{ github.event.repository.name }}/blob/main/ -- --github_user=${{ github.repository_owner }} --github_repo=${{ github.event.repository.name }}"
retention-days: 3
40 changes: 4 additions & 36 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,40 +42,8 @@ jobs:
repository-cache: true
cache-save: ${{ github.event_name == 'push' }}

- name: Run clang-tidy checks from deps_acceptlist.json
- name: Run clang-tidy checks
run: |
python3 - <<'PYEOF'
import json, subprocess, sys

ACCEPTLIST = "score/config_management/deps_acceptlist.json"

with open(ACCEPTLIST) as f:
targets = json.load(f)["clang_tidy_targets"]

failures = []
for target in targets:
try:
result = subprocess.run(
["bazel", "build", target],
capture_output=True, text=True,
timeout=600,
)
except subprocess.TimeoutExpired:
failures.append(target)
print(f" TIMEOUT {target}")
continue
if result.returncode == 0:
print(f" OK {target}")
else:
failures.append(target)
print(f" FAIL {target}")
print(result.stderr[-2000:])

print(f"\n{len(targets) - len(failures)}/{len(targets)} clang-tidy targets passed.")

if failures:
print("\nStatic analysis failed for the following targets:")
for t in failures:
print(f" {t}")
sys.exit(1)
PYEOF
bazel build \
//score/config_management/config_daemon:clang_tidy_extra_checks \
//score/config_management/config_provider:clang_tidy_extra_checks
54 changes: 8 additions & 46 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,50 +42,12 @@ jobs:
repository-cache: true
cache-save: ${{ github.event_name == 'push' }}

- name: Pre-warm Bazel cache (build test targets before running them)
- name: Run all unit tests
run: |
python3 - <<'PYEOF'
import json, subprocess, sys
with open("score/config_management/deps_acceptlist.json") as f:
targets = json.load(f)["test_targets"]
result = subprocess.run(["bazel", "build"] + targets)
sys.exit(result.returncode)
PYEOF

- name: Run tests from deps_acceptlist.json
run: |
python3 - <<'PYEOF'
import json, subprocess, sys

ACCEPTLIST = "score/config_management/deps_acceptlist.json"

with open(ACCEPTLIST) as f:
targets = json.load(f)["test_targets"]

failures = []
for target in targets:
try:
result = subprocess.run(
["bazel", "test", target],
capture_output=True, text=True,
timeout=600,
)
except subprocess.TimeoutExpired:
failures.append(target)
print(f" TIMEOUT {target}")
continue
if result.returncode == 0:
print(f" PASS {target}")
else:
failures.append(target)
print(f" FAIL {target}")
print(result.stderr[-2000:])

print(f"\n{len(targets) - len(failures)}/{len(targets)} tests passed.")

if failures:
print("\nTests failed for the following targets:")
for t in failures:
print(f" {t}")
sys.exit(1)
PYEOF
bazel test \
--config=host_gcc \
--test_tag_filters=-mw_com \
//score/config_management/... \
-- \
-//score/config_management/config_provider/... \
-//score/config_management/dependability/...
53 changes: 0 additions & 53 deletions score/config_management/deps_acceptlist.json

This file was deleted.

Loading