diff --git a/docs/guides/dev/behaviour-drivers.md b/docs/guides/dev/behaviour-drivers.md index 7f93ad03b4..f94b75da82 100644 --- a/docs/guides/dev/behaviour-drivers.md +++ b/docs/guides/dev/behaviour-drivers.md @@ -45,7 +45,7 @@ The suite uses a single unified `install.Driver` constructed via `install.Factor | Environment | Factory | Mint | Org | Install mode | |-------------|---------|------|-----|-------------| -| `dev` (default) | `NewRepoPoolCFMintPreviews` | One public CF Worker preview per mint group leased in the run (two at 12 slots per org) | Pool orgs `halfsend-01` … `halfsend-12` | Vendored binary | +| `dev` (default) | `NewRepoPoolCFMintPreviews` | One public CF Worker preview per mint group leased in the run (four at 12 slots per org) | Pool orgs `halfsend-01` … `halfsend-22` | Vendored binary | | `stage` | `NewRepoPoolCFMintStage` | Durable CF Worker at `stage-mint.fullsend.sh` | `halfsend` (single unsuffixed org) | Non-vendored, `--fullsend-ref=main` | Each factory returns the same shared slot driver (`composed.go`), which owns the full lifecycle: @@ -59,7 +59,7 @@ The Factory takes an `install.PoolConfig`: the pool layout, a per-org token sour Pool orgs must already have the six `fullsend-test-*` role apps and the production `fullsend-ai-e2e` app installed, plus per-repo mint enrollment for each numbered repo (one-time GCP admin step on the hosted mint project). The driver does not run `fullsend admin install` or `fullsend mint enroll`. See [e2e-testing.md](e2e-testing.md#behaviour-tests-and-per-repo-mint-enrollment). -The two CF mint drivers compute mint groups from the pool layout on every run (`planMintGroups` in `mint_groups.go`); there is no hardcoded org-to-mint list. A group's `--workflow-host-repos` lists its orgs' pool repos plus each slot's mint-probe host `/test-repo-NN-mint-host` (`install.MintProbeHostRepoSuffix`). The driver packs orgs in order into the fewest groups whose actual serialized list stays within 5,000 bytes, a margin under Cloudflare's 5 KB per-variable limit. At 12 slots per org a list for six orgs is 4,319 bytes and for seven is 5,039 bytes, so the 12 DEV orgs use two mints. A changed slot or org count regroups automatically. If one org's list alone exceeds the limit, the factory fails and names the org (one org's slots are not split across mints). The [GitHub mint scope scenarios](behaviour-testing.md#github-mint-scope-scenarios) create and delete the probe hosts per scenario. Because the lists are deploy flags, a change takes effect on the next suite run's mint deploy, with no GCP enrollment step. +The two CF mint drivers compute mint groups from the pool layout on every run (`planMintGroups` in `mint_groups.go`); there is no hardcoded org-to-mint list. A group's `--workflow-host-repos` lists its orgs' pool repos plus each slot's mint-probe host `/test-repo-NN-mint-host` (`install.MintProbeHostRepoSuffix`). The driver packs orgs in order into the fewest groups whose actual serialized list stays within 5,000 bytes, a margin under Cloudflare's 5 KB per-variable limit. At 12 slots per org a list for six orgs is 4,319 bytes and for seven is 5,039 bytes, so the 22 DEV orgs use four mints. A changed slot or org count regroups automatically. If one org's list alone exceeds the limit, the factory fails and names the org (one org's slots are not split across mints). The [GitHub mint scope scenarios](behaviour-testing.md#github-mint-scope-scenarios) create and delete the probe hosts per scenario. Because the lists are deploy flags, a change takes effect on the next suite run's mint deploy, with no GCP enrollment step. RepoPoolCFMintPreviews deploys its previews with `--public` (`PER_REPO_WIF_REPOS=*`) instead of `--per-repo-wif-repos`, so no caller list has to fit in a Worker variable or be kept enrolled. RepoPoolCFMintStage keeps `--per-repo-wif-repos` for its durable mint. See [Public preview mints](behaviour-testing.md#public-preview-mints) for the accepted trade-off. diff --git a/docs/guides/dev/behaviour-testing.md b/docs/guides/dev/behaviour-testing.md index 3caef79dc7..4c1905521b 100644 --- a/docs/guides/dev/behaviour-testing.md +++ b/docs/guides/dev/behaviour-testing.md @@ -324,10 +324,10 @@ In CI, the test runner mints cross-org `e2e` installation tokens via OIDC for Gi ### Repo allocation via the shared slot driver -`RunSuite` and `RunPlaybackSuite` build one shared install driver (`install.Factory` over an `install.PoolConfig`) for the environment's pool. On `dev` the pool is the derived orgs `halfsend-01` … `halfsend-12`, and on `stage` it is the single unsuffixed `halfsend` org, each with `test-repo-01` … `test-repo-NN` slots (`install.PoolLayoutForEnvironment`; `BEHAVIOUR_POOL_SIZE` sets the slots per org). The driver resolves one installation token per org (`e2etest.TokenForOrg`, minted once per org and kept for the run, since a token outlives the 45-minute job). It builds one forge client per org from that token. The `Given the enrolled test repository` step calls `install.LeaseDriver.AllocateLease(ctx)`, which: +`RunSuite` and `RunPlaybackSuite` build one shared install driver (`install.Factory` over an `install.PoolConfig`) for the environment's pool. On `dev` the pool is the derived orgs `halfsend-01` … `halfsend-22`, and on `stage` it is the single unsuffixed `halfsend` org, each with `test-repo-01` … `test-repo-NN` slots (`install.PoolLayoutForEnvironment`; `BEHAVIOUR_POOL_SIZE` sets the slots per org). The driver resolves one installation token per org (`e2etest.TokenForOrg`, minted once per org and kept for the run, since a token outlives the 45-minute job). It builds one forge client per org from that token. The `Given the enrolled test repository` step calls `install.LeaseDriver.AllocateLease(ctx)`, which: 1. Claims a free slot through the cross-org allocator (`slotpool.go`), blocking until one is free or ctx is cancelled. The claim *creates* the slot repo (the forge's `auto_init` provides the initial commit). A slot whose repo already exists belongs to another holder, possibly another suite. It is skipped for the whole of provisioning and is never reset or deleted. Orgs whose installation's rate-limit headers show the quota nearly spent are skipped until their reset, so leases move to orgs with quota left. -2. On the first lease in any org of a mint group, deploys the group's mint: a public preview mint on `dev` and the durable STAGE mint on `stage`. The driver packs the pool orgs into the fewest groups whose `WORKFLOW_HOST_REPOS` fits in 5,000 bytes, recomputed from the layout on every run (two groups for the 12 DEV orgs at 12 slots each, one for STAGE). Every mint's `--status-github-group` is the `mint-status` team of one pool org, picked at random once per job. Concurrent first leases in a group share one deploy. A failed deploy is torn down and retried by the group's next lease, and `Finalize` tears each deployed mint down once. +2. On the first lease in any org of a mint group, deploys the group's mint: a public preview mint on `dev` and the durable STAGE mint on `stage`. The driver packs the pool orgs into the fewest groups whose `WORKFLOW_HOST_REPOS` fits in 5,000 bytes, recomputed from the layout on every run (four groups for the 22 DEV orgs at 12 slots each, one for STAGE). Every mint's `--status-github-group` is the `mint-status` team of one pool org, picked at random once per job. Concurrent first leases in a group share one deploy. A failed deploy is torn down and retried by the group's next lease, and `Finalize` tears each deployed mint down once. 3. Installs fullsend into the claimed repo with the org's credential and mint URL. It deletes a leftover `{name}-fork` from an earlier holder of the slot, then runs `fullsend github setup` (after resolving the inference WIF provider when configured) and the post-install checks. If the install fails, the slot is released, deleting only this lease's own repo. 4. Returns an `install.RepoLease` with the org, repo, the org's token and client, and its group's mint URL, status group and workflow hosts. The step rebinds the scenario `World` to that org: `Org`, `RepoOwner`, `Token`, `MintURL`, `MintStatusGroup`, `MintWorkflowHostRepos`, and SCM/CI drivers rebuilt through `World.OrgDrivers` from the lease's client. Every step and the scenario's cleanup then act in the leased org with its credentials. @@ -337,7 +337,7 @@ The `dev` preview mints are deployed with `--public` (`PER_REPO_WIF_REPOS=*`), w Godog concurrency stays independent of slot capacity. The default is the slots per org (12), and `GODOG_CONCURRENCY` overrides it. Capacity is every -slot of the pool (144 on `dev`), and a concurrency above capacity only makes +slot of the pool (264 on `dev`), and a concurrency above capacity only makes workers wait. The allocator logs each claim and release with its org/repo and that org's quota (`[slots] claimed halfsend-03/test-repo-05 (quota …)`). An exhausted pass logs diff --git a/docs/guides/dev/e2e-testing.md b/docs/guides/dev/e2e-testing.md index e1634691bd..5f99e8b866 100644 --- a/docs/guides/dev/e2e-testing.md +++ b/docs/guides/dev/e2e-testing.md @@ -15,7 +15,7 @@ Playwright or stored sessions. Before running e2e locally or in CI: -1. **Pool orgs** (`halfsend-01` … `halfsend-12`) provisioned per [Pool org provisioning](#pool-org-provisioning) below +1. **Pool orgs** (`halfsend-01` … `halfsend-22`) provisioned per [Pool org provisioning](#pool-org-provisioning) below 2. **Mint** deployed with `e2e` role enrolled and the requesting repository `fullsend-ai/fullsend` enrolled in `PER_REPO_WIF_REPOS` (or the mint explicitly in public mode, `PER_REPO_WIF_REPOS=*`) 3. **CI only:** pool orgs with `FULLSEND_FOREIGN_E2E_REPOS` authorizing `fullsend-ai/fullsend` 4. **Local only:** `gh auth login` (or `GH_TOKEN` / `GITHUB_TOKEN`) with admin access on pool orgs @@ -76,7 +76,7 @@ Optional environment variables: Behaviour tests use the pool orgs (for `ENVIRONMENT=dev`) and install fullsend per-repo via `fullsend github setup`. When `ENVIRONMENT=stage`, the suite uses the `halfsend` org with a durable CF Worker mint instead of a pool org. See [behaviour-testing.md](behaviour-testing.md) and [behaviour-drivers.md](behaviour-drivers.md). The behaviour and playback suites lease `(org, test-repo-NN)` slots across the -pool orgs (`halfsend-01` … `halfsend-12` for DEV, or `halfsend` for STAGE) +pool orgs (`halfsend-01` … `halfsend-22` for DEV, or `halfsend` for STAGE) instead of locking a whole org; see [behaviour-testing.md](behaviour-testing.md#repo-allocation-via-the-shared-slot-driver). Other e2e tests still acquire an exclusive lock on one pool org — see @@ -144,7 +144,7 @@ One-time enrollment for all pool orgs (idempotent). Enroll the singular `test-re ```bash export GCP_PROJECT=it-gcp-konflux-dev-fullsend -for i in $(seq -w 1 12); do +for i in $(seq -w 1 22); do go run ./cmd/fullsend mint enroll "halfsend-${i}/test-repo" \ --project="$GCP_PROJECT" --region=us-central1 for j in $(seq -w 1 12); do @@ -192,7 +192,7 @@ go run ./cmd/fullsend admin foreign list --org halfsend-01 # expect e2e → fullsend-ai/fullsend ``` -Existing pool orgs (`halfsend-01` … `halfsend-12`) need a one-time operator pass: install the e2e app (if missing) and run: +Existing pool orgs (`halfsend-01` … `halfsend-22`) need a one-time operator pass: install the e2e app (if missing) and run: ```bash go run ./cmd/fullsend admin foreign allow --org halfsend-NN --role e2e --caller fullsend-ai/fullsend @@ -281,6 +281,16 @@ a closed team. | `halfsend-10` | `halfsend-10/mint-status` | | `halfsend-11` | `halfsend-11/mint-status` | | `halfsend-12` | `halfsend-12/mint-status` | +| `halfsend-13` | `halfsend-13/mint-status` | +| `halfsend-14` | `halfsend-14/mint-status` | +| `halfsend-15` | `halfsend-15/mint-status` | +| `halfsend-16` | `halfsend-16/mint-status` | +| `halfsend-17` | `halfsend-17/mint-status` | +| `halfsend-18` | `halfsend-18/mint-status` | +| `halfsend-19` | `halfsend-19/mint-status` | +| `halfsend-20` | `halfsend-20/mint-status` | +| `halfsend-21` | `halfsend-21/mint-status` | +| `halfsend-22` | `halfsend-22/mint-status` | The STAGE and numbered test mints take these values as `--status-github-group=ORG/mint-status`. The behaviour suite's CF mint @@ -623,7 +633,7 @@ The generated config (print it with `--print-config`): [ADR 0137](../../ADRs/0137-inference-gateway-credential-route.md). - authorises each model with an exact-match list of `jwt.repository` values. The list covers `test-repo-01` to `test-repo-12` in `halfsend-01` to - `halfsend-12` and in the STAGE org `halfsend`: 156 repositories. It + `halfsend-22` and in the STAGE org `halfsend`: 276 repositories. It matches names, so keep the pool orgs registered: whoever owns a pool org name can call the gateway. A model that a configured key may call also admits that key's `apiKey.purpose`. @@ -873,7 +883,7 @@ The `fix` role reuses the coder app (`fullsend-test-coder`) and ### Installation targets All six test apps are installed with access to **all repositories** on -`halfsend-01` through `halfsend-12` and on `halfsend` (used by the STAGE driver). +`halfsend-01` through `halfsend-22` and on `halfsend` (used by the STAGE driver). The production `fullsend-ai-e2e` app is installed on the same organizations for cross-org suite control and minting. The other production agent apps are not required for the normal behaviour or playback suites and are intentionally not @@ -911,7 +921,7 @@ App registration in that setup. Per-repo setup may still request the literal **Permission rollout for the coder App:** When adding a permission such as `packages:read`, update the `fullsend-test-coder` App registration first. Then have the installation owner for each existing pool org (`halfsend-01` through -`halfsend-12`) Accept the pending permission update. New pool-org installs +`halfsend-22`) Accept the pending permission update. New pool-org installs receive the permission during installation; existing installs may otherwise continue using the mint's rollout warning path. diff --git a/docs/guides/infrastructure/infrastructure-reference.md b/docs/guides/infrastructure/infrastructure-reference.md index 6d81a6fd5c..6f384af2b7 100644 --- a/docs/guides/infrastructure/infrastructure-reference.md +++ b/docs/guides/infrastructure/infrastructure-reference.md @@ -167,7 +167,7 @@ Recommended operator order for adding **`packages:read`** to `coder` (code / fix (hosted: `https://github.com/organizations/fullsend-ai/settings/apps//permissions`). Optionally include a short note to users explaining why. 2. Update the App used by the pool installations as well, and have each - `halfsend-01` … `halfsend-12` and `halfsend` installation owner Accept its pending update. + `halfsend-01` … `halfsend-22` and `halfsend` installation owner Accept its pending update. For the test-app setup, including the e2e pool organizations, that is `fullsend-test-coder`. Neither app set should be left permanently on permission-drop warnings. diff --git a/hack/setup-e2e-inference-gateway.sh b/hack/setup-e2e-inference-gateway.sh index 8acd6776cc..c364e072db 100755 --- a/hack/setup-e2e-inference-gateway.sh +++ b/hack/setup-e2e-inference-gateway.sh @@ -93,7 +93,7 @@ set -euo pipefail # Keep in sync with orgPool in internal/e2etest/testutil.go (plus the STAGE # org halfsend) and DefaultPoolSize in pkg/behaviourtest/drivers/install/ # driver.go. A pool change is an edit here plus a re-run. -POOL_ORGS=(halfsend-01 halfsend-02 halfsend-03 halfsend-04 halfsend-05 halfsend-06 halfsend-07 halfsend-08 halfsend-09 halfsend-10 halfsend-11 halfsend-12 halfsend) +POOL_ORGS=(halfsend-01 halfsend-02 halfsend-03 halfsend-04 halfsend-05 halfsend-06 halfsend-07 halfsend-08 halfsend-09 halfsend-10 halfsend-11 halfsend-12 halfsend-13 halfsend-14 halfsend-15 halfsend-16 halfsend-17 halfsend-18 halfsend-19 halfsend-20 halfsend-21 halfsend-22 halfsend) POOL_REPOS=(test-repo-01 test-repo-02 test-repo-03 test-repo-04 test-repo-05 test-repo-06 test-repo-07 test-repo-08 test-repo-09 test-repo-10 test-repo-11 test-repo-12) # A repository outside the pool. Only it may use the echo-denied model, so a diff --git a/hack/setup-e2e-inference-gateway_test.sh b/hack/setup-e2e-inference-gateway_test.sh index 30a42c43c7..c6a129c671 100755 --- a/hack/setup-e2e-inference-gateway_test.sh +++ b/hack/setup-e2e-inference-gateway_test.sh @@ -387,9 +387,9 @@ expect_out "prints the x-api-key probe" "x-api-key only: GET /v1/models -> HTTP CFG="${STATE}/secrets/${CFG_SECRET}.v1" if [[ "$(cat "${STATE}/secrets/${KEY_SECRET}.v1")" == "e2e-stub-upstream-key" ]]; then pass "stub key holds the fixed value"; else fail "stub key value"; fi -if [[ "$(grep -o '"halfsend[-0-9]*/test-repo-[0-9][0-9]"' "${CFG}" | sort -u | wc -l | tr -d ' ')" == "156" ]] \ +if [[ "$(grep -o '"halfsend[-0-9]*/test-repo-[0-9][0-9]"' "${CFG}" | sort -u | wc -l | tr -d ' ')" == "276" ]] \ && grep -q '"halfsend/test-repo-12"' "${CFG}"; then - pass "config allows the 13 x 12 pool repositories"; else fail "pool allowlist"; fi + pass "config allows the 23 x 12 pool repositories"; else fail "pool allowlist"; fi if grep -q 'mode: strict' "${CFG}" && grep -q 'audiences: \[fullsend-e2e-gateway\]' "${CFG}" \ && ! grep -q 'preserveToken: true' "${CFG}"; then pass "config validates GitHub OIDC strictly with the fixed audience"; else fail "jwtAuth"; fi diff --git a/internal/e2etest/testutil.go b/internal/e2etest/testutil.go index 5bf8e5f17b..4c0e6a7dc1 100644 --- a/internal/e2etest/testutil.go +++ b/internal/e2etest/testutil.go @@ -87,6 +87,16 @@ var orgPool = []string{ "halfsend-10", "halfsend-11", "halfsend-12", + "halfsend-13", + "halfsend-14", + "halfsend-15", + "halfsend-16", + "halfsend-17", + "halfsend-18", + "halfsend-19", + "halfsend-20", + "halfsend-21", + "halfsend-22", } var ( diff --git a/pkg/behaviourtest/drivers/install/mint_groups_test.go b/pkg/behaviourtest/drivers/install/mint_groups_test.go index 8a64f3fd41..e9e90d9fb5 100644 --- a/pkg/behaviourtest/drivers/install/mint_groups_test.go +++ b/pkg/behaviourtest/drivers/install/mint_groups_test.go @@ -37,14 +37,16 @@ func assertPacked(t *testing.T, layout PoolLayout, groups []mintGroup, maxBytes assert.Equal(t, layout.Orgs(), all) } -func TestPlanMintGroups_DevPoolTwoMints(t *testing.T) { - layout := DevPoolLayout(DefaultPoolSize) // 12 orgs × 12 slots +func TestPlanMintGroups_DevPoolFourMints(t *testing.T) { + layout := DevPoolLayout(DefaultPoolSize) // 22 orgs × 12 slots groups, err := planMintGroups(layout, maxWorkerVarBytes) require.NoError(t, err) - require.Len(t, groups, 2) + require.Len(t, groups, 4) assertPacked(t, layout, groups, maxWorkerVarBytes) assert.Equal(t, layout.Orgs()[:6], groups[0].orgs) - assert.Equal(t, layout.Orgs()[6:], groups[1].orgs) + assert.Equal(t, layout.Orgs()[6:12], groups[1].orgs) + assert.Equal(t, layout.Orgs()[12:18], groups[2].orgs) + assert.Equal(t, layout.Orgs()[18:], groups[3].orgs) // The serialized sizes cited in #8681: six orgs fit, seven do not. assert.Len(t, groups[0].workflowHostRepos, 4319) assert.Len(t, groupWorkflowHostRepos(layout.Orgs()[:7], DefaultPoolSize), 5039) @@ -56,12 +58,12 @@ func TestPlanMintGroups_NearByteLimit(t *testing.T) { groups, err := planMintGroups(layout, six) require.NoError(t, err) - assert.Equal(t, []int{6, 6}, groupSizes(groups), "a list exactly at the limit fits") + assert.Equal(t, []int{6, 6, 6, 4}, groupSizes(groups), "a list exactly at the limit fits") assertPacked(t, layout, groups, six) groups, err = planMintGroups(layout, six-1) require.NoError(t, err) - assert.Equal(t, []int{5, 5, 2}, groupSizes(groups), "one byte over moves an org to the next mint") + assert.Equal(t, []int{5, 5, 5, 5, 2}, groupSizes(groups), "one byte over moves an org to the next mint") assertPacked(t, layout, groups, six-1) } @@ -79,8 +81,8 @@ func TestPlanMintGroups_RecomputedForPoolChanges(t *testing.T) { layout PoolLayout sizes []int }{ - {"fewer slots per org", DevPoolLayout(6), []int{12}}, - {"more slots per org", DevPoolLayout(20), []int{4, 4, 4}}, + {"fewer slots per org", DevPoolLayout(6), []int{13, 9}}, + {"more slots per org", DevPoolLayout(20), []int{4, 4, 4, 4, 4, 2}}, {"fewer orgs", PoolLayout{FirstOrgIndex: 1, OrgCount: 4, SlotsPerOrg: DefaultPoolSize}, []int{4}}, {"more orgs", PoolLayout{FirstOrgIndex: 1, OrgCount: 13, SlotsPerOrg: DefaultPoolSize}, []int{6, 6, 1}}, {"stage", StagePoolLayout(DefaultPoolSize), []int{1}}, @@ -118,7 +120,8 @@ func TestPlanCFMints_StatusGroupPickedOnce(t *testing.T) { assert.Equal(t, 1, calls, "one status team per job") assert.Equal(t, DevPoolLayout(DefaultPoolSize).Orgs(), offered, "eligible teams are the pool orgs'") assert.Equal(t, "halfsend-10/mint-status", plan.statusGroup) - assert.Equal(t, [][]string{DevPoolLayout(DefaultPoolSize).Orgs()[:6], DevPoolLayout(DefaultPoolSize).Orgs()[6:]}, groupOrgs(plan.groups)) + orgs := DevPoolLayout(DefaultPoolSize).Orgs() + assert.Equal(t, [][]string{orgs[:6], orgs[6:12], orgs[12:18], orgs[18:]}, groupOrgs(plan.groups)) assert.Equal(t, 0, plan.groupOf["halfsend-01"]) assert.Equal(t, 1, plan.groupOf["halfsend-12"]) diff --git a/pkg/behaviourtest/drivers/install/repopool_cfmint_previews_test.go b/pkg/behaviourtest/drivers/install/repopool_cfmint_previews_test.go index 938f89a5a6..8b41bd467d 100644 --- a/pkg/behaviourtest/drivers/install/repopool_cfmint_previews_test.go +++ b/pkg/behaviourtest/drivers/install/repopool_cfmint_previews_test.go @@ -497,7 +497,7 @@ func TestNewRepoPoolCFMintPreviews_DerivedDevOrgs(t *testing.T) { assert.Equal(t, DevPoolOrgCount*2, d.Capacity()) orgs := d.(*composedDriver).alloc.layout.Orgs() assert.Equal(t, "halfsend-01", orgs[0]) - assert.Equal(t, "halfsend-12", orgs[len(orgs)-1]) + assert.Equal(t, "halfsend-22", orgs[len(orgs)-1]) } // --- setupCFMintPEMDir tests --- diff --git a/pkg/behaviourtest/drivers/install/repopool_cfmint_stage.go b/pkg/behaviourtest/drivers/install/repopool_cfmint_stage.go index 71ef1efa59..6430dcc2bb 100644 --- a/pkg/behaviourtest/drivers/install/repopool_cfmint_stage.go +++ b/pkg/behaviourtest/drivers/install/repopool_cfmint_stage.go @@ -32,7 +32,7 @@ const ( StageMintWorkerName = "stage-mint" // StageOrg is the GitHub org used for STAGE behaviour tests. - // Unlike the DEV pool orgs (halfsend-01 … halfsend-12), the STAGE + // Unlike the DEV pool orgs (halfsend-01 … halfsend-22), the STAGE // driver uses a single org. Within this org, a repo pool is used // just like in the DEV drivers. StageOrg = "halfsend" diff --git a/pkg/behaviourtest/drivers/install/slotpool.go b/pkg/behaviourtest/drivers/install/slotpool.go index 60e37486a2..8ceee03e7e 100644 --- a/pkg/behaviourtest/drivers/install/slotpool.go +++ b/pkg/behaviourtest/drivers/install/slotpool.go @@ -40,8 +40,8 @@ const ( poolOrgPrefix = StageOrg // DevPoolOrgCount is the number of numbered DEV pool orgs - // (halfsend-01 … halfsend-12). - DevPoolOrgCount = 12 + // (halfsend-01 … halfsend-22). + DevPoolOrgCount = 22 // SlotRepoDescription is the description prefix every claimed slot // repo is created with. It is the test-ownership marker: only repos @@ -104,7 +104,7 @@ type PoolLayout struct { SlotsPerOrg int } -// DevPoolLayout is the DEV pool: halfsend-01 … halfsend-12, each with +// DevPoolLayout is the DEV pool: halfsend-01 … halfsend-22, each with // test-repo-01 … test-repo- (DefaultPoolSize by default). func DevPoolLayout(slotsPerOrg int) PoolLayout { return PoolLayout{FirstOrgIndex: 1, OrgCount: DevPoolOrgCount, SlotsPerOrg: slotsPerOrg} diff --git a/pkg/behaviourtest/drivers/install/slotpool_test.go b/pkg/behaviourtest/drivers/install/slotpool_test.go index 65fd28e81c..674e5dd916 100644 --- a/pkg/behaviourtest/drivers/install/slotpool_test.go +++ b/pkg/behaviourtest/drivers/install/slotpool_test.go @@ -205,6 +205,7 @@ func TestPoolNames(t *testing.T) { assert.Equal(t, StageOrg, PoolOrgName(0)) assert.Equal(t, "halfsend-01", PoolOrgName(1)) assert.Equal(t, "halfsend-12", PoolOrgName(12)) + assert.Equal(t, "halfsend-22", PoolOrgName(22)) assert.Equal(t, "test-repo-01", PoolSlotName(1)) assert.Equal(t, "test-repo-12", PoolSlotName(12)) assert.Equal(t, "halfsend-01/test-repo-03", Slot{Org: "halfsend-01", Repo: "test-repo-03"}.String()) @@ -215,13 +216,13 @@ func TestDevPoolLayout(t *testing.T) { l := PoolLayoutForEnvironment("dev", t.Logf) assert.Equal(t, DevPoolLayout(DefaultPoolSize), l) orgs := l.Orgs() - require.Len(t, orgs, 12) + require.Len(t, orgs, 22) assert.Equal(t, "halfsend-01", orgs[0]) - assert.Equal(t, "halfsend-12", orgs[11]) + assert.Equal(t, "halfsend-22", orgs[21]) slots := l.Slots() - require.Len(t, slots, 144) + require.Len(t, slots, 264) assert.Equal(t, Slot{Org: "halfsend-01", Repo: "test-repo-01"}, slots[0]) - assert.Equal(t, Slot{Org: "halfsend-12", Repo: "test-repo-12"}, slots[143]) + assert.Equal(t, Slot{Org: "halfsend-22", Repo: "test-repo-12"}, slots[263]) } func TestStagePoolLayout_OnlyUnsuffixedOrg(t *testing.T) { @@ -253,7 +254,7 @@ func TestNewSlotAllocator_Validation(t *testing.T) { a, err := newSlotAllocator(DevPoolLayout(DefaultPoolSize), cf, nil) require.NoError(t, err) - assert.Equal(t, 144, a.Capacity()) + assert.Equal(t, 264, a.Capacity()) } func TestSlotAllocator_ConcurrentClaimsAreDistinct(t *testing.T) { diff --git a/pkg/behaviourtest/select.go b/pkg/behaviourtest/select.go index 738d029646..e648afb977 100644 --- a/pkg/behaviourtest/select.go +++ b/pkg/behaviourtest/select.go @@ -29,7 +29,7 @@ func installFactoryFor(environment string) install.Factory { // poolConfigFor returns the slot pool and runtime dependencies the // install factory needs: the environment's layout (derived DEV orgs -// halfsend-01 … halfsend-12, or the unsuffixed STAGE org halfsend; see +// halfsend-01 … halfsend-22, or the unsuffixed STAGE org halfsend; see // install.PoolLayoutForEnvironment), one installation token per org via // e2etest.TokenForOrg, and live forge clients. func poolConfigFor(environment string, e2eCfg e2etest.EnvConfig, binary string, logf func(string, ...any)) install.PoolConfig { diff --git a/pkg/behaviourtest/select_test.go b/pkg/behaviourtest/select_test.go index 5fa161407c..aab6fcf8e9 100644 --- a/pkg/behaviourtest/select_test.go +++ b/pkg/behaviourtest/select_test.go @@ -119,10 +119,10 @@ func TestResolveConcurrency(t *testing.T) { overCapacity bool wantErr string }{ - {name: "default to slots per org, not pool capacity", raw: "", defaultN: 12, capacity: 144, want: 12}, + {name: "default to slots per org, not pool capacity", raw: "", defaultN: 12, capacity: 264, want: 12}, {name: "default capped at capacity", raw: "", defaultN: 12, capacity: 4, want: 4}, - {name: "honor explicit value", raw: "4", defaultN: 12, capacity: 144, want: 4}, - {name: "explicit value above default", raw: "30", defaultN: 12, capacity: 144, want: 30}, + {name: "honor explicit value", raw: "4", defaultN: 12, capacity: 264, want: 4}, + {name: "explicit value above default", raw: "30", defaultN: 12, capacity: 264, want: 30}, {name: "warn when over capacity", raw: "20", defaultN: 12, capacity: 12, want: 20, overCapacity: true}, {name: "reject zero", raw: "0", defaultN: 12, capacity: 12, wantErr: "positive integer"}, {name: "reject negative", raw: "-1", defaultN: 12, capacity: 12, wantErr: "positive integer"},