ALT-F4-LLC / ALT-F4-LLC/vorpal

Add unit-test coverage for the core build engine (worker, store, registry backends)

Abierto
#499 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Rust
Estrellas
124
Forks
13
Merge medio
10 h 39 min
PR fusionados (30 d)
11

Descripción

## Summary

Unit-test coverage is concentrated in a few modules (`start/auth.rs`, `start/registry.rs`, `sdk/rust/src/context.rs` — ~41 test fns across 3 files). The core build orchestration is effectively untested at the unit level and is only exercised indirectly by the end-to-end cross-SDK reproducibility gate in CI.

The e2e digest check is excellent for catching end-state divergence, but it does not pin down unit-level logic bugs, and it makes refactoring the engine high-risk because a regression only surfaces as a whole-build failure.

## Gaps (highest-value first)

- [ ] **Worker** (`cli/src/command/start/worker.rs`, ~1k LOC) — especially the output-rewriting / UTF-8 char-boundary logic around `worker.rs:397-415`, which is exactly the kind of fiddly code that panics on edge cases.
- [ ] **Store** (`cli/src/command/store/*`) — content-addressed hashing, store-path resolution, archive/temp handling.
- [ ] **Registry archive/artifact backends** — local and S3 (`start/registry/archive/{local,s3}.rs`, `start/registry/artifact/{local,s3}.rs`).
- [ ] **Agent** (`cli/src/command/start/agent.rs`) — request handling and lock/source-digest comparison logic.

## Approach

`start/registry.rs` already establishes the right pattern to copy: a `trait ArchiveBackend` / `trait ArtifactBackend` with a `MockBackend` and ~14 table-style tests. Extend that trait-mock approach to the worker/store/backend modules so the engine can be tested without a live daemon or S3.

Suggested follow-ups:
- Surface `cargo test` results as a first-class CI signal (the `build` job already runs `make test`, but coverage isn't tracked).
- Consider a coverage tool (e.g. `cargo llvm-cov`) to set a baseline and prevent regressions.

## Why it matters

This de-risks every future engine refactor and directly supports the panic-removal work in #226 — most of the `unwrap()/expect()` call sites that need converting live in exactly these untested modules.

_Filed as a follow-up to a project review._

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.