ci(bazel): split the slow embedded cmd tests and run the cmd block as 2x50 shards (#7438)

//cmd/bd:bd_embedded_test was the embedded lane's floor: at Bazel's 50-shard
cap per rule, each shard's wall time was its slowest top-level test, and
~40 tests ran 65-130s on rbe-west.

- 34 slow TestEmbedded* functions are split into 89 smaller top-level
  functions. Subtests and table cases are moved verbatim: no assertion,
  flag or data changes, the same t.Run set per file, the same skip guard and
  t.Parallel. Subtests that read state earlier ones left stay together, in
  order; each new function repeats the shared setup it needs.
- The manifest's cmd/bd block is now 100 shards, run by two targets:
  bd_embedded_test (shards 1-50) and the new bd_embedded_part2_test
  (51-100), through go_test_manifest_shard.sh --shard-offset/--shard-total.
  check_shard_coverage.py takes SHARDS@OFFSET/TOTAL and fails unless the
  targets' ranges tile the block exactly once, so every test runs in exactly
  one shard of one target; the policy tests read both rules' ranges from
  cmd/bd/BUILD.bazel.
- Durations re-measured on rbe-west with the split tests and repacked. The
  frozen legacy 20-shard block drops the renamed names (no workflow reads
  it; new names hash-distribute as before).

Not split: the *Concurrent stress tests (their bd subprocesses queue on the
workspace's single writer lock: TestEmbeddedUpdateConcurrent is ~100
serialized bd commands), TestEmbeddedPurgeWispsPlaneRetention (one stateful
sequence), and the MaxRowsList* tests (setup is 21 sequential creates every
subtest reads).

rbe-west, both targets, --nocache_test_results: slowest shard 138-163s ->
109s (TestEmbeddedUpdateConcurrent alone; every other shard <=86s), median
80-84s -> 40s, shard-seconds 4.1-4.4k -> 4.2k, critical path 213-306s ->
113s.

Bead: ga-vnycm2.17

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Julian Knutsen 2026-10-09 20:30:52 +00:00 • committed by GitHub
commit 0d865460b1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
33 changed files with 2084 additions and 1164 deletions

View file

@ -10,15 +10,11 @@
20 2 TestEmbeddedBackupConcurrent
20 3 TestEmbeddedBlocked
20 4 TestEmbeddedBlockedConcurrent
20 5 TestEmbeddedBootstrap
20 6 TestEmbeddedBootstrapConcurrent
20 7 TestEmbeddedBranch
20 8 TestEmbeddedBranchConcurrent
20 9 TestEmbeddedChildren
20 10 TestEmbeddedChildrenConcurrent
20 11 TestEmbeddedCloseBasic
20 11 TestEmbeddedCloseGuardsAndEpics
20 11 TestEmbeddedCloseAlreadyClosed
20 12 TestEmbeddedCloseConcurrent
20 13 TestEmbeddedComments
20 14 TestEmbeddedCommentsCLI
@ -31,7 +27,6 @@
20 1 TestEmbeddedConfigValidateJSONNoWorkspaceWritesStdout
20 2 TestEmbeddedContext
20 3 TestEmbeddedContextConcurrent
20 4 TestEmbeddedContributorCreate
20 5 TestEmbeddedCount
20 6 TestEmbeddedCountConcurrent
20 7 TestEmbeddedCreateScalarAndRelationships
@ -44,9 +39,6 @@
20 13 TestEmbeddedCreateWithGitRemote
20 14 TestEmbeddedDefer
20 15 TestEmbeddedDeferConcurrent
20 16 TestEmbeddedDelete
20 17 TestEmbeddedDepA
20 17 TestEmbeddedDepB
20 18 TestEmbeddedDepConcurrent
20 19 TestEmbeddedDiff
20 20 TestEmbeddedDiffConcurrent
@ -55,10 +47,8 @@
20 2 TestEmbeddedDoltConcurrent
20 3 TestEmbeddedDuplicate
20 4 TestEmbeddedDuplicateConcurrent
20 5 TestEmbeddedDuplicates
20 6 TestEmbeddedDuplicatesConcurrent
20 7 TestEmbeddedEpicStatus
20 7 TestEmbeddedEpicCloseEligible
20 7 TestEmbeddedEpicCloseEligibleReasonFlag
20 7 TestEmbeddedEpicCloseEligibleReasonOutput
20 8 TestEmbeddedEpicConcurrent
@ -72,11 +62,8 @@
20 14 TestEmbeddedFindDuplicatesConcurrent
20 15 TestEmbeddedFlatten
20 16 TestEmbeddedFlattenConcurrent
20 17 TestEmbeddedGC
20 18 TestEmbeddedGCConcurrent
20 19 TestEmbeddedGate
20 20 TestEmbeddedGateConcurrent
20 1 TestEmbeddedGateCreate
20 2 TestEmbeddedGetDependencies
20 3 TestEmbeddedGraph
20 4 TestEmbeddedGraphConcurrent
@ -84,27 +71,20 @@
20 6 TestEmbeddedHistoryConcurrent
20 7 TestEmbeddedHooks
20 8 TestEmbeddedHooksConcurrent
20 9 TestEmbeddedHuman
20 10 TestEmbeddedHumanConcurrent
20 11 TestEmbeddedImportFromSources
20 11 TestEmbeddedImportUpsertAndPrefixSync
20 12 TestEmbeddedImportConcurrent
20 13 TestEmbeddedInfo
20 14 TestEmbeddedInfoConcurrent
20 15 TestEmbeddedInitA
20 15 TestEmbeddedInitB
20 15 TestEmbeddedInitC
20 16 TestEmbeddedInitConcurrent
20 17 TestEmbeddedKV
20 18 TestEmbeddedKVConcurrent
20 19 TestEmbeddedLabelAddRemove
20 19 TestEmbeddedLabelEditReports
20 19 TestEmbeddedLabelPropagateRename
20 20 TestEmbeddedLabelConcurrent
20 1 TestEmbeddedLint
20 2 TestEmbeddedLintConcurrent
20 3 TestEmbeddedListFiltering
20 3 TestEmbeddedListSearchAndOutput
20 4 TestEmbeddedListConcurrent
20 13 TestEmbeddedMaxRowsListBasic
20 13 TestEmbeddedMaxRowsListLimitInteraction
@ -137,7 +117,6 @@
20 4 TestEmbeddedQuickConcurrent
20 5 TestEmbeddedQuickstart
20 6 TestEmbeddedQuickstartConcurrent
20 7 TestEmbeddedReady
20 8 TestEmbeddedReadyConcurrent
20 9 TestEmbeddedRenamePrefixBasic
20 9 TestEmbeddedRenamePrefixEdgeCases
@ -146,14 +125,12 @@
20 12 TestEmbeddedReopenConcurrent
20 13 TestEmbeddedRestore
20 14 TestEmbeddedRestoreConcurrent
20 15 TestEmbeddedSearch
20 16 TestEmbeddedSearchConcurrent
20 17 TestEmbeddedSetup
20 18 TestEmbeddedSetupConcurrent
20 19 TestEmbeddedShip
20 20 TestEmbeddedShipConcurrent
20 1 TestEmbeddedShowBasicsAndJSON
20 1 TestEmbeddedShowDetailAndCurrent
20 2 TestEmbeddedShowConcurrent
20 3 TestEmbeddedStale
20 4 TestEmbeddedStaleConcurrent
@ -163,7 +140,6 @@
20 8 TestEmbeddedStatusConcurrent
20 9 TestEmbeddedSupersede
20 10 TestEmbeddedSupersedeConcurrent
20 11 TestEmbeddedSwarm
20 12 TestEmbeddedSwarmConcurrent
20 13 TestEmbeddedTodo
20 14 TestEmbeddedTodoConcurrent
@ -171,8 +147,6 @@
20 16 TestEmbeddedTypesConcurrent
20 17 TestEmbeddedUndefer
20 18 TestEmbeddedUndeferConcurrent
20 19 TestEmbeddedUpdateFields
20 19 TestEmbeddedUpdateLifecycle
20 20 TestEmbeddedUpdateConcurrent
20 1 TestEmbeddedVCStatusAndCommit
20 1 TestEmbeddedVCCommitVariantsAndMerge
@ -186,14 +160,14 @@
#
# Format: <total_shards> <shard_number> <top_level_test_name>
#
# 50-shard split for the Bazel-only embedded-Dolt cmd tier
# 100-shard split for the Bazel-only embedded-Dolt cmd tier
# (bazel-embedded in .github/workflows/bazel.yml), bin-packed
# longest-first by measured wall-time from
# scripts/ci/embedded_cmd_test_durations.json (see that file for provenance
# and its "relative weight, not absolute SLA" caveat) onto the shard
# whose estimated wall time grows least: serial tests (no top-level
# t.Parallel) add up, parallel ones share -test.parallel=4.
# Regenerate with scripts/ci/gen_embedded_cmd_shard_manifest.py 50
# Regenerate with scripts/ci/gen_embedded_cmd_shard_manifest.py 100
# --weights=duration --write after adding, splitting or removing
# TestEmbedded* functions in cmd/bd/*_embedded_test.go. --write is
# incremental: it keeps every already-assigned test on its current shard
@ -208,302 +182,407 @@
# This file is generated: notes added here are erased by the next
# regeneration. Add them to the generator or the durations file instead.
50 1 TestEmbeddedInitA
100 1 TestEmbeddedUpdateConcurrent
50 2 TestEmbeddedGateCreate
100 2 TestEmbeddedShowConcurrent
50 3 TestEmbeddedRoutedMutatingSiblingAssignTagDep
100 3 TestEmbeddedCloseConcurrent
50 4 TestEmbeddedUpdateConcurrent
100 4 TestEmbeddedEpicConcurrent
50 5 TestEmbeddedMaxRowsListLimitInteraction
100 5 TestEmbeddedConfigConcurrent
50 6 TestEmbeddedSwarm
100 6 TestEmbeddedListFilteringBasicAndLabels
50 7 TestEmbeddedDepA
100 7 TestEmbeddedDepConcurrent
50 8 TestEmbeddedDepB
100 8 TestEmbeddedMaxRowsListLimitInteraction
50 9 TestEmbeddedKVConcurrent
100 9 TestEmbeddedChildrenConcurrent
50 10 TestEmbeddedListFiltering
100 10 TestEmbeddedCreateScalarAndRelationships
50 11 TestEmbeddedInitRoleRouting
100 11 TestEmbeddedKVConcurrent
50 12 TestEmbeddedContributorCreate
100 12 TestEmbeddedGatedRendering
50 13 TestEmbeddedInitGitBootstrapRouting
100 13 TestEmbeddedListFilteringStatusAndHierarchy
50 14 TestEmbeddedCloseConcurrent
100 14 TestEmbeddedReopenConcurrent
50 15 TestEmbeddedCloseAlreadyClosed
100 15 TestEmbeddedPurgeWispsPlaneRetention
50 16 TestEmbeddedRoutedSiblingWritesCommitTargetHead
100 16 TestEmbeddedMemoryConcurrent
50 17 TestEmbeddedConfigConcurrent
100 17 TestEmbeddedReopen
50 18 TestEmbeddedGate
100 18 TestEmbeddedLabelPropagateRename
50 19 TestEmbeddedShowDetailAndCurrent
100 19 TestEmbeddedLabelConcurrent
50 20 TestEmbeddedDelete
100 20 TestEmbeddedInitRoleRoutingRetainedFork
50 21 TestEmbeddedBootstrap
100 21 TestEmbeddedMaxRowsReady
50 22 TestEmbeddedUnclaim
100 22 TestEmbeddedCount
50 23 TestEmbeddedBootstrapConcurrent
50 23 TestEmbeddedHooksConcurrent
50 23 TestEmbeddedShowConcurrent
100 23 TestEmbeddedCountConcurrent
50 24 TestEmbeddedAutoImportFallback_ConflictSkip_EmptyDBImportsAll
50 24 TestEmbeddedBackupConcurrent
50 24 TestEmbeddedBlocked
50 24 TestEmbeddedComments
50 24 TestEmbeddedCompactMisdatedChild
50 24 TestEmbeddedContextConcurrent
50 24 TestEmbeddedCreateCommitPending
50 24 TestEmbeddedCreateRepoFromNonBeadsCwd
50 24 TestEmbeddedCreateStorageClassBasic
50 24 TestEmbeddedCreateWithGitRemote
50 24 TestEmbeddedFindDuplicatesConcurrent
50 24 TestEmbeddedHistoryConcurrent
50 24 TestEmbeddedHooks
50 24 TestEmbeddedHumanConcurrent
50 24 TestEmbeddedInfoSuppressGitHooks
50 24 TestEmbeddedMigrateConcurrent
50 24 TestEmbeddedOnboard
50 24 TestEmbeddedPromote
50 24 TestEmbeddedQuickstart
50 24 TestEmbeddedWhere
100 24 TestEmbeddedUndeferConcurrent
50 25 TestEmbeddedAdminCompactReadOnlyAllowed
50 25 TestEmbeddedAutoImportFallback_ConflictSkip_DoesNotClobber
50 25 TestEmbeddedConfigNoWorkspaceStoreFreeCommands
50 25 TestEmbeddedConfigValidateJSONNoWorkspaceWritesStdout
50 25 TestEmbeddedCreateGraphAndBulk
50 25 TestEmbeddedDoltRemoteAndPush
50 25 TestEmbeddedGateInheritsDownParentChain
50 25 TestEmbeddedListConcurrent
50 25 TestEmbeddedOnboardConcurrent
50 25 TestEmbeddedPrime
50 25 TestEmbeddedQuickstartConcurrent
50 25 TestEmbeddedRenamePrefixConcurrent
50 25 TestEmbeddedSetup
50 25 TestEmbeddedSetupConcurrent
50 25 TestEmbeddedUpdateBatchAutoCommitDoesNotAdvanceHead
50 25 TestEmbeddedUpdateFields
50 25 TestEmbeddedVCCommitVariantsAndMerge
50 25 TestEmbeddedVersion
50 25 TestEmbeddedVersionConcurrent
100 25 TestEmbeddedMaxRowsListBasic
50 26 TestEmbeddedAdminBlocked
50 26 TestEmbeddedBlockedLabelFilters
50 26 TestEmbeddedClaimPools
50 26 TestEmbeddedCompactConcurrent
50 26 TestEmbeddedExportConcurrent
50 26 TestEmbeddedGCConcurrent
50 26 TestEmbeddedGraphConcurrent
50 26 TestEmbeddedPrimeChangeDirPrimesTarget
50 26 TestEmbeddedPrimeConcurrent
50 26 TestEmbeddedReopenConcurrent
50 26 TestEmbeddedTodoConcurrent
50 26 TestEmbeddedTypes
50 26 TestEmbeddedTypesConcurrent
100 26 TestEmbeddedExternalMutationPolicy
50 27 TestEmbeddedBranch
50 27 TestEmbeddedContext
50 27 TestEmbeddedCountIncludeEphemeral
50 27 TestEmbeddedCreateFormCommitsLabelOnlyCreate
50 27 TestEmbeddedFederationConcurrent
50 27 TestEmbeddedGateListScoped
50 27 TestEmbeddedIfRevisionReopenGuardDirect
50 27 TestEmbeddedOrphans
50 27 TestEmbeddedPurgeWispsPlaneRetention
50 27 TestEmbeddedReclaimRunsTheLeaseReclaimerRole
50 27 TestEmbeddedStaleLabelFilters
100 27 TestEmbeddedShipConcurrent
50 28 TestEmbeddedAutoImportJSONLConcurrentWriter
50 28 TestEmbeddedAutoImportJSONLSkipsNonEmpty
50 28 TestEmbeddedBranchConcurrent
50 28 TestEmbeddedCreateConcurrent
50 28 TestEmbeddedEpicCloseEligibleReasonFlag
50 28 TestEmbeddedFederationStatus
50 28 TestEmbeddedLabelAddRemove
50 28 TestEmbeddedPurgeConcurrent
50 28 TestEmbeddedReadyClaimConcurrent
50 28 TestEmbeddedStatus
100 28 TestEmbeddedHistoryConcurrent
50 29 TestEmbeddedDepBulkNoCycleCheckKeepsWholeGraphGate
50 29 TestEmbeddedDepConcurrent
50 29 TestEmbeddedFlatten
50 29 TestEmbeddedGetDependencies
50 29 TestEmbeddedImportUpsertAndPrefixSync
50 29 TestEmbeddedInfo
50 29 TestEmbeddedMaxRowsDoctorAndConfig
50 29 TestEmbeddedOrphansConcurrent
50 29 TestEmbeddedRenamePrefixEdgeCases
100 29 TestEmbeddedEpicCloseEligibleReasonFlag
50 30 TestEmbeddedAutoImportJSONLNoExplicitCommit
50 30 TestEmbeddedCreateJSONEchoesSubSecondTimestamps
50 30 TestEmbeddedDepAddWispSource
50 30 TestEmbeddedExportFlags
50 30 TestEmbeddedListComments
50 30 TestEmbeddedPurgeBasics
50 30 TestEmbeddedReadOnlyCommandsSpawnNoGit
50 30 TestEmbeddedReadyConcurrent
50 30 TestEmbeddedRoutedMutatingSiblingDeleteClose
100 30 TestEmbeddedCloseGuardsAndEpics
50 31 TestEmbeddedCreateCrossRepoUninit
50 31 TestEmbeddedCreateDryRunRepoDoesNotInitializeTarget
50 31 TestEmbeddedDoltBlockedAndCommit
50 31 TestEmbeddedDoltConcurrent
50 31 TestEmbeddedGatedRendering
50 31 TestEmbeddedImportFromSources
50 31 TestEmbeddedInfoConcurrent
50 31 TestEmbeddedInitB
50 31 TestEmbeddedMigrate
100 31 TestEmbeddedInitSelectedExcludeRoutingForkInvalidQuiet
50 32 TestEmbeddedBackup
50 32 TestEmbeddedExternalCapabilityReadyAfterShip
50 32 TestEmbeddedFederationPeers
50 32 TestEmbeddedLabelConcurrent
50 32 TestEmbeddedMaxRowsReadyMerge
50 32 TestEmbeddedPreviewDoesNotConsumeVersionMarker
50 32 TestEmbeddedRestore
50 32 TestEmbeddedTypesAgreeWithCreate
100 32 TestEmbeddedListSearchAndOutputFormats
50 33 TestEmbeddedBlockedConcurrent
50 33 TestEmbeddedDefer
50 33 TestEmbeddedGC
50 33 TestEmbeddedPruneDryRunAndFilters
50 33 TestEmbeddedPurgeFiltered
50 33 TestEmbeddedQuery
50 33 TestEmbeddedVCConcurrent
50 33 TestEmbeddedWhereConcurrent
100 33 TestEmbeddedBootstrapJSONLAndGitOrigin
50 34 TestEmbeddedCompact
50 34 TestEmbeddedCreateCrossRepoWithParent
50 34 TestEmbeddedCreateRepoRelativeUninitRefused
50 34 TestEmbeddedCreateStorageClassConflicts
50 34 TestEmbeddedDuplicatesConcurrent
50 34 TestEmbeddedEpicCloseEligibleReasonOutput
50 34 TestEmbeddedFlattenConcurrent
50 34 TestEmbeddedOpen_EmptyDatabaseRejected
50 34 TestEmbeddedRestoreConcurrent
50 34 TestEmbeddedUpdateLifecycle
100 34 TestEmbeddedUnclaimBatchAndRefusals
50 35 TestEmbeddedCreateCrossRepo
50 35 TestEmbeddedDeleteJSONDependencyErrorContract
50 35 TestEmbeddedDuplicateConcurrent
50 35 TestEmbeddedInitArtifactRouting
50 35 TestEmbeddedMaxRowsListBasic
50 35 TestEmbeddedStateConcurrent
50 35 TestEmbeddedVCStatusAndCommit
100 35 TestEmbeddedGateCreateBeadRename
50 36 TestEmbeddedAdminCompactTier2Honesty
50 36 TestEmbeddedCloseBasic
50 36 TestEmbeddedConfig
50 36 TestEmbeddedCountConcurrent
50 36 TestEmbeddedDirectCommitPathsBatchAutoCommitDoesNotAdvanceHead
50 36 TestEmbeddedInitConcurrent
50 36 TestEmbeddedLintConcurrent
50 36 TestEmbeddedPrimeChangeDirRedirectNoticeFollowsTarget
100 36 TestEmbeddedGateConcurrent
50 37 TestEmbeddedChangeDirOverridesInheritedBeadsDir
50 37 TestEmbeddedChildren
50 37 TestEmbeddedChildrenConcurrent
50 37 TestEmbeddedCreateCrossRepoDryRunWithParent
50 37 TestEmbeddedCreateStorageClassBatchAndMisc
50 37 TestEmbeddedQueryConcurrent
50 37 TestEmbeddedStaleConcurrent
100 37 TestEmbeddedMaxRowsDepTreeAndDuplicates
50 38 TestEmbeddedCreateDryRunDoesNotMigrate
50 38 TestEmbeddedImportPromotedWispRoundtrip
50 38 TestEmbeddedMaxRowsReady
50 38 TestEmbeddedReady
50 38 TestEmbeddedRenamePrefixBasic
50 38 TestEmbeddedShip
50 38 TestEmbeddedSupersede
100 38 TestEmbeddedGraphConcurrent
50 39 TestEmbeddedDeferAutoWake
50 39 TestEmbeddedEpicConcurrent
50 39 TestEmbeddedGateConcurrent
50 39 TestEmbeddedInitC
50 39 TestEmbeddedKV
50 39 TestEmbeddedLint
50 39 TestEmbeddedPromoteCLI
100 39 TestEmbeddedMaxRowsGraph
50 40 TestEmbeddedCommentsCLI
50 40 TestEmbeddedCommentsCLIConcurrent
50 40 TestEmbeddedDepAndLinkBatchAutoCommitDoesNotAdvanceHead
50 40 TestEmbeddedDiffConcurrent
50 40 TestEmbeddedImportConcurrent
50 40 TestEmbeddedSupersedeConcurrent
50 40 TestEmbeddedTodo
100 40 TestEmbeddedUpdateLifecycleClaimParentCommit
50 41 TestEmbeddedHistory
50 41 TestEmbeddedInitSelectedExcludeRoutingFork
50 41 TestEmbeddedListSearchAndOutput
50 41 TestEmbeddedPromoteCLIConcurrent
50 41 TestEmbeddedQuick
50 41 TestEmbeddedUndefer
100 41 TestEmbeddedDuplicateConcurrent
50 42 TestEmbeddedCountIncludeInfra
50 42 TestEmbeddedDuplicate
50 42 TestEmbeddedEpicCloseEligible
50 42 TestEmbeddedInitExplicitBeadsDirIsAuthoritative
50 42 TestEmbeddedQuietFlagSuppressesSuccessOutput
50 42 TestEmbeddedStatusConcurrent
100 42 TestEmbeddedInitAForkAutoContributor
50 43 TestEmbeddedCreateRepoRelativeExistingWorkspaceUnaffected
50 43 TestEmbeddedImportClosedChildWhoseParentWasDeleted
50 43 TestEmbeddedLabelEditReports
50 43 TestEmbeddedShowBasicsAndJSON
50 43 TestEmbeddedState
50 43 TestEmbeddedSwarmConcurrent
100 43 TestEmbeddedInitExplicitBeadsDirIsAuthoritative
50 44 TestEmbeddedFindDuplicates
50 44 TestEmbeddedMaxRowsGraph
50 44 TestEmbeddedMemory
50 44 TestEmbeddedShipConcurrent
50 44 TestEmbeddedShowUnresolvableDeps
50 44 TestEmbeddedSquashWispMoleculeClearsRootEphemeral
100 44 TestEmbeddedStaleConcurrent
50 45 TestEmbeddedCloseGuardsAndEpics
50 45 TestEmbeddedCreateRepoProxiedTargetError
50 45 TestEmbeddedCreateScalarAndRelationships
50 45 TestEmbeddedDuplicates
50 45 TestEmbeddedUndeferConcurrent
50 45 TestEmbeddedUpdateRoutedStoreCommitsTargetHead
100 45 TestEmbeddedGraph
50 46 TestEmbeddedCount
50 46 TestEmbeddedDepListSingleIDWarnsOnDroppedExternalEdge
50 46 TestEmbeddedDepNoCycleCheck
50 46 TestEmbeddedEpicStatus
50 46 TestEmbeddedInitHooksRouting
50 46 TestEmbeddedReopen
100 46 TestEmbeddedCloseAlreadyClosedClaimNextAndMolecule
50 47 TestEmbeddedDiff
50 47 TestEmbeddedGraph
50 47 TestEmbeddedHuman
50 47 TestEmbeddedMemoryCorpusBudget
50 47 TestEmbeddedPrimeChangeDirDefaultTemplateMatchesTarget
50 47 TestEmbeddedQuickConcurrent
50 47 TestEmbeddedSearchConcurrent
100 47 TestEmbeddedListSearchAndOutputSearchAndSort
50 48 TestEmbeddedCreateDryRunCrossRepoDoesNotMigrateTarget
50 48 TestEmbeddedExportFormats
50 48 TestEmbeddedLabelPropagateRename
50 48 TestEmbeddedMaxRowsDepTreeAndDuplicates
50 48 TestEmbeddedMemoryConcurrent
50 48 TestEmbeddedSearch
100 48 TestEmbeddedDeferConcurrent
50 49 TestEmbeddedExplicitHierarchicalParentEdges
50 49 TestEmbeddedInitSelectedExcludeRoutingStealth
100 49 TestEmbeddedInitAPushConsentAndRemoteBootstrap
50 50 TestEmbeddedDeferConcurrent
50 50 TestEmbeddedExternalMutationPolicy
50 50 TestEmbeddedGCConditionalMatcherDecode
50 50 TestEmbeddedPruneSafetyAndScope
50 50 TestEmbeddedStale
100 50 TestEmbeddedDiffConcurrent
100 51 TestEmbeddedInitGitBootstrapRoutingFreshQuiet
100 52 TestEmbeddedSwarmConcurrent
100 53 TestEmbeddedInitSelectedExcludeRoutingStealthDecoyQuiet
100 54 TestEmbeddedSearchConcurrent
100 55 TestEmbeddedUndefer
100 56 TestEmbeddedDepNoCycleCheck
100 57 TestEmbeddedQueryConcurrent
100 58 TestEmbeddedDepAAddRejectionsAndBulk
100 59 TestEmbeddedDeferAutoWake
100 60 TestEmbeddedCommentsCLI
100 61 TestEmbeddedUpdateRoutedStoreCommitsTargetHead
100 62 TestEmbeddedReadyBlockersAndLabels
100 63 TestEmbeddedDepAndLinkBatchAutoCommitDoesNotAdvanceHead
100 64 TestEmbeddedGateWaiterCheckLifecycle
100 65 TestEmbeddedSupersede
100 66 TestEmbeddedCloseBasicIsolatedStores
100 67 TestEmbeddedAdminCompactReadOnlyAllowed
100 67 TestEmbeddedAutoImportFallback_ConflictSkip_DoesNotClobber
100 67 TestEmbeddedBootstrapConcurrent
100 67 TestEmbeddedCountIncludeInfra
100 67 TestEmbeddedCreateCommitPending
100 67 TestEmbeddedCreateDryRunRepoDoesNotInitializeTarget
100 67 TestEmbeddedCreateRepoFromNonBeadsCwd
100 67 TestEmbeddedCreateRepoRelativeUninitRefused
100 67 TestEmbeddedHooks
100 67 TestEmbeddedOnboard
100 67 TestEmbeddedPrime
100 67 TestEmbeddedPromote
100 67 TestEmbeddedQuickstart
100 67 TestEmbeddedQuickstartConcurrent
100 67 TestEmbeddedWhere
100 67 TestEmbeddedWhereConcurrent
100 68 TestEmbeddedAutoImportFallback_ConflictSkip_EmptyDBImportsAll
100 68 TestEmbeddedBlocked
100 68 TestEmbeddedCompactConcurrent
100 68 TestEmbeddedContext
100 68 TestEmbeddedCreateJSONEchoesSubSecondTimestamps
100 68 TestEmbeddedDoltBlockedAndCommit
100 68 TestEmbeddedDoltConcurrent
100 68 TestEmbeddedInfo
100 68 TestEmbeddedInfoSuppressGitHooks
100 68 TestEmbeddedOrphans
100 68 TestEmbeddedRoutedMutatingSiblingDeleteCloseDelete
100 68 TestEmbeddedSetupConcurrent
100 68 TestEmbeddedTodoConcurrent
100 68 TestEmbeddedTypes
100 69 TestEmbeddedCompact
100 69 TestEmbeddedConfigValidateJSONNoWorkspaceWritesStdout
100 69 TestEmbeddedCreateConcurrent
100 69 TestEmbeddedDepBulkNoCycleCheckKeepsWholeGraphGate
100 69 TestEmbeddedDuplicatesSharedFixture
100 69 TestEmbeddedGateListScoped
100 69 TestEmbeddedGetDependencies
100 69 TestEmbeddedInfoConcurrent
100 69 TestEmbeddedRenamePrefixConcurrent
100 69 TestEmbeddedRoutedSiblingWritesCommitTargetHeadNote
100 69 TestEmbeddedTypesConcurrent
100 69 TestEmbeddedUpdateBatchAutoCommitDoesNotAdvanceHead
100 70 TestEmbeddedExportConcurrent
100 70 TestEmbeddedFlattenConcurrent
100 70 TestEmbeddedGCDryRunAndSkips
100 70 TestEmbeddedImportConcurrent
100 70 TestEmbeddedImportUpsertAndPrefixSync
100 70 TestEmbeddedLabelAddRemoveMultiAndDuplicate
100 70 TestEmbeddedMemory
100 70 TestEmbeddedMigrateConcurrent
100 70 TestEmbeddedPurgeConcurrent
100 70 TestEmbeddedRoutedMutatingSiblingAssignTagDepTag
100 71 TestEmbeddedInitRoleRoutingExplicitDefault
100 71 TestEmbeddedPrimeChangeDirRedirectNoticeFollowsTarget
100 72 TestEmbeddedContributorCreateMultiple
100 72 TestEmbeddedCreateWithGitRemote
100 72 TestEmbeddedFederationConcurrent
100 72 TestEmbeddedGateCreateRepoErrorsList
100 72 TestEmbeddedHumanConcurrent
100 72 TestEmbeddedImportPromotedWispRoundtrip
100 72 TestEmbeddedPrimeChangeDirPrimesTarget
100 72 TestEmbeddedRoutedMutatingSiblingDeleteCloseClose
100 72 TestEmbeddedRoutedSiblingWritesCommitTargetHeadReopen
100 72 TestEmbeddedUpdateFieldsMappingAndRefs
100 73 TestEmbeddedCompactMisdatedChild
100 73 TestEmbeddedExportFlags
100 73 TestEmbeddedFederationPeers
100 73 TestEmbeddedGateCreateFlags
100 73 TestEmbeddedGateCreateReady
100 73 TestEmbeddedPrimeChangeDirDefaultTemplateMatchesTarget
100 73 TestEmbeddedQuickConcurrent
100 73 TestEmbeddedRenamePrefixBasic
100 73 TestEmbeddedRoutedMutatingSiblingAssignTagDepDepAdd
100 74 TestEmbeddedBlockedConcurrent
100 74 TestEmbeddedBranch
100 74 TestEmbeddedCountIncludeEphemeral
100 74 TestEmbeddedDepAddWispSource
100 74 TestEmbeddedMigrate
100 74 TestEmbeddedPrimeConcurrent
100 74 TestEmbeddedRestore
100 74 TestEmbeddedVCConcurrent
100 75 TestEmbeddedCommentsCLIConcurrent
100 75 TestEmbeddedContextConcurrent
100 75 TestEmbeddedFlatten
100 75 TestEmbeddedInitC
100 75 TestEmbeddedListComments
100 75 TestEmbeddedOpen_EmptyDatabaseRejected
100 75 TestEmbeddedReclaimRunsTheLeaseReclaimerRole
100 75 TestEmbeddedRoutedSiblingWritesCommitTargetHeadComment
100 75 TestEmbeddedVCStatusAndCommit
100 76 TestEmbeddedCloseAlreadyClosedContinue
100 76 TestEmbeddedCloseAlreadyClosedMultipleIDs
100 76 TestEmbeddedExportFormats
100 76 TestEmbeddedGCForceWithDecay
100 76 TestEmbeddedGCFullAndNoForcePrompts
100 76 TestEmbeddedInitAGitOriginRemote
100 76 TestEmbeddedLabelAddRemoveRemove
100 76 TestEmbeddedOnboardConcurrent
100 77 TestEmbeddedClaimPools
100 77 TestEmbeddedConfigNoWorkspaceStoreFreeCommands
100 77 TestEmbeddedCreateStorageClassConflicts
100 77 TestEmbeddedExternalCapabilityReadyAfterShip
100 77 TestEmbeddedHumanListStatsRespondDismiss
100 77 TestEmbeddedMemoryCorpusBudget
100 77 TestEmbeddedOrphansConcurrent
100 77 TestEmbeddedStatus
100 78 TestEmbeddedBranchConcurrent
100 78 TestEmbeddedComments
100 78 TestEmbeddedDepBRemove
100 78 TestEmbeddedLabelAddRemoveAdd
100 78 TestEmbeddedShip
100 78 TestEmbeddedUpdateFieldsNotesOverwrite
100 78 TestEmbeddedVCCommitVariantsAndMerge
100 78 TestEmbeddedVersionConcurrent
100 79 TestEmbeddedCreateCrossRepoUninit
100 79 TestEmbeddedDeleteJSONDependencyErrorContract
100 79 TestEmbeddedEpicCloseEligibleNotEligible
100 79 TestEmbeddedInitABasic
100 79 TestEmbeddedInitBRemoteSchemaAndCloneFailure
100 79 TestEmbeddedRenamePrefixEdgeCases
100 79 TestEmbeddedUpdateFieldsNotesClearAndDefer
100 80 TestEmbeddedCreateCrossRepoWithParent
100 80 TestEmbeddedCreateFormCommitsLabelOnlyCreate
100 80 TestEmbeddedCreateStorageClassBasic
100 80 TestEmbeddedRoutedMutatingSiblingAssignTagDepAssign
100 80 TestEmbeddedStatusConcurrent
100 80 TestEmbeddedSwarmCreate
100 80 TestEmbeddedSwarmValidate
100 81 TestEmbeddedAdminCompactTier2Honesty
100 81 TestEmbeddedBackup
100 81 TestEmbeddedDeleteForceAndBatch
100 81 TestEmbeddedGateCreateBeadCheck
100 81 TestEmbeddedGateList
100 81 TestEmbeddedRestoreConcurrent
100 81 TestEmbeddedStaleLabelFilters
100 81 TestEmbeddedStateConcurrent
100 82 TestEmbeddedCreateCrossRepoDryRunWithParent
100 82 TestEmbeddedDeleteBasic
100 82 TestEmbeddedDepBTreeAndCycles
100 82 TestEmbeddedDirectCommitPathsBatchAutoCommitDoesNotAdvanceHead
100 82 TestEmbeddedHooksConcurrent
100 82 TestEmbeddedImportFromSources
100 82 TestEmbeddedStale
100 83 TestEmbeddedAdminBlocked
100 83 TestEmbeddedAutoImportJSONLConcurrentWriter
100 83 TestEmbeddedInitBAutoCommitAndJSONLRemote
100 83 TestEmbeddedLabelEditReportsPrefix
100 83 TestEmbeddedMaxRowsDoctorAndConfig
100 83 TestEmbeddedPurgeFiltered
100 83 TestEmbeddedReadyConcurrent
100 84 TestEmbeddedInitGitBootstrapRoutingDecoyInvalid
100 84 TestEmbeddedInitSelectedExcludeRoutingStealthInvalid
100 85 TestEmbeddedBootstrapExistingDryRunInit
100 85 TestEmbeddedChildrenBasicAndEmpty
100 85 TestEmbeddedCreateGraphAndBulk
100 85 TestEmbeddedCreateRepoRelativeExistingWorkspaceUnaffected
100 85 TestEmbeddedIfRevisionReopenGuardDirect
100 85 TestEmbeddedInitArtifactRouting
100 86 TestEmbeddedExplicitHierarchicalParentEdges
100 86 TestEmbeddedInitHooksRouting
100 87 TestEmbeddedCreateRepoProxiedTargetError
100 87 TestEmbeddedGateInheritsDownParentChain
100 87 TestEmbeddedReadyClaimConcurrent
100 87 TestEmbeddedState
100 87 TestEmbeddedSupersedeConcurrent
100 87 TestEmbeddedSwarmCreateForceAndErrors
100 88 TestEmbeddedChangeDirOverridesInheritedBeadsDir
100 88 TestEmbeddedDepAAddAndList
100 88 TestEmbeddedKV
100 88 TestEmbeddedMaxRowsReadyMerge
100 88 TestEmbeddedPromoteCLI
100 88 TestEmbeddedUnclaimSuccess
100 89 TestEmbeddedBackupConcurrent
100 89 TestEmbeddedCreateDryRunDoesNotMigrate
100 89 TestEmbeddedGateShowResolve
100 89 TestEmbeddedInitBStealthAndForceReinit
100 89 TestEmbeddedLabelEditReportsNoop
100 89 TestEmbeddedShowBasicsAndJSON
100 90 TestEmbeddedAutoImportJSONLSkipsNonEmpty
100 90 TestEmbeddedConfig
100 90 TestEmbeddedFindDuplicatesConcurrent
100 90 TestEmbeddedLabelEditReportsListAndTemplate
100 90 TestEmbeddedLintConcurrent
100 90 TestEmbeddedUpdateLifecycleDefer
100 90 TestEmbeddedVersion
100 91 TestEmbeddedDuplicate
100 91 TestEmbeddedPreviewDoesNotConsumeVersionMarker
100 91 TestEmbeddedPruneDryRunAndFilters
100 91 TestEmbeddedReadOnlyCommandsSpawnNoGit
100 91 TestEmbeddedShowUnresolvableDeps
100 91 TestEmbeddedTypesAgreeWithCreate
100 92 TestEmbeddedAutoImportJSONLNoExplicitCommit
100 92 TestEmbeddedDefer
100 92 TestEmbeddedDepAAddTypesAndFlags
100 92 TestEmbeddedEpicCloseEligibleClosesEpics
100 92 TestEmbeddedSetup
100 92 TestEmbeddedSwarmStatusList
100 93 TestEmbeddedCreateStorageClassBatchAndMisc
100 93 TestEmbeddedDeletePreviewAndGuards
100 93 TestEmbeddedDepBRemoveOutputAndRelatesTo
100 93 TestEmbeddedListConcurrent
100 93 TestEmbeddedPruneSafetyAndScope
100 93 TestEmbeddedShowDetailAndCurrentFlags
100 94 TestEmbeddedCreateDryRunCrossRepoDoesNotMigrateTarget
100 94 TestEmbeddedDepListSingleIDWarnsOnDroppedExternalEdge
100 94 TestEmbeddedEpicCloseEligibleReasonOutput
100 94 TestEmbeddedFederationStatus
100 94 TestEmbeddedGCConcurrent
100 94 TestEmbeddedReadyDefaultJSONAndFlags
100 95 TestEmbeddedChildrenJSONAndAllStatuses
100 95 TestEmbeddedFindDuplicates
100 95 TestEmbeddedImportClosedChildWhoseParentWasDeleted
100 95 TestEmbeddedInitConcurrent
100 95 TestEmbeddedQuick
100 96 TestEmbeddedDiff
100 96 TestEmbeddedDuplicatesConcurrent
100 96 TestEmbeddedHistory
100 96 TestEmbeddedShowDetailAndCurrentHistoryAndCurrent
100 96 TestEmbeddedSquashWispMoleculeClearsRootEphemeral
100 97 TestEmbeddedDuplicatesOwnWorkspaces
100 97 TestEmbeddedHumanPositionalFileAndGuards
100 97 TestEmbeddedPurgeBasics
100 97 TestEmbeddedQuietFlagSuppressesSuccessOutput
100 97 TestEmbeddedSearchStatusLimitSortDatesMetadata
100 98 TestEmbeddedCloseBasicSharedStore
100 98 TestEmbeddedContributorCreateRoutesToPlanning
100 98 TestEmbeddedGCConditionalMatcherDecode
100 98 TestEmbeddedQuery
100 98 TestEmbeddedTodo
100 99 TestEmbeddedBlockedLabelFilters
100 99 TestEmbeddedDoltRemoteAndPush
100 99 TestEmbeddedEpicStatus
100 99 TestEmbeddedInitSelectedExcludeRoutingForkDecoyAuto
100 99 TestEmbeddedSearchQueryStatusAssigneeLabels
100 100 TestEmbeddedContributorCreateShowReadsRouted
100 100 TestEmbeddedCreateCrossRepo
100 100 TestEmbeddedInitGitBootstrapRoutingExistingExplicit
100 100 TestEmbeddedLint
100 100 TestEmbeddedPromoteCLIConcurrent

View file

@ -1297,20 +1297,17 @@ jobs:
# heaviest shard (scripts/ci/gen_embedded_storage_shard_manifest.py
# --weights=duration --repack, on rbe-west measurements) stays near 110s,
# under the ~150s per-shard budget with headroom for executor load; its
# heaviest single top-level test is ~90s. cmd (50) sits at Bazel's hard
# cap per sh_test-like rule ("Having more than 50 shards is indicative of
# poor test organization. Please reduce the number of shards." -- a
# native analysis-time error, not a style lint); on rbe-west its shards
# ran 83-209s (6.5k shard-seconds, 2026-10-09) until bdInit seeded each
# workspace from a per-process schema template and the race bd
# subprocesses stopped sleeping 1s at exit (~4.1-4.4k shard-seconds,
# slowest shard ~140-160s, its slowest single tests ~100-130s under
# load), so it, not storage or //internal/httpclient:httpclient_served_test,
# is still this lane's floor. Lowering it further needs per-test speedups
# in its slowest functions; more shards (splitting bd_embedded_test into
# multiple <=50-shard sh_test rules with shard-index-offset plumbing
# through tools/bazel/go_test_manifest_shard.sh and
# check_shard_coverage.py) would not move the slowest single test. On RBE the tier's wall time ~= that floor
# heaviest single top-level test is ~90s. cmd is a 100-shard block split
# over two targets, //cmd/bd:bd_embedded_test (shards 1-50) and
# //cmd/bd:bd_embedded_part2_test (51-100), because Bazel caps a rule at
# 50 shards ("Having more than 50 shards is indicative of poor test
# organization. Please reduce the number of shards." -- a native
# analysis-time error, not a style lint); the step below checks that
# the two ranges tile the block exactly once. After its slowest
# functions were split into smaller top-level tests, a cmd shard's wall
# time is its slowest test: ~45s median, and at most the *Concurrent
# stress tests' 65-145s (their bd subprocesses queue on one workspace's
# writer lock, so they cannot be split without changing what they test). On RBE the tier's wall time ~= that floor
# + fixed cost (checkout, build, shard dispatch), not ~=
# sum(durations)/shard_count the way a CPU-core-bound local sweep is --
# each shard is its own remote action and runs concurrently with every
@ -1397,7 +1394,8 @@ jobs:
run: >-
python3 tools/bazel/check_shard_coverage.py
--bep "$RUNNER_TEMP/bazel-bep.json"
--suite //cmd/bd:bd_embedded_test .github/scripts/embedded-test-shard.sh 50
--suite //cmd/bd:bd_embedded_test .github/scripts/embedded-test-shard.sh 50@0/100
--suite //cmd/bd:bd_embedded_part2_test .github/scripts/embedded-test-shard.sh 50@50/100
--suite //internal/storage/embeddeddolt:embeddeddolt_embedded_test .github/scripts/embedded-storage-test-shard.sh 20
--whole //internal/storage/embeddeddolt:embeddeddolt_conformance_core_test
--whole //internal/storage/embeddeddolt:embeddeddolt_conformance_audit_test

View file

@ -125,7 +125,8 @@ exports_files(
# PR Risk's manifest-sharded tiers' shard scripts and their committed
# manifests (embedded-Dolt cmd and storage, proxied-server cmd, server-Dolt
# storage). The variants (//cmd/bd:bd_embedded_test, //cmd/bd:bd_proxied_test,
# storage). The variants (//cmd/bd:bd_embedded_test and
# //cmd/bd:bd_embedded_part2_test, //cmd/bd:bd_proxied_test,
# //internal/storage/embeddeddolt:embeddeddolt_embedded_test,
# //internal/storage/dolt:dolt_server_full_test) run them through
# tools/bazel/go_test_manifest_shard.sh, so each Bazel shard runs exactly the

View file

@ -1396,17 +1396,22 @@ go_test(
}),
)
# Runs 50 Bazel shards against the TestEmbedded* functions of
# *_embedded_test.go, assigned by the manifest's 50-shard block
# (duration-balanced; see scripts/ci/embedded_cmd_test_durations.json),
# against this configuration's bd_test with BEADS_TEST_EMBEDDED_DOLT=1 and
# the race bd (//cmd/bd:bd under --config=embedded) as the subprocess
# binary. This is a *different* shard count from PR Risk's legacy fork/push
# jobs, "Test (Embedded Dolt Cmd N/20)" (pr-risk.yml): those keep
# running 20 shards of their own, frozen hand-assigned block in the same
# manifest file — shard k here is not the same split as their shard k. It
# repeats bd_test's `env` (the wrapper cannot inherit it). shard_count must
# stay equal to this lane's manifest block's shard total.
# bd_embedded_test and bd_embedded_part2_test run the TestEmbedded* functions
# of *_embedded_test.go between them: the manifest's 100-shard block
# (duration-balanced; see scripts/ci/embedded_cmd_test_durations.json) is
# more than Bazel's 50-shard cap per rule, so bd_embedded_test runs its
# shards 1-50 and bd_embedded_part2_test its shards 51-100
# (go_test_manifest_shard.sh --shard-offset/--shard-total; bazel.yml's
# check_shard_coverage.py fails unless the two ranges tile the block exactly
# once). Both run this configuration's bd_test with
# BEADS_TEST_EMBEDDED_DOLT=1 and the race bd (//cmd/bd:bd under
# --config=embedded) as the subprocess binary. This is a *different* shard
# count from PR Risk's legacy fork/push jobs, "Test (Embedded Dolt Cmd
# N/20)" (pr-risk.yml): those keep running 20 shards of their own, frozen
# hand-assigned block in the same manifest file — shard k here is not the
# same split as their shard k. Each repeats bd_test's `env` (the wrapper
# cannot inherit it). The two shard_counts must sum to --shard-total, the
# manifest block's shard total.
#
# Tags:
# embedded: the embedded-Dolt tier; excluded from --config=prcore/ci,
@ -1422,6 +1427,8 @@ sh_test(
timeout = "eternal",
srcs = ["//tools/bazel:go_test_manifest_shard.sh"],
args = [
"--shard-offset=0",
"--shard-total=100",
"$(rootpath //:.github/scripts/embedded-test-shard.sh)",
"BEADS_TEST_CMD_BINARY",
"$(rootpath :bd_test)",
@ -1454,6 +1461,44 @@ sh_test(
tags = ["embedded"],
)
# Shards 51-100 of the manifest's 100-shard block; see bd_embedded_test.
#
# Tags:
# embedded: as bd_embedded_test.
sh_test(
name = "bd_embedded_part2_test",
size = "large",
# -test.timeout=19m and env: as bd_embedded_test.
timeout = "eternal",
srcs = ["//tools/bazel:go_test_manifest_shard.sh"],
args = [
"--shard-offset=50",
"--shard-total=100",
"$(rootpath //:.github/scripts/embedded-test-shard.sh)",
"BEADS_TEST_CMD_BINARY",
"$(rootpath :bd_test)",
"-test.timeout=19m",
],
data = [
":bd",
":bd_test",
":go_srcs",
"//:.github/scripts/embedded-cmd-test-shards.txt",
"//:.github/scripts/embedded-test-shard.sh",
"//internal/storage/embeddeddolt/cmd:cmd_norace",
"@go_sdk//:bin/gofmt",
],
env = {
"BEADS_TEST_BD_BINARY": "$(rlocationpath :bd)",
"BEADS_TEST_EMBEDDED_DOLT": "1",
"BEADS_TEST_EMBEDDED_SCHEMA_TOOL": "$(rlocationpath //internal/storage/embeddeddolt/cmd:cmd_norace)",
"BEADS_TEST_GOFMT": "$(rlocationpath @go_sdk//:bin/gofmt)",
"GORACE": "atexit_sleep_ms=0",
},
shard_count = 50,
tags = ["embedded"],
)
# Runs 34 Bazel shards against the TestProxiedServer*/TestServerMode*
# functions, assigned by the manifest's 34-shard block (duration-balanced;
# see scripts/ci/proxied_test_durations.json), against this configuration's

View file

@ -191,7 +191,10 @@ Created while Dolt auto-commit is in batch mode.
})
}
func TestEmbeddedRoutedSiblingWritesCommitTargetHead(t *testing.T) {
// TestEmbeddedRoutedSiblingWritesCommitTargetHead* each run one routed sibling
// write (comment, note, reopen) from the source rig and assert it commits on
// the target rig's head; one top-level test per write for CI shard balance.
func TestEmbeddedRoutedSiblingWritesCommitTargetHeadComment(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt auto-commit tests")
}
@ -223,6 +226,15 @@ func TestEmbeddedRoutedSiblingWritesCommitTargetHead(t *testing.T) {
t.Fatal("routed comment was not persisted in target store")
}
})
}
func TestEmbeddedRoutedSiblingWritesCommitTargetHeadNote(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt auto-commit tests")
}
t.Parallel()
bd := buildEmbeddedBD(t)
t.Run("note", func(t *testing.T) {
sourceDir, targetDir, targetBeadsDir := setupRoutedEmbeddedRepo(t, bd, "sn", "tn")
@ -241,6 +253,15 @@ func TestEmbeddedRoutedSiblingWritesCommitTargetHead(t *testing.T) {
t.Fatalf("target notes = %q, want routed note", got.Notes)
}
})
}
func TestEmbeddedRoutedSiblingWritesCommitTargetHeadReopen(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt auto-commit tests")
}
t.Parallel()
bd := buildEmbeddedBD(t)
t.Run("reopen", func(t *testing.T) {
sourceDir, targetDir, targetBeadsDir := setupRoutedEmbeddedRepo(t, bd, "sr", "tr")
@ -262,21 +283,20 @@ func TestEmbeddedRoutedSiblingWritesCommitTargetHead(t *testing.T) {
})
}
// TestEmbeddedRoutedMutatingSiblingWritesCommitTargetHead pins the rest of the
// prefix-routed mutating command surface to the same write-through contract as
// TestEmbeddedRoutedMutatingSibling* pin the rest of the prefix-routed
// mutating command surface to the same write-through contract as
// comment/note/reopen above. These commands (the assign/tag shorthands plus
// dep/delete/close) resolve a prefix-routed target through the write-intent
// router and must commit on the target head, not fail "store is read-only"
// (#4141). Each subtest creates the bead in the target rig, runs the command
// from the source rig so resolution must route, and asserts both that the
// target HEAD advanced and that the mutation persisted in the target store.
// TestEmbeddedRoutedMutatingSiblingAssignTagDep was split from
// TestEmbeddedRoutedMutatingSiblingWritesCommitTargetHead (originally
// ~245.22s, measured under --config=embedded) into 2 top-level tests over
// disjoint subtest groups, for CI shard balance (see
// scripts/ci/embedded_cmd_test_durations.json and engdocs/TESTING.md). Every original
// subtest is preserved exactly once.
func TestEmbeddedRoutedMutatingSiblingAssignTagDep(t *testing.T) {
// Each top-level test runs one subtest of the original
// TestEmbeddedRoutedMutatingSiblingWritesCommitTargetHead (later
// ...AssignTagDep and ...DeleteClose), for CI shard balance (see
// scripts/ci/embedded_cmd_test_durations.json): every original subtest is
// preserved exactly once.
func TestEmbeddedRoutedMutatingSiblingAssignTagDepAssign(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt auto-commit tests")
}
@ -301,6 +321,15 @@ func TestEmbeddedRoutedMutatingSiblingAssignTagDep(t *testing.T) {
t.Fatalf("target assignee = %q, want alice", got.Assignee)
}
})
}
func TestEmbeddedRoutedMutatingSiblingAssignTagDepTag(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt auto-commit tests")
}
t.Parallel()
bd := buildEmbeddedBD(t)
t.Run("tag", func(t *testing.T) {
sourceDir, targetDir, targetBeadsDir := setupRoutedEmbeddedRepo(t, bd, "stg", "ttg")
@ -319,6 +348,15 @@ func TestEmbeddedRoutedMutatingSiblingAssignTagDep(t *testing.T) {
t.Fatalf("target labels = %v, want routed-label", labels[issue.ID])
}
})
}
func TestEmbeddedRoutedMutatingSiblingAssignTagDepDepAdd(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt auto-commit tests")
}
t.Parallel()
bd := buildEmbeddedBD(t)
t.Run("dep_add", func(t *testing.T) {
sourceDir, targetDir, targetBeadsDir := setupRoutedEmbeddedRepo(t, bd, "sdp", "tdp")
@ -347,13 +385,7 @@ func TestEmbeddedRoutedMutatingSiblingAssignTagDep(t *testing.T) {
})
}
// TestEmbeddedRoutedMutatingSiblingDeleteClose was split from
// TestEmbeddedRoutedMutatingSiblingWritesCommitTargetHead (originally
// ~245.22s, measured under --config=embedded) into 2 top-level tests over
// disjoint subtest groups, for CI shard balance (see
// scripts/ci/embedded_cmd_test_durations.json and engdocs/TESTING.md). Every original
// subtest is preserved exactly once.
func TestEmbeddedRoutedMutatingSiblingDeleteClose(t *testing.T) {
func TestEmbeddedRoutedMutatingSiblingDeleteCloseDelete(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt auto-commit tests")
}
@ -374,6 +406,15 @@ func TestEmbeddedRoutedMutatingSiblingDeleteClose(t *testing.T) {
t.Fatalf("routed delete did not remove %s from target store", issue.ID)
}
})
}
func TestEmbeddedRoutedMutatingSiblingDeleteCloseClose(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt auto-commit tests")
}
t.Parallel()
bd := buildEmbeddedBD(t)
t.Run("close", func(t *testing.T) {
sourceDir, targetDir, targetBeadsDir := setupRoutedEmbeddedRepo(t, bd, "scl", "tcl")

View file

@ -88,7 +88,7 @@ func TestBootstrapNoWorkspace(t *testing.T) {
})
}
func TestEmbeddedBootstrap(t *testing.T) {
func TestEmbeddedBootstrapExistingDryRunInit(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
@ -160,6 +160,15 @@ func TestEmbeddedBootstrap(t *testing.T) {
t.Errorf("expected 'Created fresh database':\nstdout:\n%s\nstderr:\n%s", stdout.String(), stderr.String())
}
})
}
func TestEmbeddedBootstrapJSONLAndGitOrigin(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
t.Parallel()
bd := buildEmbeddedBD(t)
// ===== JSONL Import =====

View file

@ -26,7 +26,7 @@ func bdChildren(t *testing.T, bd, dir string, args ...string) string {
return stdout.String()
}
func TestEmbeddedChildren(t *testing.T) {
func TestEmbeddedChildrenBasicAndEmpty(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
@ -51,6 +51,33 @@ func TestEmbeddedChildren(t *testing.T) {
}
})
t.Run("children_empty", func(t *testing.T) {
parent := bdCreate(t, bd, dir, "No children parent", "--type", "task")
out := bdChildren(t, bd, dir, parent.ID)
// Should not error, may show empty message
_ = out
})
t.Run("children_nonexistent_parent", func(t *testing.T) {
cmd := exec.Command(bd, "children", "ch-nonexistent999")
cmd.Dir = dir
cmd.Env = bdEnv(dir)
out, err := cmd.CombinedOutput()
if err == nil {
t.Fatalf("expected children of nonexistent to fail, got: %s", out)
}
})
}
func TestEmbeddedChildrenJSONAndAllStatuses(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
t.Parallel()
bd := buildEmbeddedBD(t)
dir, _, _ := bdInit(t, bd, "--prefix", "ch")
t.Run("children_json", func(t *testing.T) {
parent := bdCreate(t, bd, dir, "JSON parent", "--type", "epic")
child := bdCreate(t, bd, dir, "JSON child", "--type", "task")
@ -76,13 +103,6 @@ func TestEmbeddedChildren(t *testing.T) {
}
})
t.Run("children_empty", func(t *testing.T) {
parent := bdCreate(t, bd, dir, "No children parent", "--type", "task")
out := bdChildren(t, bd, dir, parent.ID)
// Should not error, may show empty message
_ = out
})
t.Run("children_includes_all_statuses", func(t *testing.T) {
parent := bdCreate(t, bd, dir, "All status parent", "--type", "epic")
openChild := bdCreate(t, bd, dir, "Open child", "--type", "task")
@ -99,16 +119,6 @@ func TestEmbeddedChildren(t *testing.T) {
t.Errorf("expected closed child in output (--all implied): %s", out)
}
})
t.Run("children_nonexistent_parent", func(t *testing.T) {
cmd := exec.Command(bd, "children", "ch-nonexistent999")
cmd.Dir = dir
cmd.Env = bdEnv(dir)
out, err := cmd.CombinedOutput()
if err == nil {
t.Fatalf("expected children of nonexistent to fail, got: %s", out)
}
})
}
// TestEmbeddedChildrenConcurrent exercises children listing concurrently.

