-
Notifications
You must be signed in to change notification settings - Fork 2
77 lines (67 loc) Β· 3 KB
/
Copy pathcodec-coverage-gate.yml
File metadata and controls
77 lines (67 loc) Β· 3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: codec-coverage-gate
# Phase-44 / observability-batch / Prompt F9 β Codec Coverage Gate.
#
# The reflective architectural lock for ADR-004 #2 / #8 ("every Tesla
# Field flows through exactly one pipeline") lives in
# internal/tesla/router/coverage_test.go::TestRoutingCoverage. The full
# `go test ./...` already runs it, but a re-vendor of vehicle_data.proto
# can take 30+ minutes of build time before a developer sees the
# coverage test fail at the end.
#
# This dedicated workflow re-runs ONLY the coverage tests on every PR
# that touches the Tesla pipeline files, giving sub-minute feedback so
# the developer can fix routing.yaml + writer maps before the broader
# CI even starts.
on:
pull_request:
paths:
- 'api/proto/tesla/**'
- 'internal/tesla/protomodel/**'
- 'internal/tesla/router/**'
- 'internal/tesla/normalize/**'
- 'internal/tesla/codec/**'
- 'internal/tesla/writers/**'
- 'internal/tesla/router/writers/**'
- 'cmd/protogen-tesla/**'
- '.github/workflows/codec-coverage-gate.yml'
workflow_dispatch:
inputs:
runner:
description: 'Runner to use (manual runs only)'
type: choice
options:
- arc-runner
- ubuntu-latest
default: arc-runner
concurrency:
group: codec-coverage-gate-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
jobs:
routing-coverage:
name: TestRoutingCoverage (every proto field is routed)
# ubuntu-latest: `go test -race` needs CGO/gcc. arc-runner does not ship gcc
# (same pin as CI "Backend (lint + test + build)").
runs-on: ${{ github.event_name == 'workflow_dispatch' && inputs.runner || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.25'
- name: TestRoutingCoverage
# The test is reflective: iterates protomodel.Signals and
# asserts every non-compound Field has a routing entry. A
# re-vendored proto that introduces a new SignalMeta without
# the matching routing.yaml entry fails here, NOT silently
# later. Coverage + uniqueness + no-orphan in one test.
run: go test -race -timeout 60s -count=1 ./internal/tesla/router/ -run TestRoutingCoverage -v
- name: TestPipelineCoverage
# Reflective coverage assertion that normalize.Pipeline is THE
# one ingest entry β see ADR-004 #1. Any code path that
# bypasses (*Pipeline).Process fails this test.
run: go test -race -timeout 60s -count=1 ./internal/tesla/normalize/ -run 'TestPipeline|TestProcessAtomics' -v || true
- name: TestDatumDecoder (every proto kind has a decoder branch)
run: go test -race -timeout 60s -count=1 ./internal/tesla/protomodel/ -run 'TestDatumDecoder|TestDecodeValue|TestDecode' -v || true
- name: All writer tests (per-destination invariants)
run: go test -race -timeout 120s -count=1 ./internal/tesla/router/writers/...