Skip to content

Commit 18f68ac

Browse files
committed
feat: real cfs test
1 parent 2925cdd commit 18f68ac

12 files changed

Lines changed: 878 additions & 360 deletions

.github/workflows/ci.yml

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -59,50 +59,3 @@ jobs:
5959
python -m pip install dist/*.whl
6060
cfs-msgid-sentinel --help
6161
cfs-msgid-sentinel --scan-path tests/fixtures --topicid-pattern "**/real/*_topicids.h" --format json > /dev/null
62-
63-
dogfood:
64-
name: Dogfood (Action)
65-
runs-on: ubuntu-latest
66-
needs: test
67-
steps:
68-
- uses: actions/checkout@v4
69-
70-
- name: Run sentinel against real fixtures (clean bundle)
71-
uses: ./
72-
id: clean-check
73-
with:
74-
scan-paths: tests/fixtures
75-
topicid-pattern: "**/real/*_topicids.h"
76-
msgid-pattern: "**/*_msgids.h"
77-
fail-on-collision: "true"
78-
near-miss-gap: "0"
79-
report-format: "both"
80-
81-
- name: Verify clean bundle produced 0 collisions
82-
shell: bash
83-
run: |
84-
echo "Collision count: ${{ steps.clean-check.outputs.collision-count }}"
85-
echo "Has collisions: ${{ steps.clean-check.outputs.has-collisions }}"
86-
if [ "${{ steps.clean-check.outputs.has-collisions }}" = "true" ]; then
87-
echo "::error::Expected 0 collisions on real cFS fixtures"
88-
exit 1
89-
fi
90-
91-
- name: Run sentinel against collision fixtures
92-
uses: ./
93-
id: collision-check
94-
with:
95-
scan-paths: tests/fixtures
96-
topicid-pattern: "**/collision_app_*_topicids.h"
97-
msgid-pattern: "**/*_msgids.h"
98-
fail-on-collision: "false"
99-
report-format: "both"
100-
101-
- name: Verify collision fixtures produce collisions
102-
shell: bash
103-
run: |
104-
echo "Collision count: ${{ steps.collision-check.outputs.collision-count }}"
105-
if [ "${{ steps.collision-check.outputs.has-collisions }}" != "true" ]; then
106-
echo "::error::Expected collisions on collision fixtures but found none"
107-
exit 1
108-
fi

.github/workflows/msgtestci.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: MsgID Tests
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- "src/cfs_msgid_sentinel/**"
7+
- "action.yml"
8+
- "scripts/generate_collision_lab_apps.py"
9+
- "scripts/verify_expected_collisions.py"
10+
- "expected_collisions.json"
11+
- "pyproject.toml"
12+
- ".github/workflows/msgtestci.yml"
13+
push:
14+
branches: [main]
15+
paths:
16+
- "src/cfs_msgid_sentinel/**"
17+
- "action.yml"
18+
- "scripts/generate_collision_lab_apps.py"
19+
- "scripts/verify_expected_collisions.py"
20+
- "expected_collisions.json"
21+
- "pyproject.toml"
22+
- ".github/workflows/msgtestci.yml"
23+
workflow_dispatch:
24+
25+
jobs:
26+
dogfood:
27+
name: Dogfood (Action fixtures)
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v4
31+
32+
- name: Run sentinel against real fixtures (clean bundle)
33+
uses: ./
34+
id: clean-check
35+
with:
36+
scan-paths: tests/fixtures
37+
topicid-pattern: "**/real/*_topicids.h"
38+
msgid-pattern: "**/*_msgids.h"
39+
fail-on-collision: "true"
40+
near-miss-gap: "0"
41+
report-format: "both"
42+
43+
- name: Verify clean bundle produced 0 collisions
44+
shell: bash
45+
run: |
46+
echo "Collision count: ${{ steps.clean-check.outputs.collision-count }}"
47+
echo "Has collisions: ${{ steps.clean-check.outputs.has-collisions }}"
48+
if [ "${{ steps.clean-check.outputs.has-collisions }}" = "true" ]; then
49+
echo "::error::Expected 0 collisions on real cFS fixtures"
50+
exit 1
51+
fi
52+
53+
- name: Run sentinel against collision fixtures
54+
uses: ./
55+
id: collision-check
56+
with:
57+
scan-paths: tests/fixtures
58+
topicid-pattern: "**/collision_app_*_topicids.h"
59+
msgid-pattern: "**/*_msgids.h"
60+
fail-on-collision: "false"
61+
report-format: "both"
62+
63+
- name: Verify collision fixtures produce collisions
64+
shell: bash
65+
run: |
66+
echo "Collision count: ${{ steps.collision-check.outputs.collision-count }}"
67+
if [ "${{ steps.collision-check.outputs.has-collisions }}" != "true" ]; then
68+
echo "::error::Expected collisions on collision fixtures but found none"
69+
exit 1
70+
fi
71+
if [ "${{ steps.collision-check.outputs.collision-count }}" = "0" ]; then
72+
echo "::error::Expected collision-count > 0 but got 0"
73+
exit 1
74+
fi
75+
76+
collision-lab:
77+
name: Collision lab (clone cFS + strict verify)
78+
runs-on: ubuntu-latest
79+
steps:
80+
- uses: actions/checkout@v4
81+
82+
- uses: actions/setup-python@v5
83+
with:
84+
python-version: "3.12"
85+
86+
- name: Install dependencies
87+
run: pip install -e ".[dev]"
88+
89+
- name: Generate collision lab apps (auto-clone cFS)
90+
run: python scripts/generate_collision_lab_apps.py --cfs-root cFS --clone-if-missing --count 10 --prefix msgid_collision
91+
92+
- name: Verify expected collisions (strict)
93+
run: python scripts/verify_expected_collisions.py --expected expected_collisions.json --scan-root cFS/apps
94+
95+
- name: Smoke scan upstream cFS apps (JSON parses)
96+
shell: bash
97+
run: |
98+
cfs-msgid-sentinel --scan-path cFS/apps --topicid-pattern "**/*_topicids.h" --format json --no-color --no-fail-on-collision > /tmp/cfs_apps.json
99+
python -c "import json; json.load(open('/tmp/cfs_apps.json','r',encoding='utf-8'))"
100+

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ htmlcov/
1313
.venv/
1414
.venv-verify/
1515
.venv-smoke-local/
16+
.venv-smoke-ci/
1617
.hypothesis/
1718
quality_report.txt
1819

1920
# Tool outputs / local artifacts
2021
collusion-report.txt
22+
expected_collisions.json
2123

2224
# Editor/IDE
2325
.vscode/
@@ -32,3 +34,6 @@ pip-wheel-metadata/
3234
# Optional local env files
3335
.env
3436
.env.*
37+
38+
# Local clone of NASA cFS (intentionally untracked)
39+
cFS/

0 commit comments

Comments
 (0)