View file

@ -58,11 +58,15 @@ func bdDepAdd(t *testing.T, bd, dir string, args ...string) {
// ===== Close tests =====
// TestEmbeddedCloseBasic was split from TestEmbeddedClose (originally ~404s,
// measured under --config=embedded) into 3 top-level tests over disjoint
// subtest groups, for CI shard balance (see scripts/ci/embedded_cmd_test_durations.json and
// engdocs/TESTING.md). Every original subtest is preserved exactly once.
func TestEmbeddedCloseBasic(t *testing.T) {
// The TestEmbeddedCloseBasic*, TestEmbeddedCloseGuardsAndEpics and
// TestEmbeddedCloseAlreadyClosed* tests were split from TestEmbeddedClose
// (originally ~404s, measured under --config=embedded) into top-level tests
// over disjoint subtest groups, for CI shard balance (see
// scripts/ci/embedded_cmd_test_durations.json and engdocs/TESTING.md). Every
// original subtest is preserved exactly once, in its original order within
// its group. Subtests that share a store stay in one test; the others each
// init their own isolated store.
func TestEmbeddedCloseBasicSharedStore(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
@ -137,6 +141,15 @@ func TestEmbeddedCloseBasic(t *testing.T) {
t.Errorf("blocked issue status = %s, want open", got.Status)
}
})
}
func TestEmbeddedCloseBasicIsolatedStores(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
t.Parallel()
bd := buildEmbeddedBD(t)
// The direct-route twin of TestProxiedClose/
// close_partial_failure_json_names_the_failed_ids. Two things were asserted
@ -391,12 +404,8 @@ func TestEmbeddedCloseGuardsAndEpics(t *testing.T) {
}
// TestEmbeddedCloseAlreadyClosed was split from TestEmbeddedClose (originally
// ~404s, measured under --config=embedded) into 3 top-level tests over
// disjoint subtest groups, for CI shard balance (see
// scripts/ci/embedded_cmd_test_durations.json and engdocs/TESTING.md). Every original
// subtest is preserved exactly once.
func TestEmbeddedCloseAlreadyClosed(t *testing.T) {
// See TestEmbeddedCloseBasicSharedStore for the TestEmbeddedClose split.
func TestEmbeddedCloseAlreadyClosedMultipleIDs(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
@ -457,6 +466,15 @@ func TestEmbeddedCloseAlreadyClosed(t *testing.T) {
}
}
})
}
func TestEmbeddedCloseAlreadyClosedContinue(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
t.Parallel()
bd := buildEmbeddedBD(t)
t.Run("close_already_closed_continue_advances", func(t *testing.T) {
// Isolated store so molecule progress and the Dolt commit count are
@ -527,6 +545,15 @@ func TestEmbeddedCloseAlreadyClosed(t *testing.T) {
beforeCommits, afterCommits)
}
})
}
func TestEmbeddedCloseAlreadyClosedClaimNextAndMolecule(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
t.Parallel()
bd := buildEmbeddedBD(t)
t.Run("close_already_closed_claim_next", func(t *testing.T) {
// Isolated store so the ready set is deterministic — the shared store carries

View file

@ -13,11 +13,11 @@ import (
"github.com/steveyegge/beads/internal/storage/embeddeddolt"
)
// TestEmbeddedContributorCreate exercises the full contributor mode flow in
// The TestEmbeddedContributorCreate* tests exercise the full contributor mode flow in
// embedded Dolt: init → contributor wizard → create. This is the exact
// scenario that triggered GH#2988 ("no database selected" when the planning
// repo's .beads directory has no metadata.json).
func TestEmbeddedContributorCreate(t *testing.T) {
func TestEmbeddedContributorCreateRoutesToPlanning(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt contributor tests")
}
@ -46,6 +46,15 @@ func TestEmbeddedContributorCreate(t *testing.T) {
projectBeadsDir := filepath.Join(dir, ".beads")
assertIssueNotInStore(t, projectBeadsDir, "cr", issue.ID)
})
}
func TestEmbeddedContributorCreateShowReadsRouted(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt contributor tests")
}
t.Parallel()
bd := buildEmbeddedBD(t)
t.Run("show_reads_routed_issue", func(t *testing.T) {
dir, _ := initContributor(t, bd, "sh")
@ -56,6 +65,15 @@ func TestEmbeddedContributorCreate(t *testing.T) {
t.Errorf("title: got %q, want %q", shown.Title, "Show me")
}
})
}
func TestEmbeddedContributorCreateMultiple(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt contributor tests")
}
t.Parallel()
bd := buildEmbeddedBD(t)
t.Run("multiple_creates_succeed", func(t *testing.T) {
dir, planningDir := initContributor(t, bd, "mc")

View file

@ -51,14 +51,22 @@ func bdShowFail(t *testing.T, bd, dir, id string) string {
return string(out)
}
func TestEmbeddedDelete(t *testing.T) {
// setupEmbeddedDelete is the TestEmbeddedDelete* tests' workspace (prefix td).
func setupEmbeddedDelete(t *testing.T) (string, string) {
t.Helper()
bd := buildEmbeddedBD(t)
dir, _, _ := bdInit(t, bd, "--prefix", "td")
return bd, dir
}
func TestEmbeddedDeleteBasic(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
t.Parallel()
bd := buildEmbeddedBD(t)
dir, _, _ := bdInit(t, bd, "--prefix", "td")
bd, dir := setupEmbeddedDelete(t)
t.Run("delete_single_issue", func(t *testing.T) {
issue := bdCreate(t, bd, dir, "Delete me", "--type", "task")
@ -80,6 +88,19 @@ func TestEmbeddedDelete(t *testing.T) {
}
})
t.Run("delete_nonexistent", func(t *testing.T) {
bdDeleteFail(t, bd, dir, "td-nonexistent999", "--force")
})
}
func TestEmbeddedDeletePreviewAndGuards(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
t.Parallel()
bd, dir := setupEmbeddedDelete(t)
t.Run("delete_without_force_shows_preview", func(t *testing.T) {
target := bdCreate(t, bd, dir, "Lonely", "--type", "task")
@ -158,6 +179,15 @@ func TestEmbeddedDelete(t *testing.T) {
t.Fatalf("forced dry-run removed dependent: got %v, want %q", got["id"], child.ID)
}
})
}
func TestEmbeddedDeleteForceAndBatch(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
t.Parallel()
bd, dir := setupEmbeddedDelete(t)
t.Run("delete_force_orphans_dependents", func(t *testing.T) {
parent := bdCreate(t, bd, dir, "Force parent", "--type", "task")
@ -183,10 +213,6 @@ func TestEmbeddedDelete(t *testing.T) {
bdShowFail(t, bd, dir, issue2.ID)
bdShowFail(t, bd, dir, issue3.ID)
})
t.Run("delete_nonexistent", func(t *testing.T) {
bdDeleteFail(t, bd, dir, "td-nonexistent999", "--force")
})
}
func TestEmbeddedDeleteJSONDependencyErrorContract(t *testing.T) {

View file

@ -97,17 +97,18 @@ func bdDepWithInputFail(t *testing.T, bd, dir, input string, args ...string) str
return string(out)
}
// TestEmbeddedDepA and TestEmbeddedDepB were split from TestEmbeddedDep
// (originally ~317s, measured under --config=embedded) into 2 top-level
// tests over disjoint subtest groups, for CI shard balance (see
// scripts/ci/embedded_cmd_test_durations.json and engdocs/TESTING.md). Every original
// subtest is preserved exactly once. The "list_*" subtests (which assert on
// dependencies added by "add_positional_args" / "add_type_parent_child")
// stay grouped with the "add_*" cluster in TestEmbeddedDepA rather than a
// strict half/half split, since they depend on mutations made by those
// specific earlier subtests that a fresh per-function setup does not
// reproduce.
func TestEmbeddedDepA(t *testing.T) {
// The TestEmbeddedDepA* and TestEmbeddedDepB* tests were split from
// TestEmbeddedDep (originally ~317s, measured under --config=embedded), first
// into TestEmbeddedDepA and TestEmbeddedDepB and then (~95s each on
// rbe-west) into these 6 top-level tests over disjoint subtest groups, for
// CI shard balance (see scripts/ci/embedded_cmd_test_durations.json and
// engdocs/TESTING.md). Every original subtest is preserved exactly once. The
// "list_*" subtests (which assert on dependencies added by
// "add_positional_args" / "add_type_parent_child") stay with those subtests
// and the shared pre-created issues in TestEmbeddedDepAAddAndList, and the
// tree_* subtests with the pre-wired graph in TestEmbeddedDepBTreeAndCycles;
// the subtests that create every issue they use run in their own workspace.
func TestEmbeddedDepAAddAndList(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
@ -153,6 +154,54 @@ func TestEmbeddedDepA(t *testing.T) {
}
})
// ===== dep list =====
t.Run("list_default_direction_down", func(t *testing.T) {
// issueC depends on issueD (added earlier)
out := bdDep(t, bd, dir, "list", issueC.ID)
if !strings.Contains(out, issueD.ID) {
t.Errorf("expected dependency in list output: %s", out)
}
})
t.Run("list_direction_up", func(t *testing.T) {
out := bdDep(t, bd, dir, "list", issueD.ID, "--direction", "up")
if !strings.Contains(out, issueC.ID) {
t.Errorf("expected dependent in list --direction up: %s", out)
}
})
t.Run("list_type_filter", func(t *testing.T) {
out := bdDep(t, bd, dir, "list", epic.ID, "--direction", "up", "--type", "parent-child")
if !strings.Contains(out, child1.ID) || !strings.Contains(out, child2.ID) {
t.Errorf("expected children in type-filtered list: %s", out)
}
})
t.Run("list_json_output", func(t *testing.T) {
fullArgs := []string{"dep", "list", issueC.ID, "--json"}
cmd := exec.Command(bd, fullArgs...)
cmd.Dir = dir
cmd.Env = bdEnv(dir)
stdout, stderr, err := runCommandBuffers(t, cmd)
if err != nil {
t.Fatalf("dep list --json failed: %v\nstdout:\n%s\nstderr:\n%s", err, stdout.String(), stderr.String())
}
if !strings.Contains(stdout.String(), issueD.ID) {
t.Errorf("expected dependency ID in JSON: %s", stdout.String())
}
})
}
func TestEmbeddedDepAAddTypesAndFlags(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
t.Parallel()
bd := buildEmbeddedBD(t)
dir, _, _ := bdInit(t, bd, "--prefix", "dp")
t.Run("add_type_tracks", func(t *testing.T) {
tracker := bdCreate(t, bd, dir, "Tracker", "--type", "task")
tracked := bdCreate(t, bd, dir, "Tracked", "--type", "task")
@ -189,6 +238,16 @@ func TestEmbeddedDepA(t *testing.T) {
t.Errorf("expected dependency in deps: %s", out)
}
})
}
func TestEmbeddedDepAAddRejectionsAndBulk(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
t.Parallel()
bd := buildEmbeddedBD(t)
dir, _, _ := bdInit(t, bd, "--prefix", "dp")
t.Run("add_cycle_rejected", func(t *testing.T) {
// A->B already exists, add B->A to create cycle — should be rejected
@ -261,47 +320,9 @@ func TestEmbeddedDepA(t *testing.T) {
t.Fatalf("bulk validation failure should not add valid rows: %s", list)
}
})
// ===== dep list =====
t.Run("list_default_direction_down", func(t *testing.T) {
// issueC depends on issueD (added earlier)
out := bdDep(t, bd, dir, "list", issueC.ID)
if !strings.Contains(out, issueD.ID) {
t.Errorf("expected dependency in list output: %s", out)
}
})
t.Run("list_direction_up", func(t *testing.T) {
out := bdDep(t, bd, dir, "list", issueD.ID, "--direction", "up")
if !strings.Contains(out, issueC.ID) {
t.Errorf("expected dependent in list --direction up: %s", out)
}
})
t.Run("list_type_filter", func(t *testing.T) {
out := bdDep(t, bd, dir, "list", epic.ID, "--direction", "up", "--type", "parent-child")
if !strings.Contains(out, child1.ID) || !strings.Contains(out, child2.ID) {
t.Errorf("expected children in type-filtered list: %s", out)
}
})
t.Run("list_json_output", func(t *testing.T) {
fullArgs := []string{"dep", "list", issueC.ID, "--json"}
cmd := exec.Command(bd, fullArgs...)
cmd.Dir = dir
cmd.Env = bdEnv(dir)
stdout, stderr, err := runCommandBuffers(t, cmd)
if err != nil {
t.Fatalf("dep list --json failed: %v\nstdout:\n%s\nstderr:\n%s", err, stdout.String(), stderr.String())
}
if !strings.Contains(stdout.String(), issueD.ID) {
t.Errorf("expected dependency ID in JSON: %s", stdout.String())
}
})
}
func TestEmbeddedDepB(t *testing.T) {
func TestEmbeddedDepBTreeAndCycles(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
@ -327,54 +348,6 @@ func TestEmbeddedDepB(t *testing.T) {
bdDep(t, bd, dir, "add", child2.ID, epic.ID, "--type", "parent-child")
bdDep(t, bd, dir, "add", issueC.ID, issueD.ID)
// ===== dep remove =====
t.Run("remove_basic", func(t *testing.T) {
r1 := bdCreate(t, bd, dir, "Remove A", "--type", "task")
r2 := bdCreate(t, bd, dir, "Remove B", "--type", "task")
bdDep(t, bd, dir, "add", r1.ID, r2.ID)
out := bdDep(t, bd, dir, "remove", r1.ID, r2.ID)
if !strings.Contains(out, "Removed") {
t.Errorf("expected 'Removed' in output: %s", out)
}
})
t.Run("remove_rm_alias", func(t *testing.T) {
r1 := bdCreate(t, bd, dir, "Rm A", "--type", "task")
r2 := bdCreate(t, bd, dir, "Rm B", "--type", "task")
bdDep(t, bd, dir, "add", r1.ID, r2.ID)
out := bdDep(t, bd, dir, "rm", r1.ID, r2.ID)
if !strings.Contains(out, "Removed") {
t.Errorf("expected 'Removed' via rm alias: %s", out)
}
})
t.Run("remove_json_output", func(t *testing.T) {
r1 := bdCreate(t, bd, dir, "RmJSON A", "--type", "task")
r2 := bdCreate(t, bd, dir, "RmJSON B", "--type", "task")
bdDep(t, bd, dir, "add", r1.ID, r2.ID)
m := bdDepJSON(t, bd, dir, "remove", r1.ID, r2.ID)
if m["status"] != "removed" {
t.Errorf("expected status=removed, got %v", m["status"])
}
if m["removed"] != true {
t.Errorf("expected removed=true, got %v", m["removed"])
}
})
t.Run("remove_missing_edge_reports_noop", func(t *testing.T) {
r1 := bdCreate(t, bd, dir, "Missing edge A", "--type", "task")
r2 := bdCreate(t, bd, dir, "Missing edge B", "--type", "task")
out := bdDep(t, bd, dir, "remove", r1.ID, r2.ID)
if !strings.Contains(out, "No dependency found") || strings.Contains(out, "✓") {
t.Errorf("missing edge should report a no-op, got: %s", out)
}
m := bdDepJSON(t, bd, dir, "remove", r1.ID, r2.ID)
if m["status"] != "not_found" || m["removed"] != false {
t.Errorf("missing edge JSON = %v, want status=not_found removed=false", m)
}
})
// ===== dep tree =====
t.Run("tree_basic", func(t *testing.T) {
@ -433,6 +406,85 @@ func TestEmbeddedDepB(t *testing.T) {
}
})
// ===== dep cycles =====
t.Run("cycles_detect", func(t *testing.T) {
// We created a cycle earlier (cyA <-> cyB)
out := bdDep(t, bd, dir, "cycles")
// Should report at least one cycle
if !strings.Contains(out, "cycle") && !strings.Contains(out, "Cycle") && !strings.Contains(out, "No cycles") {
t.Errorf("expected cycle info in output: %s", out)
}
})
}
func TestEmbeddedDepBRemove(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
t.Parallel()
bd := buildEmbeddedBD(t)
dir, _, _ := bdInit(t, bd, "--prefix", "dp")
// ===== dep remove =====
t.Run("remove_basic", func(t *testing.T) {
r1 := bdCreate(t, bd, dir, "Remove A", "--type", "task")
r2 := bdCreate(t, bd, dir, "Remove B", "--type", "task")
bdDep(t, bd, dir, "add", r1.ID, r2.ID)
out := bdDep(t, bd, dir, "remove", r1.ID, r2.ID)
if !strings.Contains(out, "Removed") {
t.Errorf("expected 'Removed' in output: %s", out)
}
})
t.Run("remove_rm_alias", func(t *testing.T) {
r1 := bdCreate(t, bd, dir, "Rm A", "--type", "task")
r2 := bdCreate(t, bd, dir, "Rm B", "--type", "task")
bdDep(t, bd, dir, "add", r1.ID, r2.ID)
out := bdDep(t, bd, dir, "rm", r1.ID, r2.ID)
if !strings.Contains(out, "Removed") {
t.Errorf("expected 'Removed' via rm alias: %s", out)
}
})
}
func TestEmbeddedDepBRemoveOutputAndRelatesTo(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
t.Parallel()
bd := buildEmbeddedBD(t)
dir, _, _ := bdInit(t, bd, "--prefix", "dp")
t.Run("remove_json_output", func(t *testing.T) {
r1 := bdCreate(t, bd, dir, "RmJSON A", "--type", "task")
r2 := bdCreate(t, bd, dir, "RmJSON B", "--type", "task")
bdDep(t, bd, dir, "add", r1.ID, r2.ID)
m := bdDepJSON(t, bd, dir, "remove", r1.ID, r2.ID)
if m["status"] != "removed" {
t.Errorf("expected status=removed, got %v", m["status"])
}
if m["removed"] != true {
t.Errorf("expected removed=true, got %v", m["removed"])
}
})
t.Run("remove_missing_edge_reports_noop", func(t *testing.T) {
r1 := bdCreate(t, bd, dir, "Missing edge A", "--type", "task")
r2 := bdCreate(t, bd, dir, "Missing edge B", "--type", "task")
out := bdDep(t, bd, dir, "remove", r1.ID, r2.ID)
if !strings.Contains(out, "No dependency found") || strings.Contains(out, "✓") {
t.Errorf("missing edge should report a no-op, got: %s", out)
}
m := bdDepJSON(t, bd, dir, "remove", r1.ID, r2.ID)
if m["status"] != "not_found" || m["removed"] != false {
t.Errorf("missing edge JSON = %v, want status=not_found removed=false", m)
}
})
t.Run("tree_ignores_bidirectional_relates_to", func(t *testing.T) {
root := bdCreate(t, bd, dir, "Tree relates root", "--type", "task")
blocker := bdCreate(t, bd, dir, "Tree real blocker", "--type", "task")
@ -461,17 +513,6 @@ func TestEmbeddedDepB(t *testing.T) {
}
})
// ===== dep cycles =====
t.Run("cycles_detect", func(t *testing.T) {
// We created a cycle earlier (cyA <-> cyB)
out := bdDep(t, bd, dir, "cycles")
// Should report at least one cycle
if !strings.Contains(out, "cycle") && !strings.Contains(out, "Cycle") && !strings.Contains(out, "No cycles") {
t.Errorf("expected cycle info in output: %s", out)
}
})
t.Run("cycles_no_cycles", func(t *testing.T) {
// Fresh init with no cycles
dir2, _, _ := bdInit(t, bd, "--prefix", "dp2")

View file

@ -49,7 +49,7 @@ func bdDuplicatesJSON(t *testing.T, bd, dir string, args ...string) map[string]i
return m
}
func TestEmbeddedDuplicates(t *testing.T) {
func TestEmbeddedDuplicatesSharedFixture(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
@ -76,6 +76,49 @@ func TestEmbeddedDuplicates(t *testing.T) {
}
})
// ===== JSON output =====
t.Run("json_output_structure", func(t *testing.T) {
m := bdDuplicatesJSON(t, bd, dir)
if _, ok := m["duplicate_groups"]; !ok {
t.Error("expected 'duplicate_groups' key")
}
if _, ok := m["groups"]; !ok {
t.Error("expected 'groups' key")
}
})
// ===== Dry run =====
t.Run("dry_run", func(t *testing.T) {
m := bdDuplicatesJSON(t, bd, dir, "--dry-run")
if _, ok := m["merge_commands"]; !ok {
t.Error("expected 'merge_commands' key with --dry-run")
}
// Dry run should NOT have merge_results
if _, ok := m["merge_results"]; ok {
t.Error("dry run should not have merge_results")
}
})
// ===== Human-readable output =====
t.Run("human_readable", func(t *testing.T) {
out := bdDuplicates(t, bd, dir)
if !strings.Contains(out, "duplicate") && !strings.Contains(out, "Duplicate") && !strings.Contains(out, "No duplicates") {
t.Errorf("expected duplicate info in output: %s", out)
}
})
}
func TestEmbeddedDuplicatesOwnWorkspaces(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
t.Parallel()
bd := buildEmbeddedBD(t)
// ===== No duplicates when all unique =====
t.Run("no_duplicates", func(t *testing.T) {
@ -89,18 +132,6 @@ func TestEmbeddedDuplicates(t *testing.T) {
}
})
// ===== JSON output =====
t.Run("json_output_structure", func(t *testing.T) {
m := bdDuplicatesJSON(t, bd, dir)
if _, ok := m["duplicate_groups"]; !ok {
t.Error("expected 'duplicate_groups' key")
}
if _, ok := m["groups"]; !ok {
t.Error("expected 'groups' key")
}
})
// ===== Auto-merge =====
t.Run("auto_merge", func(t *testing.T) {
@ -142,19 +173,6 @@ func TestEmbeddedDuplicates(t *testing.T) {
}
})
// ===== Dry run =====
t.Run("dry_run", func(t *testing.T) {
m := bdDuplicatesJSON(t, bd, dir, "--dry-run")
if _, ok := m["merge_commands"]; !ok {
t.Error("expected 'merge_commands' key with --dry-run")
}
// Dry run should NOT have merge_results
if _, ok := m["merge_results"]; ok {
t.Error("dry run should not have merge_results")
}
})
// ===== Excludes closed issues =====
t.Run("excludes_closed", func(t *testing.T) {
@ -170,15 +188,6 @@ func TestEmbeddedDuplicates(t *testing.T) {
t.Log("mixed open/closed duplicates detected — expected 0 groups due to status mismatch")
}
})
// ===== Human-readable output =====
t.Run("human_readable", func(t *testing.T) {
out := bdDuplicates(t, bd, dir)
if !strings.Contains(out, "duplicate") && !strings.Contains(out, "Duplicate") && !strings.Contains(out, "No duplicates") {
t.Errorf("expected duplicate info in output: %s", out)
}
})
}
// TestEmbeddedDuplicatesConcurrent exercises duplicates operations concurrently.

View file

@ -119,12 +119,15 @@ func TestEmbeddedEpicStatus(t *testing.T) {
})
}
// TestEmbeddedEpicCloseEligible was split from TestEmbeddedEpic (originally
// TestEmbeddedEpicCloseEligible* was split from TestEmbeddedEpic (originally
// ~362s, measured under --config=embedded) into 3 top-level tests over
// disjoint subtest groups, for CI shard balance (see
// scripts/ci/embedded_cmd_test_durations.json and engdocs/TESTING.md). Every original
// subtest is preserved exactly once.
func TestEmbeddedEpicCloseEligible(t *testing.T) {
// subtest is preserved exactly once. It is split again in two:
// TestEmbeddedEpicCloseEligibleNotEligible keeps the shared not-eligible epic
// fixture and the two subtests that read it, and
// TestEmbeddedEpicCloseEligibleClosesEpics the two that build their own.
func TestEmbeddedEpicCloseEligibleNotEligible(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
@ -156,6 +159,23 @@ func TestEmbeddedEpicCloseEligible(t *testing.T) {
}
})
t.Run("close_eligible_none", func(t *testing.T) {
// epic1 has open children — should not be closeable
out := bdEpic(t, bd, dir, "close-eligible")
if strings.Contains(out, epic1.ID) {
t.Errorf("epic1 should not be closed: %s", out)
}
})
}
func TestEmbeddedEpicCloseEligibleClosesEpics(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
t.Parallel()
bd := buildEmbeddedBD(t)
t.Run("close_eligible_closes_epics", func(t *testing.T) {
dir3, _, _ := bdInit(t, bd, "--prefix", "ep3")
e := bdCreate(t, bd, dir3, "Close me epic", "--type", "epic")
@ -202,14 +222,6 @@ func TestEmbeddedEpicCloseEligible(t *testing.T) {
t.Fatalf("no JSON: %s", s)
}
})
t.Run("close_eligible_none", func(t *testing.T) {
// epic1 has open children — should not be closeable
out := bdEpic(t, bd, dir, "close-eligible")
if strings.Contains(out, epic1.ID) {
t.Errorf("epic1 should not be closed: %s", out)
}
})
}
// TestEmbeddedEpicCloseEligibleReason was split from TestEmbeddedEpic

View file

@ -97,11 +97,10 @@ func createBeadGate(t *testing.T, bd, dir, awaitID string) *types.Issue {
return &gate
}
func TestEmbeddedGate(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
t.Parallel()
// setupEmbeddedGate is the TestEmbeddedGate* tests' workspace: prefix tg,
// with "gate" registered as a custom type.
func setupEmbeddedGate(t *testing.T) (string, string) {
t.Helper()
bd := buildEmbeddedBD(t)
dir, beadsDir, _ := bdInit(t, bd, "--prefix", "tg")
@ -112,6 +111,16 @@ func TestEmbeddedGate(t *testing.T) {
t.Fatalf("SetConfig types.custom: %v", err)
}
store.Close()
return bd, dir
}
func TestEmbeddedGateList(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
t.Parallel()
bd, dir := setupEmbeddedGate(t)
// ===== Gate List =====
@ -173,6 +182,15 @@ func TestEmbeddedGate(t *testing.T) {
t.Errorf("expected at most 1 result with --limit 1, got %d", len(results))
}
})
}
func TestEmbeddedGateShowResolve(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
t.Parallel()
bd, dir := setupEmbeddedGate(t)
// ===== Gate Show =====
@ -233,6 +251,15 @@ func TestEmbeddedGate(t *testing.T) {
task := bdCreate(t, bd, dir, "Not a gate resolve", "--type", "task")
bdGateFail(t, bd, dir, "resolve", task.ID)
})
}
func TestEmbeddedGateWaiterCheckLifecycle(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
t.Parallel()
bd, dir := setupEmbeddedGate(t)
// ===== Gate Add-Waiter =====
@ -375,12 +402,11 @@ func TestEmbeddedGate(t *testing.T) {
})
}
// TestEmbeddedGateCreate exercises the "bd gate create" subcommand.
func TestEmbeddedGateCreate(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
t.Parallel()
// setupEmbeddedGateCreate is the shared workspace of the
// TestEmbeddedGateCreate* tests ("bd gate create"): prefix gc, with "gate"
// registered as a custom type so bd gate create works.
func setupEmbeddedGateCreate(t *testing.T) (string, string) {
t.Helper()
bd := buildEmbeddedBD(t)
dir, beadsDir, _ := bdInit(t, bd, "--prefix", "gc")
@ -391,6 +417,16 @@ func TestEmbeddedGateCreate(t *testing.T) {
t.Fatalf("SetConfig types.custom: %v", err)
}
store.Close()
return bd, dir
}
func TestEmbeddedGateCreateFlags(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
t.Parallel()
bd, dir := setupEmbeddedGateCreate(t)
t.Run("create_default_human_gate", func(t *testing.T) {
task := bdCreate(t, bd, dir, "Task for human gate", "--type", "task")
@ -492,6 +528,15 @@ func TestEmbeddedGateCreate(t *testing.T) {
t.Errorf("expected title 'Gate: gh:pr 42', got %s", gate.Title)
}
})
}
func TestEmbeddedGateCreateRepoErrorsList(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
t.Parallel()
bd, dir := setupEmbeddedGateCreate(t)
t.Run("create_gate_with_repo", func(t *testing.T) {
task := bdCreate(t, bd, dir, "Task for cross-repo PR gate", "--type", "task")
@ -536,6 +581,48 @@ func TestEmbeddedGateCreate(t *testing.T) {
}
})
t.Run("create_gate_missing_blocks_flag", func(t *testing.T) {
out := bdGateFail(t, bd, dir, "create")
if !strings.Contains(out, "blocks") {
t.Errorf("expected error about missing --blocks flag: %s", out)
}
})
t.Run("create_gate_nonexistent_target", func(t *testing.T) {
out := bdGateFail(t, bd, dir, "create", "--blocks", "gc-nonexistent999")
if !strings.Contains(out, "not found") {
t.Errorf("expected 'not found' error: %s", out)
}
})
t.Run("create_gate_appears_in_gate_list", func(t *testing.T) {
task := bdCreate(t, bd, dir, "Task for list check", "--type", "task")
bdGate(t, bd, dir, "create", "--blocks", task.ID)
results := bdGateListJSON(t, bd, dir)
found := false
for _, r := range results {
if awaitType, ok := r["await_type"]; ok && awaitType == "human" {
if desc, ok := r["description"].(string); ok && strings.Contains(desc, task.ID) {
found = true
break
}
}
}
if !found {
t.Errorf("expected gate blocking %s in gate list", task.ID)
}
})
}
func TestEmbeddedGateCreateReady(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
t.Parallel()
bd := buildEmbeddedBD(t)
t.Run("create_gate_blocks_ready", func(t *testing.T) {
// Use a fresh db so ready output isn't polluted by other subtests
freshDir, freshBeads, _ := bdInit(t, bd, "--prefix", "gr")
@ -620,39 +707,15 @@ func TestEmbeddedGateCreate(t *testing.T) {
t.Errorf("task should reappear in ready after gate resolved: %s", stdout.String())
}
})
}
t.Run("create_gate_missing_blocks_flag", func(t *testing.T) {
out := bdGateFail(t, bd, dir, "create")
if !strings.Contains(out, "blocks") {
t.Errorf("expected error about missing --blocks flag: %s", out)
}
})
func TestEmbeddedGateCreateBeadCheck(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
t.Parallel()
t.Run("create_gate_nonexistent_target", func(t *testing.T) {
out := bdGateFail(t, bd, dir, "create", "--blocks", "gc-nonexistent999")
if !strings.Contains(out, "not found") {
t.Errorf("expected 'not found' error: %s", out)
}
})
t.Run("create_gate_appears_in_gate_list", func(t *testing.T) {
task := bdCreate(t, bd, dir, "Task for list check", "--type", "task")
bdGate(t, bd, dir, "create", "--blocks", task.ID)
results := bdGateListJSON(t, bd, dir)
found := false
for _, r := range results {
if awaitType, ok := r["await_type"]; ok && awaitType == "human" {
if desc, ok := r["description"].(string); ok && strings.Contains(desc, task.ID) {
found = true
break
}
}
}
if !found {
t.Errorf("expected gate blocking %s in gate list", task.ID)
}
})
bd := buildEmbeddedBD(t)
t.Run("check_bead_gate_resolves_only_a_missing_target_it_saw", func(t *testing.T) {
// Use a fresh db so the check sees only these bead gates
@ -690,6 +753,15 @@ func TestEmbeddedGateCreate(t *testing.T) {
t.Errorf("gate on a never-seen await_id: status=%s, want open", got.Status)
}
})
}
func TestEmbeddedGateCreateBeadRename(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
t.Parallel()
bd := buildEmbeddedBD(t)
t.Run("rename_keeps_a_bead_gate_on_its_target", func(t *testing.T) {
// Renaming the awaited bead points its gate at the new ID and moves

View file

@ -39,7 +39,7 @@ func bdGCFail(t *testing.T, bd, dir string, args ...string) string {
return string(out)
}
func TestEmbeddedGC(t *testing.T) {
func TestEmbeddedGCDryRunAndSkips(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
@ -98,6 +98,22 @@ func TestEmbeddedGC(t *testing.T) {
}
})
t.Run("gc_full_dry_run", func(t *testing.T) {
out := bdGC(t, bd, dir, "--full", "--dry-run")
if !strings.Contains(out, "full DOLT_GC()") {
t.Errorf("dry run does not say it would run a full GC: %s", out)
}
})
}
func TestEmbeddedGCForceWithDecay(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
t.Parallel()
bd := buildEmbeddedBD(t)
// ===== Force with Decay =====
t.Run("gc_force_with_decay", func(t *testing.T) {
@ -125,6 +141,15 @@ func TestEmbeddedGC(t *testing.T) {
}
}
})
}
func TestEmbeddedGCFullAndNoForcePrompts(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
t.Parallel()
bd := buildEmbeddedBD(t)
// ===== Full GC =====
@ -147,13 +172,6 @@ func TestEmbeddedGC(t *testing.T) {
}
})
t.Run("gc_full_dry_run", func(t *testing.T) {
out := bdGC(t, bd, dir, "--full", "--dry-run")
if !strings.Contains(out, "full DOLT_GC()") {
t.Errorf("dry run does not say it would run a full GC: %s", out)
}
})
// ===== No --force prompts =====
t.Run("gc_no_force_prompts", func(t *testing.T) {

View file

@ -48,7 +48,7 @@ func humanShowClosed(t *testing.T, bd, dir, id string) *types.Issue {
return issue
}
func TestEmbeddedHuman(t *testing.T) {
func TestEmbeddedHumanListStatsRespondDismiss(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
@ -127,6 +127,16 @@ func TestEmbeddedHuman(t *testing.T) {
t.Errorf("expected dismiss reason %q, got %q", "Dismissed: Not needed", issue2.CloseReason)
}
})
}
func TestEmbeddedHumanPositionalFileAndGuards(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
t.Parallel()
bd := buildEmbeddedBD(t)
dir, _, _ := bdInit(t, bd, "--prefix", "th")
// ===== Respond via positional text and --file =====

View file

@ -11,6 +11,7 @@ import (
"os/exec"
"path/filepath"
"runtime"
"slices"
"strings"
"sync"
"testing"
@ -338,12 +339,12 @@ func requireNoFile(t *testing.T, path string) {
}
}
// TestEmbeddedInitA, TestEmbeddedInitB, and TestEmbeddedInitC were split from
// TestEmbeddedInit (originally ~356s, measured under --config=embedded) into
// 3 top-level tests over disjoint subtest groups, for CI shard balance (see
// scripts/ci/embedded_cmd_test_durations.json and engdocs/TESTING.md). Every original
// subtest is preserved exactly once.
func TestEmbeddedInitA(t *testing.T) {
// The TestEmbeddedInitA*, TestEmbeddedInitB* and TestEmbeddedInitC tests were
// split from TestEmbeddedInit (originally ~356s, measured under
// --config=embedded) into top-level tests over disjoint subtest groups, for CI
// shard balance (see scripts/ci/embedded_cmd_test_durations.json and
// engdocs/TESTING.md). Every original subtest is preserved exactly once.
func TestEmbeddedInitABasic(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt init tests")
}
@ -478,6 +479,15 @@ func TestEmbeddedInitA(t *testing.T) {
t.Errorf("issue_prefix: got %q, want %q", val, "alpha")
}
})
}
func TestEmbeddedInitAForkAutoContributor(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt init tests")
}
t.Parallel()
bd := buildEmbeddedBD(t)
t.Run("fork_auto_contributor", func(t *testing.T) {
dir := t.TempDir()
@ -541,6 +551,15 @@ func TestEmbeddedInitA(t *testing.T) {
t.Errorf("beads.role: got %q, want %q", role, "contributor")
}
})
}
func TestEmbeddedInitAGitOriginRemote(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt init tests")
}
t.Parallel()
bd := buildEmbeddedBD(t)
t.Run("git_origin_registered_as_dolt_remote", func(t *testing.T) {
bareDir := filepath.Join(t.TempDir(), "plain.git")
@ -583,6 +602,15 @@ func TestEmbeddedInitA(t *testing.T) {
t.Fatalf("bd dolt push did not publish refs/dolt/data:\n%s", lsOut)
}
})
}
func TestEmbeddedInitAPushConsentAndRemoteBootstrap(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt init tests")
}
t.Parallel()
bd := buildEmbeddedBD(t)
// The #5068 refusal and consent paths, end to end.
@ -768,7 +796,7 @@ func TestEmbeddedInitA(t *testing.T) {
})
}
func TestEmbeddedInitB(t *testing.T) {
func TestEmbeddedInitBRemoteSchemaAndCloneFailure(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt init tests")
}
@ -926,6 +954,15 @@ func TestEmbeddedInitB(t *testing.T) {
t.Fatalf(".beads/config.yaml should not exist after a failed clone; init must not silently fall through to fresh init")
}
})
}
func TestEmbeddedInitBStealthAndForceReinit(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt init tests")
}
t.Parallel()
bd := buildEmbeddedBD(t)
// Regression: bd init --stealth must not touch any git-visible files. Previously it
// created/modified the tracked project-root .gitignore via doctor.EnsureProjectGitignore, which
@ -1090,6 +1127,15 @@ func TestEmbeddedInitB(t *testing.T) {
t.Errorf("issue_prefix after --force: got %q, want %q", val, "fi")
}
})
}
func TestEmbeddedInitBAutoCommitAndJSONLRemote(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt init tests")
}
t.Parallel()
bd := buildEmbeddedBD(t)
t.Run("auto_commit_bypasses_hooks", func(t *testing.T) {
dir := t.TempDir()
@ -1527,7 +1573,17 @@ func TestInitGateBusyClassifiedAsLockContention(t *testing.T) {
}
}
func TestEmbeddedInitRoleRouting(t *testing.T) {
// The role routing cases are two top-level tests, not one: each case is a
// full embedded init under -race and they cannot run in parallel (t.Setenv).
func TestEmbeddedInitRoleRoutingExplicitDefault(t *testing.T) {
testEmbeddedInitRoleRouting(t, "explicit", "default")
}
func TestEmbeddedInitRoleRoutingRetainedFork(t *testing.T) {
testEmbeddedInitRoleRouting(t, "retained", "fork")
}
func testEmbeddedInitRoleRouting(t *testing.T, names ...string) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt init tests")
}
@ -1539,6 +1595,9 @@ func TestEmbeddedInitRoleRouting(t *testing.T) {
{"retained", "contributor", "", "contributor"},
{"fork", "", "", "contributor"},
} {
if !slices.Contains(names, tc.name) {
continue
}
t.Run(tc.name, func(t *testing.T) {
target, decoy, home := newInitRoleFixture(t)
if tc.initial != "" {
@ -1606,15 +1665,23 @@ func TestEmbeddedInitRoleRouting(t *testing.T) {
}
}
// The selected-exclude routing cases are two top-level tests, not one: each
// The selected-exclude routing cases are four top-level tests, not one: each
// case is a full embedded init under -race and they cannot run in parallel
// (t.Setenv), so one function held a whole Bazel shard for ~2 minutes.
func TestEmbeddedInitSelectedExcludeRoutingStealth(t *testing.T) {
testEmbeddedInitSelectedExcludeRouting(t, "stealth_decoy", "stealth_invalid", "quiet_stealth")
func TestEmbeddedInitSelectedExcludeRoutingStealthInvalid(t *testing.T) {
testEmbeddedInitSelectedExcludeRouting(t, "stealth_invalid")
}
func TestEmbeddedInitSelectedExcludeRoutingFork(t *testing.T) {
testEmbeddedInitSelectedExcludeRouting(t, "fork_decoy", "fork_invalid", "quiet_fork", "fork_auto_invalid")
func TestEmbeddedInitSelectedExcludeRoutingStealthDecoyQuiet(t *testing.T) {
testEmbeddedInitSelectedExcludeRouting(t, "stealth_decoy", "quiet_stealth")
}
func TestEmbeddedInitSelectedExcludeRoutingForkDecoyAuto(t *testing.T) {
testEmbeddedInitSelectedExcludeRouting(t, "fork_decoy", "fork_auto_invalid")
}
func TestEmbeddedInitSelectedExcludeRoutingForkInvalidQuiet(t *testing.T) {
testEmbeddedInitSelectedExcludeRouting(t, "fork_invalid", "quiet_fork")
}
func testEmbeddedInitSelectedExcludeRouting(t *testing.T, names ...string) {
@ -1744,12 +1811,27 @@ func TestEmbeddedInitArtifactRouting(t *testing.T) {
}
}
func TestEmbeddedInitGitBootstrapRouting(t *testing.T) {
// The git bootstrap routing cases are three top-level tests, not one: each
// case is a full embedded init under -race and they cannot run in parallel
// (t.Setenv).
func TestEmbeddedInitGitBootstrapRoutingFreshQuiet(t *testing.T) {
testEmbeddedInitGitBootstrapRouting(t, "fresh", "quiet")
}
func TestEmbeddedInitGitBootstrapRoutingDecoyInvalid(t *testing.T) {
testEmbeddedInitGitBootstrapRouting(t, "decoy", "invalid")
}
func TestEmbeddedInitGitBootstrapRoutingExistingExplicit(t *testing.T) {
testEmbeddedInitGitBootstrapRouting(t, "existing_invalid", "explicit_storage")
}
func testEmbeddedInitGitBootstrapRouting(t *testing.T, names ...string) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt init tests")
}
bd := buildEmbeddedBD(t)
for _, name := range []string{"fresh", "decoy", "invalid", "existing_invalid", "explicit_storage", "quiet"} {
for _, name := range names {
t.Run(name, func(t *testing.T) {
existing, decoy, home := newInitRoleFixture(t)
target := t.TempDir()

View file

@ -125,12 +125,15 @@ func markIssueTemplate(t *testing.T, beadsDir, database, issueID string) {
}
}
// TestEmbeddedLabelAddRemove was split from TestEmbeddedLabel (originally
// ~360s, measured under --config=embedded) into 3 top-level tests over
// disjoint subtest groups, for CI shard balance (see
// scripts/ci/embedded_cmd_test_durations.json and engdocs/TESTING.md). Every original
// subtest is preserved exactly once.
func TestEmbeddedLabelAddRemove(t *testing.T) {
// The TestEmbeddedLabelAddRemove* and TestEmbeddedLabelEditReports* tests
// were split from TestEmbeddedLabel (originally ~360s, measured under
// --config=embedded) into top-level tests over disjoint subtest groups, each
// on its own workspace, for CI shard balance (see
// scripts/ci/embedded_cmd_test_durations.json and engdocs/TESTING.md). Every
// original subtest is preserved exactly once, in its original order within
// its group; the label list-all subtests still follow subtests that add
// labels.
func TestEmbeddedLabelAddRemoveAdd(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
@ -189,6 +192,16 @@ func TestEmbeddedLabelAddRemove(t *testing.T) {
t.Errorf("expected valid JSON: %s", s)
}
})
}
func TestEmbeddedLabelAddRemoveMultiAndDuplicate(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
t.Parallel()
bd := buildEmbeddedBD(t)
dir, _, _ := bdInit(t, bd, "--prefix", "tl")
t.Run("label_add_comma_separated_multi", func(t *testing.T) {
issue := bdCreate(t, bd, dir, "Multi label add", "--type", "task")
@ -244,6 +257,16 @@ func TestEmbeddedLabelAddRemove(t *testing.T) {
t.Errorf("expected exactly 1 'dup' label, got %d in %v", count, labels)
}
})
}
func TestEmbeddedLabelAddRemoveRemove(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
t.Parallel()
bd := buildEmbeddedBD(t)
dir, _, _ := bdInit(t, bd, "--prefix", "tl")
// ===== Label Remove =====
@ -375,19 +398,15 @@ func TestEmbeddedLabelAddRemove(t *testing.T) {
})
}
// TestEmbeddedLabelEditReports was split from TestEmbeddedLabel (originally
// ~360s, measured under --config=embedded) into 3 top-level tests over
// disjoint subtest groups, for CI shard balance (see
// scripts/ci/embedded_cmd_test_durations.json and engdocs/TESTING.md). Every original
// subtest is preserved exactly once.
func TestEmbeddedLabelEditReports(t *testing.T) {
// See TestEmbeddedLabelAddRemoveAdd for the TestEmbeddedLabel split.
func TestEmbeddedLabelEditReportsPrefix(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
t.Parallel()
bd := buildEmbeddedBD(t)
dir, beadsDir, _ := bdInit(t, bd, "--prefix", "tl")
dir, _, _ := bdInit(t, bd, "--prefix", "tl")
// Two issues carrying DIFFERENT matching sets: the report is per issue and
// each issue's set is resolved from its own labels, so a refactor that
@ -476,6 +495,16 @@ func TestEmbeddedLabelEditReports(t *testing.T) {
t.Errorf("expected valid JSON: %s", s)
}
})
}
func TestEmbeddedLabelEditReportsNoop(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
t.Parallel()
bd := buildEmbeddedBD(t)
dir, _, _ := bdInit(t, bd, "--prefix", "tl")
// ===== No-op edits (GH#5988) =====
//
@ -584,6 +613,16 @@ func TestEmbeddedLabelEditReports(t *testing.T) {
t.Errorf("add claimed an edit on the issue that already had the label: %s", out)
}
})
}
func TestEmbeddedLabelEditReportsListAndTemplate(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
t.Parallel()
bd := buildEmbeddedBD(t)
dir, beadsDir, _ := bdInit(t, bd, "--prefix", "tl")
// ===== Label List =====

View file

@ -177,22 +177,33 @@ type testSeedData struct {
readyTask string // P0, labels: backend, no blockers
}
// TestEmbeddedListFiltering and TestEmbeddedListSearchAndOutput were split
// from TestEmbeddedList (originally ~298s, measured under --config=embedded)
// into 2 top-level tests over disjoint subtest groups, for CI shard balance
// (see scripts/ci/embedded_cmd_test_durations.json and engdocs/TESTING.md). Every original
// subtest is preserved exactly once.
func TestEmbeddedListFiltering(t *testing.T) {
// seededListWorkspace is the TestEmbeddedList* tests' shared setup: an
// initialized workspace seeded by seedTestData.
func seededListWorkspace(t *testing.T) (bd, dir string, seed testSeedData) {
t.Helper()
bd = buildEmbeddedBD(t)
dir, _, _ = bdInit(t, bd, "--prefix", "tl")
// Seed test data
seed = seedTestData(t, bd, dir)
return bd, dir, seed
}
// The TestEmbeddedListFiltering* and TestEmbeddedListSearchAndOutput* tests
// were split from TestEmbeddedList (originally ~298s, measured under
// --config=embedded) into top-level tests over disjoint subtest groups, each
// on its own seeded workspace, for CI shard balance (see
// scripts/ci/embedded_cmd_test_durations.json and engdocs/TESTING.md). Every
// original subtest is preserved exactly once, in its original order within
// its group; each group ran on the unmodified seed in the original too (the
// subtests before each split point create no issues).
func TestEmbeddedListFilteringBasicAndLabels(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
t.Parallel()
bd := buildEmbeddedBD(t)
dir, _, _ := bdInit(t, bd, "--prefix", "tl")
// Seed test data
seed := seedTestData(t, bd, dir)
bd, dir, seed := seededListWorkspace(t)
// --- A. Basic filtering ---
@ -454,6 +465,15 @@ func TestEmbeddedListFiltering(t *testing.T) {
t.Fatalf("--skip-labels JSON leaked labels: %v", out.Issues[0].Labels)
}
})
}
func TestEmbeddedListFilteringStatusAndHierarchy(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
t.Parallel()
bd, dir, seed := seededListWorkspace(t)
// --- C. Status/special filtering ---
// Note: --ready, --pinned, --status closed/deferred/in_progress tests are
@ -612,17 +632,13 @@ func TestEmbeddedListFiltering(t *testing.T) {
})
}
func TestEmbeddedListSearchAndOutput(t *testing.T) {
func TestEmbeddedListSearchAndOutputSearchAndSort(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
t.Parallel()
bd := buildEmbeddedBD(t)
dir, _, _ := bdInit(t, bd, "--prefix", "tl")
// Seed test data
seed := seedTestData(t, bd, dir)
bd, dir, seed := seededListWorkspace(t)
// --- E. Content search ---
@ -725,6 +741,15 @@ func TestEmbeddedListSearchAndOutput(t *testing.T) {
}
}
})
}
func TestEmbeddedListSearchAndOutputFormats(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
t.Parallel()
bd, dir, seed := seededListWorkspace(t)
// --- I. Output formats ---

View file

@ -16,7 +16,7 @@ import (
"github.com/steveyegge/beads/internal/types"
)
func TestEmbeddedReady(t *testing.T) {
func TestEmbeddedReadyDefaultJSONAndFlags(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
@ -193,125 +193,6 @@ func TestEmbeddedReady(t *testing.T) {
}
})
// ===== With Blockers =====
t.Run("ready_excludes_blocked", func(t *testing.T) {
blocker := bdCreate(t, bd, dir, "Blocker issue", "--type", "task")
blocked := bdCreate(t, bd, dir, "Blocked by blocker", "--type", "task")
// Add blocking dependency: blocked depends on blocker
cmd := exec.Command(bd, "dep", "add", blocked.ID, blocker.ID)
cmd.Dir = dir
cmd.Env = bdEnv(dir)
if out, err := cmd.CombinedOutput(); err != nil {
t.Fatalf("dep add failed: %v\n%s", err, out)
}
cmd = exec.Command(bd, "ready")
cmd.Dir = dir
cmd.Env = bdEnv(dir)
stdout, stderr, err := runCommandBuffers(t, cmd)
if err != nil {
t.Fatalf("bd ready failed: %v\nstdout:\n%s\nstderr:\n%s", err, stdout.String(), stderr.String())
}
// The blocked issue should not appear in ready output
if strings.Contains(stdout.String(), "Blocked by blocker") {
t.Errorf("blocked issue should not appear in ready output: %s", stdout.String())
}
})
// ===== Exclude Label =====
t.Run("ready_exclude_label", func(t *testing.T) {
bdCreate(t, bd, dir, "Triage pending item", "--type", "task", "--label", "triage:pending")
bdCreate(t, bd, dir, "Normal ready item", "--type", "task")
cmd := exec.Command(bd, "ready", "--exclude-label", "triage:pending")
cmd.Dir = dir
cmd.Env = bdEnv(dir)
stdout, stderr, err := runCommandBuffers(t, cmd)
if err != nil {
t.Fatalf("bd ready --exclude-label failed: %v\nstdout:\n%s\nstderr:\n%s", err, stdout.String(), stderr.String())
}
if strings.Contains(stdout.String(), "Triage pending item") {
t.Errorf("triage:pending issue should not appear with --exclude-label: %s", stdout.String())
}
if !strings.Contains(stdout.String(), "Normal ready item") {
t.Errorf("normal issue should still appear with --exclude-label: %s", stdout.String())
}
})
// ===== Label Any =====
readyIDs := func(t *testing.T, args ...string) ([]string, string) {
t.Helper()
cmd := exec.Command(bd, args...)
cmd.Dir = dir
cmd.Env = bdEnv(dir)
stdout, stderr, err := runCommandBuffers(t, cmd)
if err != nil {
t.Fatalf("bd %s failed: %v\nstdout:\n%s\nstderr:\n%s",
strings.Join(args, " "), err, stdout.String(), stderr.String())
}
var issues []types.IssueWithCounts
if err := json.Unmarshal(bytes.TrimSpace(stdout.Bytes()), &issues); err != nil {
t.Fatalf("parse JSON: %v\n%s", err, stdout.String())
}
ids := make([]string, 0, len(issues))
for _, issue := range issues {
ids = append(ids, issue.ID)
}
return ids, stdout.String()
}
t.Run("ready_label_any", func(t *testing.T) {
laneA := bdCreate(t, bd, dir, "Lane A work", "--type", "task", "--label", "lany:lane-a")
bdCreate(t, bd, dir, "Lane B work", "--type", "task", "--label", "lany:lane-b")
laneC := bdCreate(t, bd, dir, "Lane C work", "--type", "task", "--label", "lany:lane-c")
ids, raw := readyIDs(t, "ready", "--json", "--label-any", "lany:lane-a,lany:lane-c")
want := map[string]bool{laneA.ID: true, laneC.ID: true}
if len(ids) != len(want) {
t.Fatalf("--label-any returned %d issues, want %d — an unfiltered ready set means the OR-set clause was dropped: %s",
len(ids), len(want), raw)
}
for _, id := range ids {
if !want[id] {
t.Fatalf("--label-any returned %s, which carries neither requested label: %s", id, raw)
}
}
})
t.Run("ready_label_any_intersects_with_label", func(t *testing.T) {
both := bdCreate(t, bd, dir, "Tiered lane A work", "--type", "task",
"--label", "lmix:tier", "--label", "lmix:lane-a")
bdCreate(t, bd, dir, "Untiered lane A work", "--type", "task", "--label", "lmix:lane-a")
bdCreate(t, bd, dir, "Tiered lane B work", "--type", "task",
"--label", "lmix:tier", "--label", "lmix:lane-b")
ids, raw := readyIDs(t, "ready", "--json",
"--label", "lmix:tier", "--label-any", "lmix:lane-a,lmix:lane-c")
if len(ids) != 1 || ids[0] != both.ID {
t.Fatalf("--label with --label-any returned %v, want only %s (AND-set and OR-set must both apply): %s",
ids, both.ID, raw)
}
})
t.Run("ready_claim_label_any_fences_to_its_lane", func(t *testing.T) {
// An exhausted lane must claim nothing. If --label-any is dropped here
// the claim silently takes unfenced work while the caller believes it
// is fenced to its own lane.
bdCreate(t, bd, dir, "Fence lane B work", "--type", "task", "--label", "lfence:lane-b")
ids, raw := readyIDs(t, "ready", "--claim", "--json", "--label-any", "lfence:lane-a")
if len(ids) != 0 {
t.Fatalf("--claim --label-any on an empty lane claimed %v, want nothing: %s", ids, raw)
}
})
// ===== -C flag =====
t.Run("ready_with_C_flag", func(t *testing.T) {
@ -424,6 +305,134 @@ func TestEmbeddedReady(t *testing.T) {
})
}
func TestEmbeddedReadyBlockersAndLabels(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
t.Parallel()
bd := buildEmbeddedBD(t)
dir, _, _ := bdInit(t, bd, "--prefix", "rd")
bdCreate(t, bd, dir, "Ready test issue", "--type", "task")
// ===== With Blockers =====
t.Run("ready_excludes_blocked", func(t *testing.T) {
blocker := bdCreate(t, bd, dir, "Blocker issue", "--type", "task")
blocked := bdCreate(t, bd, dir, "Blocked by blocker", "--type", "task")
// Add blocking dependency: blocked depends on blocker
cmd := exec.Command(bd, "dep", "add", blocked.ID, blocker.ID)
cmd.Dir = dir
cmd.Env = bdEnv(dir)
if out, err := cmd.CombinedOutput(); err != nil {
t.Fatalf("dep add failed: %v\n%s", err, out)
}
cmd = exec.Command(bd, "ready")
cmd.Dir = dir
cmd.Env = bdEnv(dir)
stdout, stderr, err := runCommandBuffers(t, cmd)
if err != nil {
t.Fatalf("bd ready failed: %v\nstdout:\n%s\nstderr:\n%s", err, stdout.String(), stderr.String())
}
// The blocked issue should not appear in ready output
if strings.Contains(stdout.String(), "Blocked by blocker") {
t.Errorf("blocked issue should not appear in ready output: %s", stdout.String())
}
})
// ===== Exclude Label =====
t.Run("ready_exclude_label", func(t *testing.T) {
bdCreate(t, bd, dir, "Triage pending item", "--type", "task", "--label", "triage:pending")
bdCreate(t, bd, dir, "Normal ready item", "--type", "task")
cmd := exec.Command(bd, "ready", "--exclude-label", "triage:pending")
cmd.Dir = dir
cmd.Env = bdEnv(dir)
stdout, stderr, err := runCommandBuffers(t, cmd)
if err != nil {
t.Fatalf("bd ready --exclude-label failed: %v\nstdout:\n%s\nstderr:\n%s", err, stdout.String(), stderr.String())
}
if strings.Contains(stdout.String(), "Triage pending item") {
t.Errorf("triage:pending issue should not appear with --exclude-label: %s", stdout.String())
}
if !strings.Contains(stdout.String(), "Normal ready item") {
t.Errorf("normal issue should still appear with --exclude-label: %s", stdout.String())
}
})
readyIDs := func(t *testing.T, args ...string) ([]string, string) {
t.Helper()
cmd := exec.Command(bd, args...)
cmd.Dir = dir
cmd.Env = bdEnv(dir)
stdout, stderr, err := runCommandBuffers(t, cmd)
if err != nil {
t.Fatalf("bd %s failed: %v\nstdout:\n%s\nstderr:\n%s",
strings.Join(args, " "), err, stdout.String(), stderr.String())
}
var issues []types.IssueWithCounts
if err := json.Unmarshal(bytes.TrimSpace(stdout.Bytes()), &issues); err != nil {
t.Fatalf("parse JSON: %v\n%s", err, stdout.String())
}
ids := make([]string, 0, len(issues))
for _, issue := range issues {
ids = append(ids, issue.ID)
}
return ids, stdout.String()
}
t.Run("ready_label_any", func(t *testing.T) {
laneA := bdCreate(t, bd, dir, "Lane A work", "--type", "task", "--label", "lany:lane-a")
bdCreate(t, bd, dir, "Lane B work", "--type", "task", "--label", "lany:lane-b")
laneC := bdCreate(t, bd, dir, "Lane C work", "--type", "task", "--label", "lany:lane-c")
ids, raw := readyIDs(t, "ready", "--json", "--label-any", "lany:lane-a,lany:lane-c")
want := map[string]bool{laneA.ID: true, laneC.ID: true}
if len(ids) != len(want) {
t.Fatalf("--label-any returned %d issues, want %d — an unfiltered ready set means the OR-set clause was dropped: %s",
len(ids), len(want), raw)
}
for _, id := range ids {
if !want[id] {
t.Fatalf("--label-any returned %s, which carries neither requested label: %s", id, raw)
}
}
})
t.Run("ready_label_any_intersects_with_label", func(t *testing.T) {
both := bdCreate(t, bd, dir, "Tiered lane A work", "--type", "task",
"--label", "lmix:tier", "--label", "lmix:lane-a")
bdCreate(t, bd, dir, "Untiered lane A work", "--type", "task", "--label", "lmix:lane-a")
bdCreate(t, bd, dir, "Tiered lane B work", "--type", "task",
"--label", "lmix:tier", "--label", "lmix:lane-b")
ids, raw := readyIDs(t, "ready", "--json",
"--label", "lmix:tier", "--label-any", "lmix:lane-a,lmix:lane-c")
if len(ids) != 1 || ids[0] != both.ID {
t.Fatalf("--label with --label-any returned %v, want only %s (AND-set and OR-set must both apply): %s",
ids, both.ID, raw)
}
})
t.Run("ready_claim_label_any_fences_to_its_lane", func(t *testing.T) {
// An exhausted lane must claim nothing. If --label-any is dropped here
// the claim silently takes unfenced work while the caller believes it
// is fenced to its own lane.
bdCreate(t, bd, dir, "Fence lane B work", "--type", "task", "--label", "lfence:lane-b")
ids, raw := readyIDs(t, "ready", "--claim", "--json", "--label-any", "lfence:lane-a")
if len(ids) != 0 {
t.Fatalf("--claim --label-any on an empty lane claimed %v, want nothing: %s", ids, raw)
}
})
}
func TestEmbeddedReadyConcurrent(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")

View file

@ -64,7 +64,7 @@ func bdSearchJSON(t *testing.T, bd, dir string, args ...string) []map[string]int
return results
}
func TestEmbeddedSearch(t *testing.T) {
func TestEmbeddedSearchQueryStatusAssigneeLabels(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
@ -140,42 +140,6 @@ func TestEmbeddedSearch(t *testing.T) {
}
})
t.Run("search_status_all", func(t *testing.T) {
// Use prefix to match all issues
results := bdSearchJSON(t, bd, dir, "sr-", "--status", "all")
ids := map[string]bool{}
for _, r := range results {
ids[r["id"].(string)] = true
}
if !ids[taskA.ID] || !ids[closedTask.ID] {
t.Error("expected both open and closed issues with --status all")
}
})
t.Run("search_default_includes_closed", func(t *testing.T) {
// bd-t5yex: "was this already filed/fixed?" is the dominant search
// query, so the default must not silently hide closed issues.
results := bdSearchJSON(t, bd, dir, "sr-")
ids := map[string]bool{}
for _, r := range results {
ids[r["id"].(string)] = true
}
if !ids[taskA.ID] || !ids[closedTask.ID] {
t.Error("expected default search to include open and closed issues")
}
})
t.Run("search_status_comma_separated", func(t *testing.T) {
results := bdSearchJSON(t, bd, dir, "sr-", "--status", "open,closed")
ids := map[string]bool{}
for _, r := range results {
ids[r["id"].(string)] = true
}
if !ids[taskA.ID] || !ids[closedTask.ID] {
t.Error("expected both open and closed issues with --status open,closed")
}
})
t.Run("search_status_invalid", func(t *testing.T) {
out := bdSearchFail(t, bd, dir, "sr-", "--status", "not-a-status")
if !strings.Contains(out, "invalid status") || !strings.Contains(out, "not-a-status") {
@ -257,6 +221,97 @@ func TestEmbeddedSearch(t *testing.T) {
}
})
// ===== Description Filters =====
t.Run("search_desc_contains", func(t *testing.T) {
results := bdSearchJSON(t, bd, dir, "sr-", "--desc-contains", "alpha")
found := false
for _, r := range results {
if r["id"] == taskA.ID {
found = true
}
}
if !found {
t.Error("expected to find taskA with --desc-contains alpha")
}
})
t.Run("search_empty_description", func(t *testing.T) {
results := bdSearchJSON(t, bd, dir, "sr-", "--empty-description")
found := false
for _, r := range results {
if r["id"] == taskD.ID {
found = true
}
}
if !found {
t.Error("expected to find task without description")
}
for _, r := range results {
if r["id"] == taskA.ID {
t.Error("task with description should not appear with --empty-description")
}
}
})
_ = taskB
_ = taskC
_ = taskD
}
func TestEmbeddedSearchStatusLimitSortDatesMetadata(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
t.Parallel()
bd := buildEmbeddedBD(t)
dir, _, _ := bdInit(t, bd, "--prefix", "sr")
// Create test fixtures
taskA := bdCreate(t, bd, dir, "Alpha task", "--type", "task", "--priority", "1", "--assignee", "alice", "--description", "Important alpha work", "--label", "urgent")
taskB := bdCreate(t, bd, dir, "Beta bug", "--type", "bug", "--priority", "3", "--assignee", "bob", "--description", "Beta bug description", "--label", "backend")
taskC := bdCreate(t, bd, dir, "Gamma feature", "--type", "feature", "--priority", "2", "--label", "urgent", "--label", "frontend")
taskD := bdCreate(t, bd, dir, "Delta task no desc", "--type", "task")
closedTask := bdCreate(t, bd, dir, "Closed epsilon", "--type", "task")
bdClose(t, bd, dir, closedTask.ID)
t.Run("search_status_all", func(t *testing.T) {
// Use prefix to match all issues
results := bdSearchJSON(t, bd, dir, "sr-", "--status", "all")
ids := map[string]bool{}
for _, r := range results {
ids[r["id"].(string)] = true
}
if !ids[taskA.ID] || !ids[closedTask.ID] {
t.Error("expected both open and closed issues with --status all")
}
})
t.Run("search_default_includes_closed", func(t *testing.T) {
// bd-t5yex: "was this already filed/fixed?" is the dominant search
// query, so the default must not silently hide closed issues.
results := bdSearchJSON(t, bd, dir, "sr-")
ids := map[string]bool{}
for _, r := range results {
ids[r["id"].(string)] = true
}
if !ids[taskA.ID] || !ids[closedTask.ID] {
t.Error("expected default search to include open and closed issues")
}
})
t.Run("search_status_comma_separated", func(t *testing.T) {
results := bdSearchJSON(t, bd, dir, "sr-", "--status", "open,closed")
ids := map[string]bool{}
for _, r := range results {
ids[r["id"].(string)] = true
}
if !ids[taskA.ID] || !ids[closedTask.ID] {
t.Error("expected both open and closed issues with --status open,closed")
}
})
// ===== Limit =====
t.Run("search_limit", func(t *testing.T) {
@ -323,39 +378,6 @@ func TestEmbeddedSearch(t *testing.T) {
}
})
// ===== Description Filters =====
t.Run("search_desc_contains", func(t *testing.T) {
results := bdSearchJSON(t, bd, dir, "sr-", "--desc-contains", "alpha")
found := false
for _, r := range results {
if r["id"] == taskA.ID {
found = true
}
}
if !found {
t.Error("expected to find taskA with --desc-contains alpha")
}
})
t.Run("search_empty_description", func(t *testing.T) {
results := bdSearchJSON(t, bd, dir, "sr-", "--empty-description")
found := false
for _, r := range results {
if r["id"] == taskD.ID {
found = true
}
}
if !found {
t.Error("expected to find task without description")
}
for _, r := range results {
if r["id"] == taskA.ID {
t.Error("task with description should not appear with --empty-description")
}
}
})
// ===== Long Output =====
t.Run("search_long", func(t *testing.T) {

View file

@ -300,14 +300,21 @@ func TestEmbeddedShowBasicsAndJSON(t *testing.T) {
})
}
func TestEmbeddedShowDetailAndCurrent(t *testing.T) {
// TestEmbeddedShowDetailAndCurrentFlags and
// TestEmbeddedShowDetailAndCurrentHistoryAndCurrent were split from
// TestEmbeddedShowDetailAndCurrent into two top-level tests over disjoint
// subtest groups, each on its own workspace, for CI shard balance. Every
// subtest is preserved exactly once, in its original order within its group;
// show_current_fallback_to_last_touched still follows subtests that show
// issues (show_as_of, show_local_time).
func TestEmbeddedShowDetailAndCurrentFlags(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
t.Parallel()
bd := buildEmbeddedBD(t)
dir, beadsDir, _ := bdInit(t, bd, "--prefix", "ts")
dir, _, _ := bdInit(t, bd, "--prefix", "ts")
// ===== --long =====
@ -362,6 +369,16 @@ func TestEmbeddedShowDetailAndCurrent(t *testing.T) {
// Should not error even with no children
_ = bdShowRaw(t, bd, dir, issue.ID, "--children")
})
}
func TestEmbeddedShowDetailAndCurrentHistoryAndCurrent(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
t.Parallel()
bd := buildEmbeddedBD(t)
dir, beadsDir, _ := bdInit(t, bd, "--prefix", "ts")
// ===== --as-of =====

View file

@ -104,14 +104,22 @@ func createSwarmableEpic(t *testing.T, bd, dir, prefix string) (epicID string, c
return epicID, childIDs
}
func TestEmbeddedSwarm(t *testing.T) {
// setupEmbeddedSwarm is the TestEmbeddedSwarm* tests' workspace (prefix sw).
func setupEmbeddedSwarm(t *testing.T) (string, string) {
t.Helper()
bd := buildEmbeddedBD(t)
dir, _, _ := bdInit(t, bd, "--prefix", "sw")
return bd, dir
}
func TestEmbeddedSwarmValidate(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
t.Parallel()
bd := buildEmbeddedBD(t)
dir, _, _ := bdInit(t, bd, "--prefix", "sw")
bd, dir := setupEmbeddedSwarm(t)
epicID, _ := createSwarmableEpic(t, bd, dir, "Swarm")
@ -149,6 +157,15 @@ func TestEmbeddedSwarm(t *testing.T) {
t.Errorf("expected warning about no children: %s", out)
}
})
}
func TestEmbeddedSwarmCreate(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
t.Parallel()
bd, dir := setupEmbeddedSwarm(t)
// ===== swarm create =====
@ -176,6 +193,15 @@ func TestEmbeddedSwarm(t *testing.T) {
t.Errorf("expected coordinator=alice, got %v", m["coordinator"])
}
})
}
func TestEmbeddedSwarmCreateForceAndErrors(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
t.Parallel()
bd, dir := setupEmbeddedSwarm(t)
t.Run("create_force", func(t *testing.T) {
eID, _ := createSwarmableEpic(t, bd, dir, "Force")
@ -202,6 +228,15 @@ func TestEmbeddedSwarm(t *testing.T) {
bdSwarm(t, bd, dir, "create", eID)
bdSwarmFail(t, bd, dir, "create", eID)
})
}
func TestEmbeddedSwarmStatusList(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
t.Parallel()
bd, dir := setupEmbeddedSwarm(t)
// ===== swarm status =====

View file

@ -38,7 +38,7 @@ func bdUnclaimFail(t *testing.T, bd, dir string, args ...string) string {
return string(out)
}
func TestEmbeddedUnclaim(t *testing.T) {
func TestEmbeddedUnclaimSuccess(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
@ -122,6 +122,16 @@ func TestEmbeddedUnclaim(t *testing.T) {
t.Errorf("expected status open after unclaim, got %q", unclaimed[0].Status)
}
})
}
func TestEmbeddedUnclaimBatchAndRefusals(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
t.Parallel()
bd := buildEmbeddedBD(t)
dir, _, _ := bdInit(t, bd, "--prefix", "tu")
// ===== Multiple IDs =====

View file

@ -243,12 +243,14 @@ func TestEmbeddedUpdateRoutedStoreCommitsTargetHead(t *testing.T) {
}
}
// TestEmbeddedUpdateFields and TestEmbeddedUpdateLifecycle were split from
// TestEmbeddedUpdate (originally ~267s, measured under --config=embedded)
// into 2 top-level tests over disjoint subtest groups, for CI shard balance
// (see scripts/ci/embedded_cmd_test_durations.json and engdocs/TESTING.md). Every original
// subtest is preserved exactly once.
func TestEmbeddedUpdateFields(t *testing.T) {
// The TestEmbeddedUpdateFields* and TestEmbeddedUpdateLifecycle* tests were
// split from TestEmbeddedUpdate (originally ~267s, measured under
// --config=embedded), first into TestEmbeddedUpdateFields and
// TestEmbeddedUpdateLifecycle and then (~75s each on rbe-west) into these 5
// top-level tests over disjoint subtest groups, each with its own workspace,
// for CI shard balance (see scripts/ci/embedded_cmd_test_durations.json and
// engdocs/TESTING.md). Every original subtest is preserved exactly once.
func TestEmbeddedUpdateFieldsMappingAndRefs(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
@ -406,6 +408,16 @@ func TestEmbeddedUpdateFields(t *testing.T) {
t.Errorf("expected external_ref field to be omitted from JSON after clear, got: %s", rawA)
}
})
}
func TestEmbeddedUpdateFieldsNotesOverwrite(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
t.Parallel()
bd := buildEmbeddedBD(t)
dir, _, _ := bdInit(t, bd, "--prefix", "tu")
t.Run("update_notes_overwrite_requires_force", func(t *testing.T) {
issue := bdCreate(t, bd, dir, "Notes force test", "--type", "task")
@ -466,6 +478,16 @@ func TestEmbeddedUpdateFields(t *testing.T) {
t.Errorf("expected notes %q, got %q", "replacement notes", got.Notes)
}
})
}
func TestEmbeddedUpdateFieldsNotesClearAndDefer(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
t.Parallel()
bd := buildEmbeddedBD(t)
dir, _, _ := bdInit(t, bd, "--prefix", "tu")
t.Run("update_empty_notes_refused", func(t *testing.T) {
// GH#6021: `--notes ""` is what a dead command substitution collapses
@ -534,7 +556,7 @@ func TestEmbeddedUpdateFields(t *testing.T) {
})
}
func TestEmbeddedUpdateLifecycle(t *testing.T) {
func TestEmbeddedUpdateLifecycleDefer(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
@ -624,6 +646,16 @@ func TestEmbeddedUpdateLifecycle(t *testing.T) {
t.Errorf("expected status=in_progress to be preserved, got %q", got.Status)
}
})
}
func TestEmbeddedUpdateLifecycleClaimParentCommit(t *testing.T) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt integration tests")
}
t.Parallel()
bd := buildEmbeddedBD(t)
dir, beadsDir, _ := bdInit(t, bd, "--prefix", "tu")
t.Run("update_claim_already_claimed", func(t *testing.T) {
issue := bdCreate(t, bd, dir, "Claim fail test", "--type", "task")

View file

@ -1037,9 +1037,11 @@ Required` requires them to have run remotely and passed.
- The `args` and `env` of every target tagged `embedded`,
`dolt-server-proxied` or `dolt-server-integration` are pinned.
- `tools/bazel/check_shard_coverage.py` runs after each tier. It requires:
- every Bazel shard of `//cmd/bd:bd_embedded_test` (50; the manifest's
frozen 20-shard block was the retired `test-embedded-cmd` jobs' split,
F1), `//internal/storage/embeddeddolt:embeddeddolt_embedded_test` (20;
- every Bazel shard of `//cmd/bd:bd_embedded_test` and
`//cmd/bd:bd_embedded_part2_test` (50 each: shards 1-50 and 51-100 of
the manifest's 100-shard block, which their ranges must tile exactly
once; the manifest's frozen 20-shard block was the retired
`test-embedded-cmd` jobs' split, F1), `//internal/storage/embeddeddolt:embeddeddolt_embedded_test` (20;
the frozen 5-shard block was `test-embedded-storage`'s, F1),
`//cmd/bd:bd_proxied_test` (34; the frozen 15-shard block was
`test-proxied-cmd`'s, F2) and

View file

@ -1,19 +1,16 @@
{
"_comment": [
"Measured on rbe-west, the lane's own remote executors (instance oss), on",
"2026-10-09: two `bazel test --config=embedded --nocache_test_results",
"//cmd/bd:bd_embedded_test` runs (race, `-test.parallel=4`, 50 shards), so",
"every top-level TestEmbedded* function ran exactly once per run. Each value",
"is the mean of the two runs (the two split",
"TestEmbeddedInitSelectedExcludeRouting{Stealth,Fork} functions ran only in",
"the second). The runs were taken after bdInit started seeding each",
"workspace's embedded database from a per-process schema template",
"(cmd/bd/embedded_init_template_test.go) and the bd subprocesses stopped",
"sleeping 1s at exit (GORACE=atexit_sleep_ms=0 on the target): the sum of",
"test-seconds fell from ~20.2k to ~10.3k on the same executors. Individual",
"tests varied up to ~2x between the two runs with executor load; the sum",
"moved ~4%. The previous capture was local sandboxed execution and",
"correlated only ~0.4 with rbe-west shard times.",
"2026-10-09: one `bazel test --config=embedded --nocache_test_results",
"//cmd/bd:bd_embedded_test //cmd/bd:bd_embedded_part2_test` run (race,",
"`-test.parallel=4`, the 100-shard block split 50+50 over the two targets),",
"so every top-level TestEmbedded* function ran exactly once. It was taken",
"after the slowest functions were split into smaller top-level functions",
"(subtests moved verbatim): the sum of test-seconds fell from ~10.3k",
"(50 shards, the previous capture) to ~8.1k, partly because each shard now",
"runs fewer tests at once. The remaining >60s functions are the *Concurrent",
"stress tests, whose bd subprocesses queue on the workspace's single writer",
"lock, and fixtures that seed many issues one `bd create` at a time.",
"",
"Each value is that top-level test's own <testcase time=...> from Bazel's",
"generated test.xml, NOT the enclosing <testsuite time=...>: <testsuite",
@ -34,257 +31,312 @@
"",
"These are a relative weight for packing, not an absolute SLA."
],
"seconds_per_init_fallback": 9.5837,
"seconds_per_init_fallback": 7.4818,
"tests": {
"TestEmbeddedAdminBlocked": 17.82,
"TestEmbeddedAdminCompactReadOnlyAllowed": 2.5,
"TestEmbeddedAdminCompactTier2Honesty": 17.71,
"TestEmbeddedAutoImportFallback_ConflictSkip_DoesNotClobber": 18.77,
"TestEmbeddedAutoImportFallback_ConflictSkip_EmptyDBImportsAll": 11.63,
"TestEmbeddedAutoImportJSONLConcurrentWriter": 29.04,
"TestEmbeddedAutoImportJSONLNoExplicitCommit": 33.58,
"TestEmbeddedAutoImportJSONLSkipsNonEmpty": 8.05,
"TestEmbeddedBackup": 37.73,
"TestEmbeddedBackupConcurrent": 11.05,
"TestEmbeddedBlocked": 14.0,
"TestEmbeddedBlockedConcurrent": 28.59,
"TestEmbeddedBlockedLabelFilters": 21.34,
"TestEmbeddedBootstrap": 80.85,
"TestEmbeddedBootstrapConcurrent": 9.56,
"TestEmbeddedBranch": 25.91,
"TestEmbeddedBranchConcurrent": 27.48,
"TestEmbeddedChangeDirOverridesInheritedBeadsDir": 17.26,
"TestEmbeddedChildren": 71.69,
"TestEmbeddedChildrenConcurrent": 37.41,
"TestEmbeddedClaimPools": 19.91,
"TestEmbeddedCloseAlreadyClosed": 84.22,
"TestEmbeddedCloseBasic": 72.03,
"TestEmbeddedCloseConcurrent": 84.28,
"TestEmbeddedCloseGuardsAndEpics": 58.54,
"TestEmbeddedComments": 10.35,
"TestEmbeddedCommentsCLI": 50.71,
"TestEmbeddedCommentsCLIConcurrent": 29.98,
"TestEmbeddedCompact": 41.59,
"TestEmbeddedCompactConcurrent": 23.3,
"TestEmbeddedCompactMisdatedChild": 12.83,
"TestEmbeddedConfig": 44.69,
"TestEmbeddedConfigConcurrent": 82.94,
"TestEmbeddedConfigNoWorkspaceStoreFreeCommands": 0.95,
"TestEmbeddedConfigValidateJSONNoWorkspaceWritesStdout": 0.32,
"TestEmbeddedContext": 24.87,
"TestEmbeddedContextConcurrent": 13.71,
"TestEmbeddedContributorCreate": 87.03,
"TestEmbeddedCount": 59.63,
"TestEmbeddedCountConcurrent": 44.3,
"TestEmbeddedCountIncludeEphemeral": 24.09,
"TestEmbeddedCountIncludeInfra": 53.12,
"TestEmbeddedCreateCommitPending": 12.9,
"TestEmbeddedCreateConcurrent": 29.6,
"TestEmbeddedCreateCrossRepo": 43.14,
"TestEmbeddedCreateCrossRepoDryRunWithParent": 46.25,
"TestEmbeddedCreateCrossRepoUninit": 35.37,
"TestEmbeddedCreateCrossRepoWithParent": 41.61,
"TestEmbeddedCreateDryRunCrossRepoDoesNotMigrateTarget": 17.89,
"TestEmbeddedCreateDryRunDoesNotMigrate": 15.28,
"TestEmbeddedCreateDryRunRepoDoesNotInitializeTarget": 3.09,
"TestEmbeddedCreateFormCommitsLabelOnlyCreate": 3.25,
"TestEmbeddedCreateGraphAndBulk": 16.55,
"TestEmbeddedCreateJSONEchoesSubSecondTimestamps": 8.31,
"TestEmbeddedCreateRepoFromNonBeadsCwd": 12.31,
"TestEmbeddedCreateRepoProxiedTargetError": 21.86,
"TestEmbeddedCreateRepoRelativeExistingWorkspaceUnaffected": 56.2,
"TestEmbeddedCreateRepoRelativeUninitRefused": 4.97,
"TestEmbeddedCreateScalarAndRelationships": 57.97,
"TestEmbeddedCreateStorageClassBasic": 11.92,
"TestEmbeddedCreateStorageClassBatchAndMisc": 45.95,
"TestEmbeddedCreateStorageClassConflicts": 41.81,
"TestEmbeddedCreateWithGitRemote": 14.38,
"TestEmbeddedDefer": 38.48,
"TestEmbeddedDeferAutoWake": 48.29,
"TestEmbeddedDeferConcurrent": 63.55,
"TestEmbeddedDelete": 81.25,
"TestEmbeddedDeleteJSONDependencyErrorContract": 42.77,
"TestEmbeddedDepA": 95.56,
"TestEmbeddedDepAddWispSource": 28.54,
"TestEmbeddedDepAndLinkBatchAutoCommitDoesNotAdvanceHead": 50.02,
"TestEmbeddedDepB": 94.49,
"TestEmbeddedDepBulkNoCycleCheckKeepsWholeGraphGate": 30.7,
"TestEmbeddedDepConcurrent": 75.13,
"TestEmbeddedDepListSingleIDWarnsOnDroppedExternalEdge": 66.92,
"TestEmbeddedDepNoCycleCheck": 58.88,
"TestEmbeddedDiff": 41.65,
"TestEmbeddedDiffConcurrent": 49.97,
"TestEmbeddedDirectCommitPathsBatchAutoCommitDoesNotAdvanceHead": 44.86,
"TestEmbeddedDoltBlockedAndCommit": 23.54,
"TestEmbeddedDoltConcurrent": 35.01,
"TestEmbeddedDoltRemoteAndPush": 18.79,
"TestEmbeddedDuplicate": 50.93,
"TestEmbeddedDuplicateConcurrent": 43.52,
"TestEmbeddedDuplicates": 67.03,
"TestEmbeddedDuplicatesConcurrent": 41.37,
"TestEmbeddedEpicCloseEligible": 69.55,
"TestEmbeddedEpicCloseEligibleReasonFlag": 29.56,
"TestEmbeddedEpicCloseEligibleReasonOutput": 41.91,
"TestEmbeddedEpicConcurrent": 71.22,
"TestEmbeddedEpicStatus": 44.06,
"TestEmbeddedExplicitHierarchicalParentEdges": 42.56,
"TestEmbeddedExportConcurrent": 21.66,
"TestEmbeddedExportFlags": 33.17,
"TestEmbeddedExportFormats": 40.58,
"TestEmbeddedExternalCapabilityReadyAfterShip": 37.72,
"TestEmbeddedExternalMutationPolicy": 64.3,
"TestEmbeddedFederationConcurrent": 25.94,
"TestEmbeddedFederationPeers": 38.08,
"TestEmbeddedFederationStatus": 27.84,
"TestEmbeddedFindDuplicates": 46.3,
"TestEmbeddedFindDuplicatesConcurrent": 14.36,
"TestEmbeddedFlatten": 31.29,
"TestEmbeddedFlattenConcurrent": 23.66,
"TestEmbeddedGC": 73.04,
"TestEmbeddedGCConcurrent": 21.52,
"TestEmbeddedGCConditionalMatcherDecode": 47.53,
"TestEmbeddedGate": 82.88,
"TestEmbeddedGateConcurrent": 49.5,
"TestEmbeddedGateCreate": 106.42,
"TestEmbeddedGateInheritsDownParentChain": 16.67,
"TestEmbeddedGateListScoped": 24.41,
"TestEmbeddedGatedRendering": 35.48,
"TestEmbeddedGetDependencies": 32.27,
"TestEmbeddedGraph": 61.4,
"TestEmbeddedGraphConcurrent": 21.38,
"TestEmbeddedHistory": 51.11,
"TestEmbeddedHistoryConcurrent": 77.78,
"TestEmbeddedHooks": 12.87,
"TestEmbeddedHooksConcurrent": 9.27,
"TestEmbeddedHuman": 66.13,
"TestEmbeddedHumanConcurrent": 9.72,
"TestEmbeddedIfRevisionReopenGuardDirect": 25.66,
"TestEmbeddedImportClosedChildWhoseParentWasDeleted": 27.28,
"TestEmbeddedImportConcurrent": 9.73,
"TestEmbeddedImportFromSources": 34.15,
"TestEmbeddedImportPromotedWispRoundtrip": 47.53,
"TestEmbeddedImportUpsertAndPrefixSync": 30.33,
"TestEmbeddedInfo": 17.36,
"TestEmbeddedInfoConcurrent": 33.86,
"TestEmbeddedInfoSuppressGitHooks": 9.64,
"TestEmbeddedInitA": 130.47,
"TestEmbeddedInitArtifactRouting": 20.34,
"TestEmbeddedInitB": 74.62,
"TestEmbeddedInitC": 32.69,
"TestEmbeddedInitConcurrent": 41.45,
"TestEmbeddedInitExplicitBeadsDirIsAuthoritative": 52.89,
"TestEmbeddedInitGitBootstrapRouting": 85.16,
"TestEmbeddedInitHooksRouting": 20.7,
"TestEmbeddedInitRoleRouting": 87.59,
"TestEmbeddedInitSelectedExcludeRoutingFork": 40.08,
"TestEmbeddedInitSelectedExcludeRoutingStealth": 65.73,
"TestEmbeddedKV": 12.62,
"TestEmbeddedKVConcurrent": 89.53,
"TestEmbeddedLabelAddRemove": 75.79,
"TestEmbeddedLabelConcurrent": 73.39,
"TestEmbeddedLabelEditReports": 68.91,
"TestEmbeddedLabelPropagateRename": 62.05,
"TestEmbeddedLint": 48.55,
"TestEmbeddedLintConcurrent": 44.72,
"TestEmbeddedListComments": 33.84,
"TestEmbeddedListConcurrent": 18.84,
"TestEmbeddedListFiltering": 87.75,
"TestEmbeddedListSearchAndOutput": 69.79,
"TestEmbeddedMaxRowsDepTreeAndDuplicates": 61.67,
"TestEmbeddedMaxRowsDoctorAndConfig": 30.57,
"TestEmbeddedMaxRowsGraph": 57.33,
"TestEmbeddedMaxRowsListBasic": 72.66,
"TestEmbeddedMaxRowsListLimitInteraction": 97.48,
"TestEmbeddedMaxRowsReady": 37.02,
"TestEmbeddedMaxRowsReadyMerge": 38.06,
"TestEmbeddedMemory": 57.23,
"TestEmbeddedMemoryConcurrent": 61.83,
"TestEmbeddedMemoryCorpusBudget": 17.38,
"TestEmbeddedMigrate": 34.92,
"TestEmbeddedMigrateConcurrent": 12.19,
"TestEmbeddedOnboard": 10.21,
"TestEmbeddedOnboardConcurrent": 19.27,
"TestEmbeddedAdminBlocked": 1.42,
"TestEmbeddedAdminCompactReadOnlyAllowed": 1.66,
"TestEmbeddedAdminCompactTier2Honesty": 2.62,
"TestEmbeddedAutoImportFallback_ConflictSkip_DoesNotClobber": 4.51,
"TestEmbeddedAutoImportFallback_ConflictSkip_EmptyDBImportsAll": 2.19,
"TestEmbeddedAutoImportJSONLConcurrentWriter": 24.46,
"TestEmbeddedAutoImportJSONLNoExplicitCommit": 22.47,
"TestEmbeddedAutoImportJSONLSkipsNonEmpty": 7.28,
"TestEmbeddedBackup": 23.1,
"TestEmbeddedBackupConcurrent": 26.77,
"TestEmbeddedBlocked": 9.54,
"TestEmbeddedBlockedConcurrent": 17.22,
"TestEmbeddedBlockedLabelFilters": 31.99,
"TestEmbeddedBootstrapConcurrent": 4.77,
"TestEmbeddedBootstrapExistingDryRunInit": 25.26,
"TestEmbeddedBootstrapJSONLAndGitOrigin": 46.5,
"TestEmbeddedBranch": 17.51,
"TestEmbeddedBranchConcurrent": 20.27,
"TestEmbeddedChangeDirOverridesInheritedBeadsDir": 9.53,
"TestEmbeddedChildrenBasicAndEmpty": 25.81,
"TestEmbeddedChildrenConcurrent": 67.76,
"TestEmbeddedChildrenJSONAndAllStatuses": 29.32,
"TestEmbeddedClaimPools": 35.44,
"TestEmbeddedCloseAlreadyClosedClaimNextAndMolecule": 41.27,
"TestEmbeddedCloseAlreadyClosedContinue": 19.24,
"TestEmbeddedCloseAlreadyClosedMultipleIDs": 19.19,
"TestEmbeddedCloseBasicIsolatedStores": 37.04,
"TestEmbeddedCloseBasicSharedStore": 30.42,
"TestEmbeddedCloseConcurrent": 84.21,
"TestEmbeddedCloseGuardsAndEpics": 47.46,
"TestEmbeddedComments": 9.58,
"TestEmbeddedCommentsCLI": 38.59,
"TestEmbeddedCommentsCLIConcurrent": 17.99,
"TestEmbeddedCompact": 36.04,
"TestEmbeddedCompactConcurrent": 8.04,
"TestEmbeddedCompactMisdatedChild": 10.32,
"TestEmbeddedConfig": 23.12,
"TestEmbeddedConfigConcurrent": 73.0,
"TestEmbeddedConfigNoWorkspaceStoreFreeCommands": 1.32,
"TestEmbeddedConfigValidateJSONNoWorkspaceWritesStdout": 0.27,
"TestEmbeddedContext": 10.13,
"TestEmbeddedContextConcurrent": 2.6,
"TestEmbeddedContributorCreateMultiple": 35.87,
"TestEmbeddedContributorCreateRoutesToPlanning": 32.15,
"TestEmbeddedContributorCreateShowReadsRouted": 31.17,
"TestEmbeddedCount": 54.32,
"TestEmbeddedCountConcurrent": 53.87,
"TestEmbeddedCountIncludeEphemeral": 17.46,
"TestEmbeddedCountIncludeInfra": 36.42,
"TestEmbeddedCreateCommitPending": 5.38,
"TestEmbeddedCreateConcurrent": 11.03,
"TestEmbeddedCreateCrossRepo": 31.6,
"TestEmbeddedCreateCrossRepoDryRunWithParent": 24.04,
"TestEmbeddedCreateCrossRepoUninit": 20.91,
"TestEmbeddedCreateCrossRepoWithParent": 34.75,
"TestEmbeddedCreateDryRunCrossRepoDoesNotMigrateTarget": 6.44,
"TestEmbeddedCreateDryRunDoesNotMigrate": 9.42,
"TestEmbeddedCreateDryRunRepoDoesNotInitializeTarget": 6.2,
"TestEmbeddedCreateFormCommitsLabelOnlyCreate": 4.26,
"TestEmbeddedCreateGraphAndBulk": 25.37,
"TestEmbeddedCreateJSONEchoesSubSecondTimestamps": 8.77,
"TestEmbeddedCreateRepoFromNonBeadsCwd": 4.36,
"TestEmbeddedCreateRepoProxiedTargetError": 11.3,
"TestEmbeddedCreateRepoRelativeExistingWorkspaceUnaffected": 25.79,
"TestEmbeddedCreateRepoRelativeUninitRefused": 1.95,
"TestEmbeddedCreateScalarAndRelationships": 66.4,
"TestEmbeddedCreateStorageClassBasic": 22.65,
"TestEmbeddedCreateStorageClassBatchAndMisc": 21.69,
"TestEmbeddedCreateStorageClassConflicts": 19.86,
"TestEmbeddedCreateWithGitRemote": 6.98,
"TestEmbeddedDefer": 27.86,
"TestEmbeddedDeferAutoWake": 39.08,
"TestEmbeddedDeferConcurrent": 40.97,
"TestEmbeddedDeleteBasic": 24.18,
"TestEmbeddedDeleteForceAndBatch": 23.09,
"TestEmbeddedDeleteJSONDependencyErrorContract": 21.24,
"TestEmbeddedDeletePreviewAndGuards": 27.96,
"TestEmbeddedDepAAddAndList": 33.09,
"TestEmbeddedDepAAddRejectionsAndBulk": 39.27,
"TestEmbeddedDepAAddTypesAndFlags": 32.71,
"TestEmbeddedDepAddWispSource": 17.18,
"TestEmbeddedDepAndLinkBatchAutoCommitDoesNotAdvanceHead": 37.58,
"TestEmbeddedDepBRemove": 19.99,
"TestEmbeddedDepBRemoveOutputAndRelatesTo": 32.44,
"TestEmbeddedDepBTreeAndCycles": 34.46,
"TestEmbeddedDepBulkNoCycleCheckKeepsWholeGraphGate": 10.71,
"TestEmbeddedDepConcurrent": 68.24,
"TestEmbeddedDepListSingleIDWarnsOnDroppedExternalEdge": 29.15,
"TestEmbeddedDepNoCycleCheck": 39.5,
"TestEmbeddedDiff": 29.84,
"TestEmbeddedDiffConcurrent": 40.71,
"TestEmbeddedDirectCommitPathsBatchAutoCommitDoesNotAdvanceHead": 23.64,
"TestEmbeddedDoltBlockedAndCommit": 9.95,
"TestEmbeddedDoltConcurrent": 9.47,
"TestEmbeddedDoltRemoteAndPush": 30.56,
"TestEmbeddedDuplicate": 27.59,
"TestEmbeddedDuplicateConcurrent": 42.26,
"TestEmbeddedDuplicatesConcurrent": 29.81,
"TestEmbeddedDuplicatesOwnWorkspaces": 30.03,
"TestEmbeddedDuplicatesSharedFixture": 8.63,
"TestEmbeddedEpicCloseEligibleClosesEpics": 27.95,
"TestEmbeddedEpicCloseEligibleNotEligible": 21.64,
"TestEmbeddedEpicCloseEligibleReasonFlag": 47.66,
"TestEmbeddedEpicCloseEligibleReasonOutput": 32.31,
"TestEmbeddedEpicConcurrent": 76.55,
"TestEmbeddedEpicStatus": 30.62,
"TestEmbeddedExplicitHierarchicalParentEdges": 33.58,
"TestEmbeddedExportConcurrent": 13.39,
"TestEmbeddedExportFlags": 15.66,
"TestEmbeddedExportFormats": 19.19,
"TestEmbeddedExternalCapabilityReadyAfterShip": 19.28,
"TestEmbeddedExternalMutationPolicy": 51.66,
"TestEmbeddedFederationConcurrent": 14.03,
"TestEmbeddedFederationPeers": 17.04,
"TestEmbeddedFederationStatus": 28.64,
"TestEmbeddedFindDuplicates": 29.41,
"TestEmbeddedFindDuplicatesConcurrent": 32.84,
"TestEmbeddedFlatten": 18.02,
"TestEmbeddedFlattenConcurrent": 6.31,
"TestEmbeddedGCConcurrent": 20.43,
"TestEmbeddedGCConditionalMatcherDecode": 29.32,
"TestEmbeddedGCDryRunAndSkips": 12.61,
"TestEmbeddedGCForceWithDecay": 12.32,
"TestEmbeddedGCFullAndNoForcePrompts": 18.95,
"TestEmbeddedGateConcurrent": 45.35,
"TestEmbeddedGateCreateBeadCheck": 15.83,
"TestEmbeddedGateCreateBeadRename": 45.63,
"TestEmbeddedGateCreateFlags": 16.48,
"TestEmbeddedGateCreateReady": 17.01,
"TestEmbeddedGateCreateRepoErrorsList": 15.24,
"TestEmbeddedGateInheritsDownParentChain": 26.11,
"TestEmbeddedGateList": 23.01,
"TestEmbeddedGateListScoped": 11.29,
"TestEmbeddedGateShowResolve": 23.68,
"TestEmbeddedGateWaiterCheckLifecycle": 37.46,
"TestEmbeddedGatedRendering": 63.79,
"TestEmbeddedGetDependencies": 10.67,
"TestEmbeddedGraph": 41.56,
"TestEmbeddedGraphConcurrent": 44.9,
"TestEmbeddedHistory": 32.22,
"TestEmbeddedHistoryConcurrent": 47.68,
"TestEmbeddedHooks": 3.05,
"TestEmbeddedHooksConcurrent": 2.08,
"TestEmbeddedHumanConcurrent": 14.83,
"TestEmbeddedHumanListStatsRespondDismiss": 19.75,
"TestEmbeddedHumanPositionalFileAndGuards": 32.16,
"TestEmbeddedIfRevisionReopenGuardDirect": 33.7,
"TestEmbeddedImportClosedChildWhoseParentWasDeleted": 20.54,
"TestEmbeddedImportConcurrent": 12.88,
"TestEmbeddedImportFromSources": 13.16,
"TestEmbeddedImportPromotedWispRoundtrip": 14.82,
"TestEmbeddedImportUpsertAndPrefixSync": 13.54,
"TestEmbeddedInfo": 10.01,
"TestEmbeddedInfoConcurrent": 11.69,
"TestEmbeddedInfoSuppressGitHooks": 7.53,
"TestEmbeddedInitABasic": 5.98,
"TestEmbeddedInitAForkAutoContributor": 42.22,
"TestEmbeddedInitAGitOriginRemote": 18.95,
"TestEmbeddedInitAPushConsentAndRemoteBootstrap": 40.9,
"TestEmbeddedInitArtifactRouting": 14.88,
"TestEmbeddedInitBAutoCommitAndJSONLRemote": 34.21,
"TestEmbeddedInitBRemoteSchemaAndCloneFailure": 20.41,
"TestEmbeddedInitBStealthAndForceReinit": 26.93,
"TestEmbeddedInitC": 17.76,
"TestEmbeddedInitConcurrent": 32.28,
"TestEmbeddedInitExplicitBeadsDirIsAuthoritative": 41.88,
"TestEmbeddedInitGitBootstrapRoutingDecoyInvalid": 33.8,
"TestEmbeddedInitGitBootstrapRoutingExistingExplicit": 30.63,
"TestEmbeddedInitGitBootstrapRoutingFreshQuiet": 40.37,
"TestEmbeddedInitHooksRouting": 16.2,
"TestEmbeddedInitRoleRoutingExplicitDefault": 35.88,
"TestEmbeddedInitRoleRoutingRetainedFork": 58.03,
"TestEmbeddedInitSelectedExcludeRoutingForkDecoyAuto": 29.54,
"TestEmbeddedInitSelectedExcludeRoutingForkInvalidQuiet": 46.94,
"TestEmbeddedInitSelectedExcludeRoutingStealthDecoyQuiet": 40.12,
"TestEmbeddedInitSelectedExcludeRoutingStealthInvalid": 16.07,
"TestEmbeddedKV": 26.57,
"TestEmbeddedKVConcurrent": 65.01,
"TestEmbeddedLabelAddRemoveAdd": 20.02,
"TestEmbeddedLabelAddRemoveMultiAndDuplicate": 11.76,
"TestEmbeddedLabelAddRemoveRemove": 35.57,
"TestEmbeddedLabelConcurrent": 59.05,
"TestEmbeddedLabelEditReportsListAndTemplate": 27.39,
"TestEmbeddedLabelEditReportsNoop": 27.14,
"TestEmbeddedLabelEditReportsPrefix": 25.05,
"TestEmbeddedLabelPropagateRename": 59.22,
"TestEmbeddedLint": 31.87,
"TestEmbeddedLintConcurrent": 27.16,
"TestEmbeddedListComments": 18.25,
"TestEmbeddedListConcurrent": 6.51,
"TestEmbeddedListFilteringBasicAndLabels": 72.7,
"TestEmbeddedListFilteringStatusAndHierarchy": 62.55,
"TestEmbeddedListSearchAndOutputFormats": 46.59,
"TestEmbeddedListSearchAndOutputSearchAndSort": 41.23,
"TestEmbeddedMaxRowsDepTreeAndDuplicates": 45.01,
"TestEmbeddedMaxRowsDoctorAndConfig": 24.99,
"TestEmbeddedMaxRowsGraph": 43.56,
"TestEmbeddedMaxRowsListBasic": 51.98,
"TestEmbeddedMaxRowsListLimitInteraction": 68.22,
"TestEmbeddedMaxRowsReady": 56.15,
"TestEmbeddedMaxRowsReadyMerge": 24.36,
"TestEmbeddedMemory": 35.89,
"TestEmbeddedMemoryConcurrent": 61.73,
"TestEmbeddedMemoryCorpusBudget": 19.62,
"TestEmbeddedMigrate": 17.36,
"TestEmbeddedMigrateConcurrent": 11.99,
"TestEmbeddedOnboard": 1.66,
"TestEmbeddedOnboardConcurrent": 2.25,
"TestEmbeddedOpen_EmptyDatabaseRejected": 0.0,
"TestEmbeddedOrphans": 25.62,
"TestEmbeddedOrphansConcurrent": 31.05,
"TestEmbeddedPreviewDoesNotConsumeVersionMarker": 13.76,
"TestEmbeddedPrime": 17.08,
"TestEmbeddedPrimeChangeDirDefaultTemplateMatchesTarget": 0.87,
"TestEmbeddedPrimeChangeDirPrimesTarget": 0.95,
"TestEmbeddedPrimeChangeDirRedirectNoticeFollowsTarget": 0.85,
"TestEmbeddedPrimeConcurrent": 22.81,
"TestEmbeddedPromote": 13.89,
"TestEmbeddedPromoteCLI": 48.09,
"TestEmbeddedPromoteCLIConcurrent": 52.29,
"TestEmbeddedPruneDryRunAndFilters": 41.08,
"TestEmbeddedPruneSafetyAndScope": 63.09,
"TestEmbeddedPurgeBasics": 33.45,
"TestEmbeddedPurgeConcurrent": 28.04,
"TestEmbeddedPurgeFiltered": 40.47,
"TestEmbeddedPurgeWispsPlaneRetention": 76.18,
"TestEmbeddedQuery": 40.0,
"TestEmbeddedQueryConcurrent": 45.96,
"TestEmbeddedQuick": 51.42,
"TestEmbeddedQuickConcurrent": 61.4,
"TestEmbeddedQuickstart": 9.7,
"TestEmbeddedQuickstartConcurrent": 15.87,
"TestEmbeddedQuietFlagSuppressesSuccessOutput": 31.54,
"TestEmbeddedReadOnlyCommandsSpawnNoGit": 33.33,
"TestEmbeddedReady": 71.28,
"TestEmbeddedReadyClaimConcurrent": 26.71,
"TestEmbeddedReadyConcurrent": 32.41,
"TestEmbeddedReclaimRunsTheLeaseReclaimerRole": 26.56,
"TestEmbeddedRenamePrefixBasic": 46.34,
"TestEmbeddedRenamePrefixConcurrent": 18.87,
"TestEmbeddedRenamePrefixEdgeCases": 31.27,
"TestEmbeddedReopen": 59.7,
"TestEmbeddedReopenConcurrent": 76.86,
"TestEmbeddedRestore": 35.94,
"TestEmbeddedOrphans": 9.01,
"TestEmbeddedOrphansConcurrent": 10.6,
"TestEmbeddedPreviewDoesNotConsumeVersionMarker": 6.7,
"TestEmbeddedPrime": 5.07,
"TestEmbeddedPrimeChangeDirDefaultTemplateMatchesTarget": 0.75,
"TestEmbeddedPrimeChangeDirPrimesTarget": 1.28,
"TestEmbeddedPrimeChangeDirRedirectNoticeFollowsTarget": 1.51,
"TestEmbeddedPrimeConcurrent": 5.89,
"TestEmbeddedPromote": 4.72,
"TestEmbeddedPromoteCLI": 26.32,
"TestEmbeddedPromoteCLIConcurrent": 31.41,
"TestEmbeddedPruneDryRunAndFilters": 27.53,
"TestEmbeddedPruneSafetyAndScope": 28.64,
"TestEmbeddedPurgeBasics": 30.34,
"TestEmbeddedPurgeConcurrent": 13.6,
"TestEmbeddedPurgeFiltered": 24.79,
"TestEmbeddedPurgeWispsPlaneRetention": 61.83,
"TestEmbeddedQuery": 30.45,
"TestEmbeddedQueryConcurrent": 39.48,
"TestEmbeddedQuick": 29.71,
"TestEmbeddedQuickConcurrent": 35.71,
"TestEmbeddedQuickstart": 5.34,
"TestEmbeddedQuickstartConcurrent": 2.05,
"TestEmbeddedQuietFlagSuppressesSuccessOutput": 26.01,
"TestEmbeddedReadOnlyCommandsSpawnNoGit": 27.76,
"TestEmbeddedReadyBlockersAndLabels": 37.82,
"TestEmbeddedReadyClaimConcurrent": 25.11,
"TestEmbeddedReadyConcurrent": 10.61,
"TestEmbeddedReadyDefaultJSONAndFlags": 29.09,
"TestEmbeddedReclaimRunsTheLeaseReclaimerRole": 16.3,
"TestEmbeddedRenamePrefixBasic": 16.2,
"TestEmbeddedRenamePrefixConcurrent": 11.31,
"TestEmbeddedRenamePrefixEdgeCases": 20.33,
"TestEmbeddedReopen": 61.04,
"TestEmbeddedReopenConcurrent": 62.19,
"TestEmbeddedRestore": 17.16,
"TestEmbeddedRestoreConcurrent": 0.0,
"TestEmbeddedRoutedMutatingSiblingAssignTagDep": 105.3,
"TestEmbeddedRoutedMutatingSiblingDeleteClose": 74.67,
"TestEmbeddedRoutedSiblingWritesCommitTargetHead": 83.5,
"TestEmbeddedSearch": 65.75,
"TestEmbeddedSearchConcurrent": 61.47,
"TestEmbeddedSetup": 19.29,
"TestEmbeddedSetupConcurrent": 16.88,
"TestEmbeddedShip": 47.53,
"TestEmbeddedShipConcurrent": 68.2,
"TestEmbeddedShowBasicsAndJSON": 55.39,
"TestEmbeddedShowConcurrent": 77.92,
"TestEmbeddedShowDetailAndCurrent": 82.5,
"TestEmbeddedShowUnresolvableDeps": 56.8,
"TestEmbeddedSquashWispMoleculeClearsRootEphemeral": 26.27,
"TestEmbeddedStale": 63.39,
"TestEmbeddedStaleConcurrent": 46.3,
"TestEmbeddedStaleLabelFilters": 26.04,
"TestEmbeddedState": 55.29,
"TestEmbeddedStateConcurrent": 42.2,
"TestEmbeddedStatus": 29.52,
"TestEmbeddedStatusConcurrent": 53.34,
"TestEmbeddedSupersede": 46.47,
"TestEmbeddedSupersedeConcurrent": 70.75,
"TestEmbeddedSwarm": 97.32,
"TestEmbeddedSwarmConcurrent": 49.07,
"TestEmbeddedTodo": 49.91,
"TestEmbeddedTodoConcurrent": 19.93,
"TestEmbeddedTypes": 22.43,
"TestEmbeddedTypesAgreeWithCreate": 37.24,
"TestEmbeddedTypesConcurrent": 20.36,
"TestEmbeddedUnclaim": 78.85,
"TestEmbeddedUndefer": 52.25,
"TestEmbeddedUndeferConcurrent": 58.19,
"TestEmbeddedUpdateBatchAutoCommitDoesNotAdvanceHead": 14.69,
"TestEmbeddedUpdateConcurrent": 105.17,
"TestEmbeddedUpdateFields": 77.51,
"TestEmbeddedUpdateLifecycle": 73.02,
"TestEmbeddedUpdateRoutedStoreCommitsTargetHead": 45.79,
"TestEmbeddedVCCommitVariantsAndMerge": 14.78,
"TestEmbeddedVCConcurrent": 41.36,
"TestEmbeddedVCStatusAndCommit": 44.06,
"TestEmbeddedVersion": 0.35,
"TestEmbeddedVersionConcurrent": 0.53,
"TestEmbeddedWhere": 11.55,
"TestEmbeddedWhereConcurrent": 8.26
"TestEmbeddedRoutedMutatingSiblingAssignTagDepAssign": 21.91,
"TestEmbeddedRoutedMutatingSiblingAssignTagDepDepAdd": 16.67,
"TestEmbeddedRoutedMutatingSiblingAssignTagDepTag": 13.47,
"TestEmbeddedRoutedMutatingSiblingDeleteCloseClose": 14.03,
"TestEmbeddedRoutedMutatingSiblingDeleteCloseDelete": 36.33,
"TestEmbeddedRoutedSiblingWritesCommitTargetHeadComment": 35.58,
"TestEmbeddedRoutedSiblingWritesCommitTargetHeadNote": 11.65,
"TestEmbeddedRoutedSiblingWritesCommitTargetHeadReopen": 13.7,
"TestEmbeddedSearchConcurrent": 39.9,
"TestEmbeddedSearchQueryStatusAssigneeLabels": 31.01,
"TestEmbeddedSearchStatusLimitSortDatesMetadata": 30.41,
"TestEmbeddedSetup": 6.55,
"TestEmbeddedSetupConcurrent": 7.66,
"TestEmbeddedShip": 19.99,
"TestEmbeddedShipConcurrent": 50.72,
"TestEmbeddedShowBasicsAndJSON": 33.03,
"TestEmbeddedShowConcurrent": 86.17,
"TestEmbeddedShowDetailAndCurrentFlags": 28.1,
"TestEmbeddedShowDetailAndCurrentHistoryAndCurrent": 29.86,
"TestEmbeddedShowUnresolvableDeps": 22.88,
"TestEmbeddedSquashWispMoleculeClearsRootEphemeral": 23.14,
"TestEmbeddedStale": 24.08,
"TestEmbeddedStaleConcurrent": 41.57,
"TestEmbeddedStaleLabelFilters": 23.0,
"TestEmbeddedState": 25.83,
"TestEmbeddedStateConcurrent": 34.66,
"TestEmbeddedStatus": 19.75,
"TestEmbeddedStatusConcurrent": 22.8,
"TestEmbeddedSupersede": 37.32,
"TestEmbeddedSupersedeConcurrent": 33.14,
"TestEmbeddedSwarmConcurrent": 40.14,
"TestEmbeddedSwarmCreate": 22.83,
"TestEmbeddedSwarmCreateForceAndErrors": 26.05,
"TestEmbeddedSwarmStatusList": 27.84,
"TestEmbeddedSwarmValidate": 17.55,
"TestEmbeddedTodo": 30.49,
"TestEmbeddedTodoConcurrent": 7.62,
"TestEmbeddedTypes": 9.38,
"TestEmbeddedTypesAgreeWithCreate": 32.79,
"TestEmbeddedTypesConcurrent": 11.21,
"TestEmbeddedUnclaimBatchAndRefusals": 45.89,
"TestEmbeddedUnclaimSuccess": 26.64,
"TestEmbeddedUndefer": 39.57,
"TestEmbeddedUndeferConcurrent": 53.14,
"TestEmbeddedUpdateBatchAutoCommitDoesNotAdvanceHead": 11.06,
"TestEmbeddedUpdateConcurrent": 145.04,
"TestEmbeddedUpdateFieldsMappingAndRefs": 15.54,
"TestEmbeddedUpdateFieldsNotesClearAndDefer": 35.0,
"TestEmbeddedUpdateFieldsNotesOverwrite": 35.18,
"TestEmbeddedUpdateLifecycleClaimParentCommit": 43.24,
"TestEmbeddedUpdateLifecycleDefer": 27.33,
"TestEmbeddedUpdateRoutedStoreCommitsTargetHead": 38.07,
"TestEmbeddedVCCommitVariantsAndMerge": 20.16,
"TestEmbeddedVCConcurrent": 35.67,
"TestEmbeddedVCStatusAndCommit": 18.81,
"TestEmbeddedVersion": 0.53,
"TestEmbeddedVersionConcurrent": 0.35,
"TestEmbeddedWhere": 6.18,
"TestEmbeddedWhereConcurrent": 5.25
}
}

View file

@ -198,8 +198,8 @@ def main():
ap.error(f'total_shards is required with --write (the default, {default_total_shards}, '
'is the FROZEN legacy block -- see its header in embedded-cmd-test-shards.txt; '
'it must not be regenerated). Pass the Bazel-only total explicitly instead, e.g. '
'"50 --weights=duration" for bazel-embedded\'s block (see cmd/bd/BUILD.bazel\'s '
'bd_embedded_test shard_count for the current value)')
'"100 --weights=duration" for bazel-embedded\'s block (see cmd/bd/BUILD.bazel\'s '
'bd_embedded_test/bd_embedded_part2_test --shard-total for the current value)')
args.total_shards = default_total_shards
inits = discover_inits_cost()

View file

@ -4341,6 +4341,7 @@ func TestBazelEmbeddedJobRunsEmbeddedTier(t *testing.T) {
job, script, pkg, target string
}{
{"test-embedded-cmd", ".github/scripts/embedded-test-shard.sh", "cmd/bd", "bd_embedded_test"},
{"test-embedded-cmd", ".github/scripts/embedded-test-shard.sh", "cmd/bd", "bd_embedded_part2_test"},
{"test-embedded-storage", ".github/scripts/embedded-storage-test-shard.sh", "internal/storage/embeddeddolt", "embeddeddolt_embedded_test"},
}
for _, c := range sharded {
@ -4384,9 +4385,11 @@ func TestBazelEmbeddedJobRunsEmbeddedTier(t *testing.T) {
}
// The cmd jobs' subprocess bd is the race build, as //cmd/bd:bd is
// under --config=embedded (bd_for_tests never is).
rule := bazelRuleBlock(readPolicyFile(t, sourceRepoRoot(t), "cmd/bd/BUILD.bazel"), "bd_embedded_test")
if !strings.Contains(rule, `"BEADS_TEST_BD_BINARY": "$(rlocationpath :bd)"`) {
t.Errorf("cmd/bd:bd_embedded_test must run the race //cmd/bd:bd as BEADS_TEST_BD_BINARY:\n%s", rule)
for _, name := range embeddedCmdTargets {
rule := bazelRuleBlock(readPolicyFile(t, sourceRepoRoot(t), "cmd/bd/BUILD.bazel"), name)
if !strings.Contains(rule, `"BEADS_TEST_BD_BINARY": "$(rlocationpath :bd)"`) {
t.Errorf("cmd/bd:%s must run the race //cmd/bd:bd as BEADS_TEST_BD_BINARY:\n%s", name, rule)
}
}
// The retired test-embedded-conformance job's two partitions, frozen.

View file

@ -6,6 +6,7 @@ package scripts_test
// compile this file, so a test here would run twice.
import (
"fmt"
"regexp"
"strconv"
"testing"
@ -17,26 +18,77 @@ import (
// need it.
var shardCountPattern = regexp.MustCompile(`(?m)^ shard_count = (\d+),$`)
// bazelEmbeddedCmdShardCount returns cmd/bd:bd_embedded_test's own
// shard_count from cmd/bd/BUILD.bazel: the single source of truth for the
// Bazel-only bazel-embedded lane's cmd/bd shard split (slice F1), which no
// longer has to equal PR Risk's/main.yml's legacy "Test (Embedded Dolt Cmd
// N/20)" fork/push jobs' matrix size — mirrors bazelProxiedShardCount (F2;
// see that function's doc comment below for the
// shared rationale, not repeated here).
// embeddedCmdTargets are the cmd/bd rules that split the bazel-embedded
// lane's cmd/bd manifest block between them (more shards than Bazel's
// 50-per-rule cap), in shard order.
var embeddedCmdTargets = []string{"bd_embedded_test", "bd_embedded_part2_test"}
// embeddedCmdPart is one of embeddedCmdTargets: its Bazel shard_count and the
// range of the manifest block it runs (go_test_manifest_shard.sh's
// --shard-offset/--shard-total args).
type embeddedCmdPart struct {
label string
shards, offset, total int
}
// spec is the part's check_shard_coverage.py --suite SHARDS argument.
func (p embeddedCmdPart) spec() string {
return fmt.Sprintf("%d@%d/%d", p.shards, p.offset, p.total)
}
var (
shardOffsetArg = regexp.MustCompile(`(?m)^ "--shard-offset=(\d+)",$`)
shardTotalArg = regexp.MustCompile(`(?m)^ "--shard-total=(\d+)",$`)
)
// bazelEmbeddedCmdParts reads embeddedCmdTargets' shard_count and shard
// range from cmd/bd/BUILD.bazel and fails unless the ranges tile one block
// exactly once, in order.
func bazelEmbeddedCmdParts(t *testing.T) []embeddedCmdPart {
t.Helper()
build := readPolicyFile(t, sourceRepoRoot(t), "cmd/bd/BUILD.bazel")
var parts []embeddedCmdPart
next := 0
for _, name := range embeddedCmdTargets {
rule := bazelRuleBlock(build, name)
p := embeddedCmdPart{label: "//cmd/bd:" + name}
for _, f := range []struct {
re *regexp.Regexp
dst *int
what string
}{{shardCountPattern, &p.shards, "shard_count = N,"}, {shardOffsetArg, &p.offset, `"--shard-offset=N",`}, {shardTotalArg, &p.total, `"--shard-total=N",`}} {
m := f.re.FindStringSubmatch(rule)
if m == nil {
t.Fatalf("cmd/bd:%s has no %s in cmd/bd/BUILD.bazel:\n%s", name, f.what, rule)
}
n, err := strconv.Atoi(m[1])
if err != nil {
t.Fatalf("cmd/bd:%s %s: %v", name, f.what, err)
}
*f.dst = n
}
if p.offset != next || (len(parts) > 0 && p.total != parts[0].total) {
t.Fatalf("cmd/bd:%s runs shards %d..%d of %d; want it to start at shard %d of the same block as %v", name, p.offset+1, p.offset+p.shards, p.total, next+1, parts)
}
next += p.shards
parts = append(parts, p)
}
if next != parts[0].total {
t.Fatalf("%v run %d shards of a %d-shard block; their shard_counts must sum to --shard-total", parts, next, parts[0].total)
}
return parts
}
// bazelEmbeddedCmdShardCount returns the shard total of the bazel-embedded
// lane's cmd/bd manifest block, which embeddedCmdTargets split between them
// (bazelEmbeddedCmdParts): the single source of truth for the Bazel-only
// lane's cmd/bd shard split (slice F1), which no longer has to equal PR
// Risk's/main.yml's legacy "Test (Embedded Dolt Cmd N/20)" fork/push jobs'
// matrix size — mirrors bazelProxiedShardCount (F2; see that function's doc
// comment below for the shared rationale, not repeated here).
func bazelEmbeddedCmdShardCount(t *testing.T) int {
t.Helper()
root := sourceRepoRoot(t)
rule := bazelRuleBlock(readPolicyFile(t, root, "cmd/bd/BUILD.bazel"), "bd_embedded_test")
m := shardCountPattern.FindStringSubmatch(rule)
if m == nil {
t.Fatalf("cmd/bd:bd_embedded_test has no `shard_count = N,` in cmd/bd/BUILD.bazel:\n%s", rule)
}
n, err := strconv.Atoi(m[1])
if err != nil {
t.Fatalf("cmd/bd:bd_embedded_test shard_count: %v", err)
}
return n
return bazelEmbeddedCmdParts(t)[0].total
}
// bazelEmbeddedStorageShardCount returns

View file

@ -322,7 +322,6 @@ func TestBazelRetiredLanesCheckListedTestsRan(t *testing.T) {
// the shared rationale.
liveShardCount := map[string]func(*testing.T) int{
"//cmd/bd:bd_proxied_test": bazelProxiedShardCount,
"//cmd/bd:bd_embedded_test": bazelEmbeddedCmdShardCount,
"//internal/storage/embeddeddolt:embeddeddolt_embedded_test": bazelEmbeddedStorageShardCount,
"//internal/storage/dolt:dolt_server_full_test": bazelServerFullShardCount,
}
@ -342,7 +341,8 @@ func TestBazelRetiredLanesCheckListedTestsRan(t *testing.T) {
// check_shard_coverage.py arguments, not independently
// hard-coded literals that could drift from BUILD.bazel
// unnoticed (S1).
{"test-embedded-cmd", "Test", "//cmd/bd:bd_embedded_test", ".github/scripts/embedded-test-shard.sh", -1},
// The cmd/bd block is split over embeddedCmdTargets: one
// --suite each, SHARDS@OFFSET/TOTAL (added below).
{"test-embedded-storage", "Test", "//internal/storage/embeddeddolt:embeddeddolt_embedded_test", ".github/scripts/embedded-storage-test-shard.sh", -1},
}, []string{"//internal/storage/embeddeddolt:embeddeddolt_conformance_core_test", "//internal/storage/embeddeddolt:embeddeddolt_conformance_audit_test"}},
{bazelProxiedJobName, "doltserver-proxied", []suite{
@ -365,6 +365,11 @@ func TestBazelRetiredLanesCheckListedTestsRan(t *testing.T) {
job := readCIWorkflow(t, bazelWorkflowName).job(t, c.lane)
step := job.step(t, "Every listed test ran in its shard")
want := []string{"python3 tools/bazel/check_shard_coverage.py", `--bep "$RUNNER_TEMP/bazel-bep.json"`}
if c.lane == bazelEmbedJobName {
for _, p := range bazelEmbeddedCmdParts(t) {
want = append(want, fmt.Sprintf("--suite %s %s %s", p.label, ".github/scripts/embedded-test-shard.sh", p.spec()))
}
}
for _, s := range c.suites {
shards := s.shardCount
if shards < 0 {
@ -531,6 +536,51 @@ esac
t.Errorf("--whole %v: pass = %v, want %v (mention %q):\n%s", c.names, err == nil, c.pass, c.mention, out)
}
}
// A 2-shard block split over two 1-shard targets (SHARDS@OFFSET/TOTAL):
// //pkg:p's shard 1 is the script's shard 1, //pkg:q's shard 1 its shard
// 2. The targets must tile the block exactly once.
splitLogs := filepath.Join(dir, "split")
for target, names := range map[string][]string{"p": {"TestA", "TestB"}, "q": {"TestC"}} {
d := filepath.Join(splitLogs, "pkg", target)
if err := os.MkdirAll(d, 0o755); err != nil {
t.Fatal(err)
}
xml := `<testsuites><testsuite name="pkg">`
for _, n := range names {
xml += `<testcase name="` + n + `"></testcase>`
}
if err := os.WriteFile(filepath.Join(d, "test.xml"), []byte(xml+`</testsuite></testsuites>`), 0o644); err != nil {
t.Fatal(err)
}
}
splitBEP := filepath.Join(dir, "split.json")
if err := os.WriteFile(splitBEP, []byte(`{"id":{"targetConfigured":{"label":"//pkg:p"}},"configured":{"targetKind":"sh_test rule"}}
{"id":{"testResult":{"label":"//pkg:p","run":1,"attempt":1}}}
{"id":{"targetConfigured":{"label":"//pkg:q"}},"configured":{"targetKind":"sh_test rule"}}
{"id":{"testResult":{"label":"//pkg:q","run":1,"attempt":1}}}
`), 0o644); err != nil {
t.Fatal(err)
}
for _, c := range []struct {
name string
suites []string
pass bool
mention string
}{
{"split exact", []string{"//pkg:p", "1@0/2", "//pkg:q", "1@1/2"}, true, ""},
{"split shard run twice", []string{"//pkg:p", "1@0/2", "//pkg:q", "1@0/2"}, false, "run by more than one target"},
{"split shard run by no target", []string{"//pkg:p", "1@0/2"}, false, "no target runs shard(s) [2]"},
{"split range past the total", []string{"//pkg:p", "1@0/2", "//pkg:q", "1@2/2"}, false, "exceed"},
} {
args := []string{script, "--bep", splitBEP, "--testlogs", splitLogs}
for i := 0; i < len(c.suites); i += 2 {
args = append(args, "--suite", c.suites[i], shard, c.suites[i+1])
}
out, err := exec.Command(python, args...).CombinedOutput()
if (err == nil) != c.pass || (c.mention != "" && !strings.Contains(string(out), c.mention)) {
t.Errorf("%s: pass = %v, want %v (mention %q):\n%s", c.name, err == nil, c.pass, c.mention, out)
}
}
if out, err := exec.Command(python, script, "--bep", writeBEP(2), "--testlogs", filepath.Join(dir, "logs0"), "--suite", label, shard, "2", "--whole", "//pkg:absent").CombinedOutput(); err == nil {
t.Errorf("--whole for a target the BEP lacks passed:\n%s", out)
}
@ -803,15 +853,20 @@ func TestBazelRetiredLanesCannotBeNarrowed(t *testing.T) {
args []string
env map[string]string
}
embeddedCmdEnv := map[string]string{
"BEADS_TEST_BD_BINARY": "$(rlocationpath :bd)", "BEADS_TEST_EMBEDDED_DOLT": "1", "BEADS_TEST_GOFMT": "$(rlocationpath @go_sdk//:bin/gofmt)",
// bdInit's schema template and the race runtime's exit sleep:
// neither selects or skips a test.
"BEADS_TEST_EMBEDDED_SCHEMA_TOOL": "$(rlocationpath //internal/storage/embeddeddolt/cmd:cmd_norace)", "GORACE": "atexit_sleep_ms=0",
}
want := map[string]target{
"//cmd/bd:bd_embedded_test": {
[]string{"$(rootpath //:.github/scripts/embedded-test-shard.sh)", "BEADS_TEST_CMD_BINARY", "$(rootpath :bd_test)", "-test.timeout=19m"},
map[string]string{
"BEADS_TEST_BD_BINARY": "$(rlocationpath :bd)", "BEADS_TEST_EMBEDDED_DOLT": "1", "BEADS_TEST_GOFMT": "$(rlocationpath @go_sdk//:bin/gofmt)",
// bdInit's schema template and the race runtime's exit sleep:
// neither selects or skips a test.
"BEADS_TEST_EMBEDDED_SCHEMA_TOOL": "$(rlocationpath //internal/storage/embeddeddolt/cmd:cmd_norace)", "GORACE": "atexit_sleep_ms=0",
},
[]string{"--shard-offset=0", "--shard-total=100", "$(rootpath //:.github/scripts/embedded-test-shard.sh)", "BEADS_TEST_CMD_BINARY", "$(rootpath :bd_test)", "-test.timeout=19m"},
embeddedCmdEnv,
},
"//cmd/bd:bd_embedded_part2_test": {
[]string{"--shard-offset=50", "--shard-total=100", "$(rootpath //:.github/scripts/embedded-test-shard.sh)", "BEADS_TEST_CMD_BINARY", "$(rootpath :bd_test)", "-test.timeout=19m"},
embeddedCmdEnv,
},
"//internal/storage/embeddeddolt:embeddeddolt_embedded_test": {
[]string{"$(rootpath //:.github/scripts/embedded-storage-test-shard.sh)", "BEADS_TEST_EMBEDDED_TEST_BINARY", "$(rootpath :embeddeddolt_test)", "-test.timeout=19m"},

View file

@ -2,7 +2,7 @@
"""Fail unless every Bazel shard ran exactly the tests its shard script lists.
Usage: check_shard_coverage.py --bep <build_event_json_file> [--testlogs DIR]
--suite LABEL SCRIPT SHARDS [--suite ...]
--suite LABEL SCRIPT SHARDS[@OFFSET/TOTAL] [--suite ...]
[--whole LABEL ...]
The manifest-sharded targets (//cmd/bd:bd_embedded_test runs
@ -24,6 +24,13 @@ BEADS_TEST_SKIP or a lost BEADS_TEST_EMBEDDED_DOLT=1 turns the tier into
t.Skip calls, which still list every test. It needs test.xml locally and
-test.v in it, as --config=embedded sets.
A manifest block bigger than Bazel's 50-shard cap per rule runs as several
targets (tools/bazel/go_test_manifest_shard.sh --shard-offset/--shard-total):
SHARDS@OFFSET/TOTAL says Bazel shard k of LABEL is the script's shard
OFFSET+k of TOTAL. The suites sharing a SCRIPT and TOTAL must cover shards
1..TOTAL exactly once between them, so (the script assigning each test to
one shard of TOTAL) every test runs in exactly one shard of one target.
Exit status: 0 if every shard matches, 1 otherwise.
"""
@ -39,6 +46,7 @@ sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from equivalence import read_bep, testlog_xmls # noqa: E402
LISTED = re.compile(r"^ (Test[A-Za-z0-9_]*)$")
SHARD_SPEC = re.compile(r"^(\d+)(?:@(\d+)/(\d+))?$")
# Names the shard scripts' `grep '^func Test'` discovery lists that go test
# never runs as a test: TestMain(m *testing.M) is the package's test entry
@ -79,10 +87,36 @@ def all_skipped_problem(where, got, skipped):
return None
def tiling_problems(suites):
"""Problems with suites of (label, script, shards, offset, total) that
split one SCRIPT's TOTAL-shard block over several targets: together they
must cover shards 1..TOTAL exactly once."""
problems = []
parts = {}
for label, script, shards, offset, total in suites:
if offset + shards > total:
problems.append(f"{label}: shards {offset + 1}..{offset + shards} exceed {script}'s total {total}")
parts.setdefault((script, total), []).append((offset, shards, label))
for (script, total), ranges in sorted(parts.items()):
covered = {}
for offset, shards, label in ranges:
for k in range(offset + 1, offset + shards + 1):
covered.setdefault(k, []).append(label)
missing = [k for k in range(1, total + 1) if k not in covered]
twice = sorted(k for k, labels in covered.items() if len(labels) > 1)
if missing:
problems.append(f"{script} {total}: no target runs shard(s) {missing}")
if twice:
problems.append(f"{script} {total}: shard(s) {twice} run by more than one target")
return problems
def check(tested, testlogs, suites, lister=listed_tests, whole=()):
"""Return ([summary lines], [problems]) for suites of (label, script, shards)
and whole (unsharded or sharded) labels that must not be all-skipped."""
lines, problems = [], []
or (label, script, shards, offset, total), and whole (unsharded or
sharded) labels that must not be all-skipped."""
suites = [s if len(s) == 5 else (*s, 0, s[2]) for s in suites]
lines, problems = [], tiling_problems(suites)
for label in whole:
if label not in tested:
problems.append(f"{label}: --whole, but the BEP has no result for it")
@ -103,7 +137,7 @@ def check(tested, testlogs, suites, lister=listed_tests, whole=()):
if p:
problems.append(p)
lines.append(f"{label}: not all skipped")
for label, script, shards in suites:
for label, script, shards, offset, total_shards in suites:
if tested.get(label) != shards:
problems.append(f"{label}: the BEP has {tested.get(label, 0)} shard(s), want {shards} ({script})")
continue
@ -111,12 +145,12 @@ def check(tested, testlogs, suites, lister=listed_tests, whole=()):
# The scripts' hash fallback forks per test (seconds per shard for
# the server suite's ~1200 tests): list the shards concurrently.
with concurrent.futures.ThreadPoolExecutor(max_workers=min(8, os.cpu_count() or 2)) as pool:
listings = [pool.submit(lister, script, k, shards) for k in range(1, shards + 1)]
listings = [pool.submit(lister, script, offset + k, total_shards) for k in range(1, shards + 1)]
for k, xml_path in enumerate(testlog_xmls(testlogs, label, shards), start=1):
try:
want = listings[k - 1].result()
except (OSError, subprocess.CalledProcessError) as e:
problems.append(f"{label}: {script} {k} {shards} failed: {e}")
problems.append(f"{label}: {script} {offset + k} {total_shards} failed: {e}")
continue
rel = os.path.relpath(xml_path, testlogs)
if not os.path.exists(xml_path):
@ -136,7 +170,8 @@ def check(tested, testlogs, suites, lister=listed_tests, whole=()):
f"(not in the target's srcs?)")
for name in sorted(got - want):
problems.append(f"{label} shard {k}/{shards}: {name} ran but {script} does not list it there")
lines.append(f"{label}: {shards} shards, {total} listed tests")
span = "" if (offset, total_shards) == (0, shards) else f" (script shards {offset + 1}..{offset + shards} of {total_shards})"
lines.append(f"{label}: {shards} shards{span}, {total} listed tests")
return lines, problems
@ -145,16 +180,21 @@ def main(argv=None):
ap.add_argument("--bep", required=True, help="--build_event_json_file of the bazel test run")
ap.add_argument("--testlogs", default=None, help="default: from the BEP, else ./bazel-testlogs")
ap.add_argument("--suite", nargs=3, action="append", required=True, metavar=("LABEL", "SCRIPT", "SHARDS"),
help="a manifest-sharded target, its shard script and shard count (repeatable)")
help="a manifest-sharded target, its shard script and shard count, as N or "
"N@OFFSET/TOTAL for one of several targets splitting a TOTAL-shard block (repeatable)")
ap.add_argument("--whole", action="append", default=[], metavar="LABEL",
help="a target none of whose test.xml may be all skipped (repeatable)")
args = ap.parse_args(argv)
suites = []
for label, script, shards in args.suite:
if not shards.isdigit() or int(shards) < 1:
ap.error(f"--suite {label}: SHARDS must be a positive integer, got {shards!r}")
suites.append((label, script, int(shards)))
for label, script, spec in args.suite:
m = SHARD_SPEC.match(spec)
if not m or int(m.group(1)) < 1:
ap.error(f"--suite {label}: SHARDS must be N or N@OFFSET/TOTAL with N >= 1, got {spec!r}")
shards = int(m.group(1))
offset = int(m.group(2)) if m.group(2) else 0
total = int(m.group(3)) if m.group(3) else shards
suites.append((label, script, shards, offset, total))
tested, _, bep_testlogs = read_bep(args.bep)
testlogs = args.testlogs or bep_testlogs or "bazel-testlogs"
lines, problems = check(tested, testlogs, suites, whole=args.whole)

View file

@ -8,8 +8,8 @@
# go_test_variant.sh it reuses the go_test's binary instead of compiling the
# package again.
#
# Usage: go_test_manifest_shard.sh <shard script> <binary env var> <binary>
# [binary args...]
# Usage: go_test_manifest_shard.sh [--shard-offset=N --shard-total=M]
# <shard script> <binary env var> <binary> [binary args...]
# <shard script>, <binary>: runfiles paths ($(rootpath ...)), relative to
# the workspace runfiles directory, which is the test's working directory
# and where the script's source globs (cmd/bd/*_embedded_test.go, ...)
@ -22,11 +22,29 @@
# binary flags.
#
# Bazel's shard k of n (shard_count must equal the manifest's shard total)
# becomes the script's shard k+1 of n. The binary itself must not shard again,
# becomes the script's shard k+1 of n. A manifest block larger than Bazel's
# 50-shard cap per rule is split over several targets: with --shard-offset=N
# --shard-total=M, shard k of n becomes the script's shard N+k+1 of M, so
# targets with offsets 0, n1, n1+n2, ... and shard counts summing to M run
# every shard of the block exactly once (check_shard_coverage.py checks
# that the targets' ranges tile 1..M). The binary itself must not shard again,
# so TEST_TOTAL_SHARDS/TEST_SHARD_INDEX are removed after this wrapper tells
# Bazel it supports sharding. The go_test's own `env` is not inherited (see
# go_test_variant.sh); the target repeats it.
set -euo pipefail
offset=0
part_total=""
while [[ "${1:-}" == --shard-* ]]; do
case "$1" in
--shard-offset=*) offset="${1#*=}" ;;
--shard-total=*) part_total="${1#*=}" ;;
*)
echo "go_test_manifest_shard.sh: unknown flag $1" >&2
exit 2
;;
esac
shift
done
script="$1"
bin_var="$2"
bin="$3"
@ -34,6 +52,17 @@ shift 3
total="${TEST_TOTAL_SHARDS:-1}"
index="${TEST_SHARD_INDEX:-0}"
if [[ -n "$part_total" ]]; then
if ! [[ "$offset" =~ ^[0-9]+$ && "$part_total" =~ ^[0-9]+$ ]] || ((offset + total > part_total)); then
echo "go_test_manifest_shard.sh: --shard-offset=$offset with $total shards exceeds --shard-total=$part_total" >&2
exit 2
fi
index=$((offset + index))
total="$part_total"
elif ((offset != 0)); then
echo "go_test_manifest_shard.sh: --shard-offset needs --shard-total" >&2
exit 2
fi
if [[ -n "${TEST_SHARD_STATUS_FILE:-}" ]]; then
touch "$TEST_SHARD_STATUS_FILE"
fi