Close integration testing gaps #12
Labels
No labels
agent
blocked
agent
new
agent
review
agent
working
complexity
high
complexity
low
priority
high
priority
low
priority
medium
risk
high
risk
low
risk
medium
type
bug
type
chore
type
feature
type
security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
tfks/dropbear#12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Testing gaps
Two gaps in the existing test suite, both at the storage boundary.
No real object storage smoke test in CI
internal/objectstore/s3.go(the minio-go-backed implementation) andinternal/objectstore/fake.goare exercised together only by the fake.ROADMAP.mdmentions "test against local object storage " but no.forgejo/workflows/job currently runs against a real S3-compatible backend.What's at risk:
PutObjectIfMatch,PutObjectIfNoneMatch) — the fake implements them; real S3-compatible backends implement them with subtly different ETag normalisation rules across providers.iter.Seq2-based pagination inList— behaviour with continuation tokens, prefix-delimited listings.ErrNotFounddirectly; the real backend returns minio-go errors that get wrapped.Proposed change: Add a
just test::integrationrecipe that runs the existing integration tests against a containerised object store. A Forgejo workflow gates it on PRs touchinginternal/objectstore/,internal/upload/,internal/gc/, orinternal/deviceregistry/. ~20 lines of YAML plus a small docker-compose for something like RustFS.No fault injection for the tombstone lifecycle
internal/upload/tombstone_recovery_test.gocovers state mid-lifecycle by constructing the bucket and SQLite into known intermediate shapes and asserting reconciliation converges. It does not test "kill the process at step boundary N and verify recovery from any N."What's at risk: The four-step lifecycle has four crash windows. A future change to the order (or the addition of a fifth step) needs to re-prove correctness at every window. Without a property-style test the proof is unstated.
Proposed change: A parameterised test that, for each step boundary (1-after-pending, 2-after-real, 3-after-delete-pending, 4-after-commit), forces the lifecycle to halt at that point, then runs
ReconcileTombstonesand asserts the post-state matches a full-publish run. Five cases, one parameterised test.This becomes much cheaper once tombstone-lifecycle-typed-pipeline lands — the lifecycle value can take a
haltAfterstep name and the test just iterates the four step names.Related: tombstone-lifecycle-typed-pipeline.