test(BA-6953): add component tests for the kernel scheduling-history REST v2 endpoints#12997
Draft
jopemachine wants to merge 3 commits into
Draft
Conversation
Add the kernel slice of the Strawberry scheduling-history schema, mirroring the session, deployment, and route slices: - `adminKernelSchedulingHistories` — super-admin, system-wide - `kernelScopedSchedulingHistories` — scoped to one kernel via `KernelScope` The node exposes `kernel` and `session` back-references through the existing data loaders, and `resolve_nodes` is backed by a new `kernel_history_loader` over `batch_load_kernel_histories_by_ids`. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…mmands Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…REST v2 endpoints Drive both kernel routes through the v2 SDK against a real aiohttp server and DB, covering routing, the auth middleware on each route, and request/response serialization. The layers below are unit-tested, but nothing exercised the HTTP boundary for these two routes. The directory conftest previously registered only the v1 route tree; it now mounts the v2 sub-registry as well, so both suites share one server. `kernel_scheduling_history` has no writer yet (BA-6852), so the fixture seeds rows directly, alongside real kernel rows the scoped endpoint's existence check needs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jul 21, 2026
jopemachine
force-pushed
the
feat/BA-6893-kernel-history-sdk-cli
branch
2 times, most recently
from
July 22, 2026 06:50
5d15d5b to
b1f701f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📚 Stacked PRs
BA-6887fix: kernel history conditions reference the real status columns ✅BA-6889models: kernel query conditions and orders ✅BA-6890repository: kernel search scope and scoped search ✅BA-6891DTO + service: kernel v2 DTOs and search actions ✅BA-6892adapter + REST v2: kernel endpoints ✅BA-6883GraphQL v2: kernel history rootsBA-6893SDK + CLI: kernel commandsBA-6953component tests: kernel REST v2 endpoints ← you are hereMerge in order, bottom-up. Each PR is based on the one above it, so its diff shows only its own layer.
Resolves #12994 (BA-6953)
Summary
V2SchedulingHistoryClientagainst a real aiohttp server and DB:/kernels/admin/searchand/kernels/scoped/search. The layers below are unit-tested, but nothing exercised the HTTP boundary for these two.tests/component/AGENTS.mdscopes to this layer — routing, the auth middleware on each route, and request/response serialization — rather than re-testing filter semantics thattests/unitalready owns.kernel_scheduling_historyhas no writer yet (BA-6852), so the fixture seeds history rows directly, alongside the realkernels/sessionsrows the scoped endpoint's existence check needs.Unlike the existing v1 tests in this directory, which assert only that the response shape is valid against an empty table, these seed data and assert on actual rows — two kernels under one session, three history rows on one and one on the other, so scoping is observable rather than vacuous.
Writing them caught two things that unit tests had not:
from_status/to_statusmust be validKernelSchedulingPhasemembers (a"PENDING"seed produced a 500), andSessionRowrequiresdomain_idalongsidedomain_name.Test plan
tests/component/scheduling_history/test_kernel_history_v2.py— 8 passedruff check/ruff formatcleanBUILDalready present in the directory; no new test directory added🤖 Generated with Claude Code