Skip to content

Commit 730341f

Browse files
committed
test: wire test/framework packages into unit tests and coverage
The test/framework tree that #1188 introduces has no Makefile entry, so its packages would not run under make test-unit and would be absent from the coverage comparison. Wire the package set in before any helper moves land, so each follow-up move arrives with test execution and coverage already in place. The importas aliases for the planned framework packages are added in the same change: golangci-lint ignores entries for packages that do not exist yet, so the later moves do not each have to touch the lint config. Part of #1188 Signed-off-by: ChethanUK <chethanuk@outlook.com>
1 parent 62ae6ca commit 730341f

4 files changed

Lines changed: 72 additions & 2 deletions

File tree

.golangci.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,16 @@ linters:
8181
alias: errcommon
8282
- pkg: github.com/llm-d/llm-d-router/test/utils/igw
8383
alias: igwtestutils
84+
- pkg: github.com/llm-d/llm-d-router/test/framework/net
85+
alias: fwknet
86+
- pkg: github.com/llm-d/llm-d-router/test/framework/context
87+
alias: fwkcontext
88+
- pkg: github.com/llm-d/llm-d-router/test/framework/k8s
89+
alias: fwkk8s
90+
- pkg: github.com/llm-d/llm-d-router/test/framework/gaie
91+
alias: fwkgaie
92+
- pkg: github.com/llm-d/llm-d-router/test/framework/epp
93+
alias: fwkepp
8494
revive: # see https://github.com/mgechev/revive#available-rules for all options
8595
rules:
8696
- name: blank-imports

Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,11 @@ BASE_IMAGE ?=
163163
# test packages
164164
epp_TEST_PACKAGES = $$(go list ./... | grep -v /test/ | grep -v ./pkg/sidecar/ | grep -v ./pkg/coordinator/ | grep -v ./cmd/coordinator | tr '\n' ' ')
165165
sidecar_TEST_PACKAGES = ./pkg/sidecar/...
166+
# framework is intentionally absent from the worktree coverage-compare baseline
167+
# block (epp+sidecar only); CI's baseline cache unions all coverage/*.out, so
168+
# framework enters the CI baseline once this is on main. The PR run reports
169+
# coverage/framework.out as a new component.
170+
framework_TEST_PACKAGES = ./test/framework/...
166171

167172
# Internal variables for generic targets
168173
epp_IMAGE = $(EPP_IMAGE)
@@ -259,7 +264,7 @@ lint: image-build-builder ## Run lint (use LINT_NEW_ONLY=true to only check new
259264
test: test-unit test-e2e ## Run all tests (unit and e2e)
260265

261266
.PHONY: test-unit
262-
test-unit: test-unit-epp test-unit-sidecar ## Run unit tests
267+
test-unit: test-unit-epp test-unit-sidecar test-unit-framework ## Run unit tests
263268

264269
.PHONY: test-unit-%
265270
test-unit-%: image-build-builder
@@ -368,7 +373,7 @@ COVERAGE_LABEL ?= main
368373
BASE_REF ?= main
369374

370375
.PHONY: test-coverage
371-
test-coverage: test-unit-epp test-unit-sidecar ## Run all unit tests with coverage (alias for test-unit)
376+
test-coverage: test-unit ## Run all unit tests with coverage (alias for test-unit)
372377

373378
.PHONY: test-coverage-integration
374379
test-coverage-integration: test-integration ## Run integration tests with coverage (alias for test-integration)

test/framework/doc.go

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
Copyright 2026 The llm-d Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
// Package framework is the root of the shared test framework tree. Its
18+
// subpackages provide reusable test helpers layered by what they are
19+
// allowed to import:
20+
//
21+
// - R1: test/framework/{net,context,k8s} import only the standard
22+
// library, Kubernetes API/machinery packages, and logr. They never
23+
// import pkg/.
24+
// - R2: test/framework/gaie additionally imports GAIE/apix API types
25+
// and pkg/common/routing. It never imports pkg/epp.
26+
// - R3: test/framework/epp imports R1/R2 packages, leaf pkg/epp
27+
// packages (metadata), and pkg/common. It never imports
28+
// pkg/epp/server or cmd/.
29+
// - R4: test/framework/epp/harness may import anything; it is imported
30+
// only by test/integration/epp and e2e suites, never by pkg/ tests.
31+
// - R5: non-test code under pkg/ must not import test/framework.
32+
package framework

test/framework/framework_test.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
Copyright 2026 The llm-d Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package framework
18+
19+
import "testing"
20+
21+
// TestFrameworkPackageWired exists so the package reports "ok" (not "? [no test
22+
// files]") in test-unit output, proving the Makefile wiring executes it.
23+
func TestFrameworkPackageWired(t *testing.T) {}

0 commit comments

Comments
 (0)