Commit graph

7 commits

Author SHA1 Message Date
matt wilkie
0da87e1c6c test: share embedded command stream helper
Add a shared runCommandBuffers helper for embedded subprocess tests so the PR keeps stdout/stderr separation without repeating buffer setup in every JSON-output test.

_codex-gpt-5- on behalf of matt wilkie_
2026-05-16 21:07:12 -07:00
Jim Wordelman
88e13542e6 test(embedded): split stdout/stderr in all JSON-parsing helpers (be-0ya2oe)
PR #3909 introduced an auto-export warning written to stderr. Tests that
called CombinedOutput() and then parsed the result as JSON would choke
on the warning text mixed into stdout.

Apply the pattern already established in list_embedded_test.go: for every
helper or inline call site that parses JSON or an ID from stdout, capture
stdout and stderr in separate bytes.Buffers and parse only stdout.

Covers 66 test files including duplicates, update, lint, todo, label,
count, swarm, close, list, status, types, find-duplicates, and more.

Closes TestEmbeddedDuplicates/dry_run and TestEmbeddedUpdate/update_json_output
failures from CI run 25967558419 and 25962887732.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 15:37:59 -07:00
matt wilkie
f443df1f2a
fix: resolve CI failures from flock, version bump, and lint (#2981)
* fix: resolve CI failures from flock, version bump, and lint

Three categories of CI failure on main after the v1.0.0 release:

1. rules.go lint/format: Fix gofmt alignment, errcheck on tw.Flush(),
   gosec G304 (add nosec comment), gosec G306 (use 0o600 perms).

2. doctor_test.go version tracking: The 'slightly outdated version'
   test used 0.55.0 which now has a major version diff from 1.0.0,
   correctly triggering a warning. Update expected status to match.

3. Embedded Dolt concurrent tests: The exclusive flock from #2571
   causes concurrent bd processes to fail with 'one writer at a time'.
   Update 58 concurrent test files to tolerate this expected error
   while still failing on unexpected errors and panics.

Amp-Thread-ID: https://ampcode.com/threads/T-019d5386-b41e-7138-bc81-6ea331b80760
Co-authored-by: Amp <amp@ampcode.com>

* fix: concurrent test post-conditions tolerate flock contention

With exclusive flock (commit 543e1943), only some workers can acquire
the lock in concurrent tests. Update post-conditions in 5 tests to:
- Only verify side effects from workers that succeeded (r.err == nil)
- Require at least 1 worker succeeds (fail if all hit flock)
- Log success/failure counts for visibility
- Still verify correct behavior for successful operations

Tests fixed:
- TestEmbeddedCloseConcurrent: remove Fatalf on failures, skip total count check
- TestEmbeddedDeferConcurrent: only check deferred status for successful workers
- TestEmbeddedUndeferConcurrent: only check open status for successful workers
- TestEmbeddedReopenConcurrent: only check open status for successful workers
- TestEmbeddedPromoteCLIConcurrent: only check permanent for successful workers

Amp-Thread-ID: https://ampcode.com/threads/T-019d5386-b41e-7138-bc81-6ea331b80760
Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019d5386-b41e-7138-bc81-6ea331b80760
Co-authored-by: Amp <amp@ampcode.com>

---------

Co-authored-by: Amp <amp@ampcode.com>
2026-04-03 07:27:00 -07:00
matt wilkie
59b49c45f0 fix: add missing //go:build cgo tags to embedded test files and cmd
Several test files and one main.go that depend on CGO-only types
(EmbeddedDoltStore methods like Close, CreateIssue, GetIssue) were
missing //go:build cgo build tags, causing compilation failures when
building with CGO_ENABLED=0.

Files fixed:
- 67 cmd/bd/*_embedded_test.go files
- cmd/bd/metadata_filter_test.go (uses newTestStore from cgo-tagged helper)
- cmd/bd/doctor/federation_test.go (uses doctorTestServerPort/testSharedDB)
- cmd/bd/doctor/fix/migrate_import_test.go (uses fixTestServerPort)
- 6 internal/storage/embeddeddolt/*_test.go files
- internal/storage/embeddeddolt/cmd/main.go

Amp-Thread-ID: https://ampcode.com/threads/T-019d4938-40d4-73ae-89d1-1891a19a9a15
Co-authored-by: Amp <amp@ampcode.com>
2026-04-01 07:08:41 -07:00
coffeegoddd☕️✨
a35edfd28e /{internal,cmd,.goreleaser,.github}: embedded mode by default 2026-03-28 13:47:20 -07:00
coffeegoddd☕️✨
cda9228ae1 /: bump driver to 1.84.0, paralleize embedded tests 2026-03-23 14:55:55 -07:00
coffeegoddd☕️✨
fda1e49cfe /cmd/bd: add tests for the remaining 2026-03-19 15:25:50 -07:00