Skip to content

feat(snapshot): support uncompressed mariabackup/xtrabackup snapshots and seeds - #8704

Merged
rfay merged 3 commits into
ddev:mainfrom
rfay:20260814_rfay_uncompressed_snapshot
Aug 22, 2026
Merged

rfay merged 3 commits into
ddev:mainfrom
rfay:20260814_rfay_uncompressed_snapshot

Conversation

@rfay

@rfay rfay commented Aug 14, 2026 •

Copy link
Copy Markdown
Member

Short Summary (TL;DR)

Adds a --uncompressed option so ddev snapshot, ddev snapshot restore, and the first-boot base_db seed can skip compression. This uses more disk space but restores faster since there's nothing to decompress. Nothing changes unless you use the new option.

The Issue

Snapshots and the first-boot database seed are always compressed today (zstd, or gzip on very old databases). Decompressing them takes real time, often 30-40% of a restore, and it competes for CPU with the restore step that runs right after it. On a host with plenty of disk space, or a seed that never travels over a network, that CPU cost buys nothing.

How This PR Solves The Issue

  • ddev snapshot --uncompressed writes the raw mariabackup/xtrabackup stream instead of piping it through a compressor. The file gets a .mbstream or .xbstream extension instead of .zst/.gz.
  • ddev snapshot restore and the base_db seed lookup (project initializer, custom dbimage seed, and stock seed) recognize these new extensions and skip decompression when they see them.
  • ddev snapshot --list now shows a Compression column (zstd, gzip, or none) so you can tell which kind of snapshot you're looking at.
  • A new BASE_DB_UNCOMPRESSED build arg lets someone building the ddev-dbserver image from source bake in an uncompressed stock seed too.
  • PostgreSQL isn't supported for --uncompressed (its backup pipeline is different) and gives a clear error if you try.

Nothing here changes any default. You only get an uncompressed file if you explicitly ask for one.

Manual Testing Instructions

  1. In a project: ddev snapshot --uncompressed --name=test1
  2. ddev snapshot --list - the new snapshot should show extension .mbstream/.xbstream, a much bigger size than a normal snapshot, and none in the Compression column
  3. ddev snapshot restore test1 - should restore successfully
  4. Try ddev snapshot --uncompressed on a PostgreSQL project - should fail with a clear error message

Automated Testing Overview

  • pkg/ddevapp/snapshot_test.go: a full create/list/restore round trip for an uncompressed snapshot, plus a test that PostgreSQL rejects the option
  • pkg/ddevapp/base_db_seed_test.go: extended to cover the new seed extensions
  • containers/ddev-dbserver/test/base_db_seed.bats: a new test for an uncompressed initializer seed

Release/Deployment Notes

None. Every new code path only runs if someone uses the new --uncompressed flag, an extension nobody has today, or the new BASE_DB_UNCOMPRESSED build arg.

@github-actions github-actions Bot added dependencies Pull requests that update a dependency file enhancement labels Aug 14, 2026
@github-actions

github-actions Bot commented Aug 14, 2026 •

Copy link
Copy Markdown

@rfay
rfay force-pushed the 20260814_rfay_uncompressed_snapshot branch 3 times, most recently from 06ef339 to 5da0e48 Compare August 14, 2026 21:52
@rfay

rfay commented Aug 17, 2026

Copy link
Copy Markdown
Member Author

This is pretty close to ready. I worked on improving https://github.com/rfay/database-performance/blob/main/scripts/build-and-push-seeded-image.sh so it's easier to build an image for image testing of an uncompressed image.

@rfay
rfay marked this pull request as ready for review August 17, 2026 17:10
@rfay
rfay requested review from a team as code owners August 17, 2026 17:10
@rfay

rfay commented Aug 17, 2026

Copy link
Copy Markdown
Member Author

I tested this with large built images using https://github.com/rfay/database-performance/blob/main/scripts/build-and-push-seeded-image.sh

./build-and-push-seeded-image.sh --snapshot=compressed-2g --project=~/workspace/d11 --output-image=randyfay/compressed-2g —push
./build-and-push-seeded-image.sh --snapshot=uncompressed-2g --project=~/workspace/d11 --output-image=randyfay/uncompressed-2g —push

Results are in randyfay/uncompressed-2g and randyfay/compressed-2g

The Docker image compression does a pretty good job of compressing the overall result.

@rfay

rfay commented Aug 17, 2026

Copy link
Copy Markdown
Member Author

The only thing that makes me sad about this is one more complexity. But most people will never know about it.

@rfay
rfay requested review from stasadev and weitzman August 17, 2026 17:18
@rfay
rfay force-pushed the 20260814_rfay_uncompressed_snapshot branch from 5da0e48 to de7746d Compare August 18, 2026 04:44
@github-actions

Copy link
Copy Markdown

Pushed updated container image(s) for this PR:

  • ddev/ddev-dbserver-mariadb-10.0:7b74988035
  • ddev/ddev-dbserver-mariadb-10.11:7b74988035
  • ddev/ddev-dbserver-mariadb-10.1:7b74988035
  • ddev/ddev-dbserver-mariadb-10.2:7b74988035
  • ddev/ddev-dbserver-mariadb-10.3:7b74988035
  • ddev/ddev-dbserver-mariadb-10.4:7b74988035
  • ddev/ddev-dbserver-mariadb-10.5:7b74988035
  • ddev/ddev-dbserver-mariadb-10.6:7b74988035
  • ddev/ddev-dbserver-mariadb-10.7:7b74988035
  • ddev/ddev-dbserver-mariadb-10.8:7b74988035
  • ddev/ddev-dbserver-mariadb-11.4:7b74988035
  • ddev/ddev-dbserver-mariadb-11.8:7b74988035
  • ddev/ddev-dbserver-mariadb-12.3:7b74988035
  • ddev/ddev-dbserver-mariadb-5.5:7b74988035
  • ddev/ddev-dbserver-mysql-5.5:7b74988035
  • ddev/ddev-dbserver-mysql-5.6:7b74988035
  • ddev/ddev-dbserver-mysql-5.7:7b74988035
  • ddev/ddev-dbserver-mysql-8.0:7b74988035
  • ddev/ddev-dbserver-mysql-8.4:7b74988035
  • ddev/ddev-dbserver-mysql-9.7:7b74988035

@rfay
rfay force-pushed the 20260814_rfay_uncompressed_snapshot branch 4 times, most recently from b44fca1 to 18ae6e1 Compare August 21, 2026 16:41
rfay added 3 commits August 21, 2026 21:59
… and seeds, fixes ddev#8665

Adds an opt-in `--uncompressed` option so `ddev snapshot`, `ddev snapshot restore`, and the `base_db` first-boot seed (project, derived-image, and stock tiers) can skip compression entirely, trading disk space for zero decompression CPU cost. Defaults are unchanged.

- Fixes ddev#8665

Snapshot/restore and the first-boot `base_db` seed always pipe mariabackup/xtrabackup's raw stream through a compressor (zstdmt/zstd/gzip). Decompression is routinely 30-40% of total restore/start time and competes for the same CPU cores `mariabackup --copy-back` needs right after, which is pure overhead on hosts with disk space to spare and no offsetting benefit (fast local disk, low core count, or a seed that never crosses a network).

Two new extensions carry the raw, uncompressed backup-tool stream, matching the `--stream=` value already used by mariabackup (`.mbstream`) and xtrabackup (`.xbstream`), so every downstream consumer keeps dispatching purely on file extension the way it already does for `.zst`/`.gz`:

- `ddev snapshot --uncompressed` writes the raw stream directly (`Snapshot()`/`getBackupCommand()` in `pkg/ddevapp/ddevapp.go`). Postgres is out of scope (its pipeline is pg_basebackup/tar, not a stream tool) and returns a clear error.
- `ddev snapshot restore`, `ListSnapshots()`, and `GetSnapshotFileFromName()` (`pkg/ddevapp/snapshot.go`) recognize the new extensions, and `ddev snapshot --list` now shows each snapshot's compression (`zstd`/`gzip`/`none`).
- `docker-entrypoint.sh`'s restore dispatch and all three `base_db` seed tiers (project `initializer`, derived-image custom seed, stock seed) extract an uncompressed stream directly via `${STREAMTOOL} -x`, no decompressor.
- `create_base_db.sh` gained an opt-in `BASE_DB_UNCOMPRESSED` build arg so a from-source `ddev-dbserver` build can bake in an uncompressed stock seed.

Docs updated to frame this as a deliberate, unusual tradeoff rather than a general recommendation, with the disk-size difference stated plainly.

1. `make` (rebuilds the `ddev-dbserver` image and the `ddev` binary)
2. In a project: `ddev snapshot --uncompressed --name=test1`, then `ddev snapshot --list` — confirm the file has a `.mbstream`/`.xbstream` extension, is much larger than a compressed snapshot, and shows `none` in the Compression column
3. `ddev snapshot restore test1` — confirm it restores successfully
4. Confirm `ddev snapshot --uncompressed` on a PostgreSQL project fails with a clear error
5. Optionally: `docker build --build-arg BASE_DB_UNCOMPRESSED=true ...` on `containers/ddev-dbserver` and boot a container from it to confirm it seeds from an uncompressed `base_db.*`

- `pkg/ddevapp/snapshot_test.go`: `TestSnapshotUncompressed` (full create/list/restore round trip, Docker-backed) and `TestSnapshotUncompressedPostgresError` (no Docker needed)
- `pkg/ddevapp/base_db_seed_test.go`: extended `TestGetInitializerSnapshotFile` with the uncompressed-extension preference-order cases
- `containers/ddev-dbserver/test/base_db_seed.bats`: new "uncompressed initializer seed overrides the stock seed" test alongside the existing seed-tier tests
- Verified locally: `make staticrequired`, the above Go tests, and the full `base_db_seed.bats`/`basic_database.bats` suites against a locally rebuilt `mariadb-11.8` dbserver image, plus manual end-to-end testing described above

None. Every new code path is reached only via the new `--uncompressed` flag, a file extension nobody has today, or the new `BASE_DB_UNCOMPRESSED` build arg — existing snapshots, restores, and images are unaffected.
The uncompressed-snapshot docs use these as plain prose (not in backtick
code spans), so the CI spellcheck job flagged them as unknown words.
@rfay
rfay force-pushed the 20260814_rfay_uncompressed_snapshot branch from 18ae6e1 to deccef7 Compare August 22, 2026 01:59
@rfay

rfay commented Aug 22, 2026

Copy link
Copy Markdown
Member Author

Here we go! Getting this one in in order to work on the final db one for this release.

@rfay
rfay merged commit a278400 into ddev:main Aug 22, 2026
56 checks passed
@rfay
rfay deleted the 20260814_rfay_uncompressed_snapshot branch August 22, 2026 14:34
rfay added a commit to rfay/ddev that referenced this pull request Aug 22, 2026
ddev#8705

Pulling upstream/main (which already carried ddev#8704's uncompressed-snapshot
support) left several call sites on this branch out of sync with the new
Snapshot()/RestoreSnapshot() signatures, plus two GetInitializerSnapshotFile()/
initializer-* references in base_db_seed_test.go that an earlier rename commit
on this branch had missed. Updates every stale call site and finishes that
rename; no behavior change.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
rfay added a commit to rfay/ddev that referenced this pull request Aug 25, 2026
…napshot restore`

## The Issue

Related to ddev#8623 ("Allow worktrees to share DB snapshots" by @tyler36): a
snapshot taken in one git worktree of a project isn't visible to
`ddev snapshot restore` in another worktree of the same repository, so
reusing a database across worktrees means manually copying snapshot
files around.

ddev#8623 predates the path-based snapshot restore/seed support that's
landed on `main` since it was opened (ddev#8704, ddev#8705), and its
`RestoreSnapshot(name, sourceRoot)` signature no longer matches
`RestoreSnapshot(name, force)` on `main` - it needs a rewrite on top of
current code either way. This is that rewrite, built directly on the
newer mechanism instead of duplicating it.

## How This PR Solves The Issue

`ddev snapshot restore` and `ddev snapshot restore --latest` already
support restoring from an arbitrary host path via `resolveSnapshotSource`.
This adds automatic discovery on top of that, rather than a parallel
restore mechanism:

- `DdevApp.ListSnapshotRestoreTargets()` lists the current project's own
  snapshots plus any snapshots found in the same project checked out in
  other worktrees of the same git repository (via `git worktree list`),
  newest first. A worktree match requires the same repository and the
  same relative project path - determined entirely from git and the
  filesystem, never from the `.ddev/config.yaml` project name (worktree
  projects don't usually share a name). A separate clone that happens to
  sit at the same relative path is not offered.
- `DdevApp.GetLatestSnapshotRestoreTarget()` extends `--latest` the same
  way.
- The interactive picker in `ddev snapshot restore` shows a worktree
  snapshot's name and source directory (`snapshot-name (worktree-dir)`);
  selecting one restores by its absolute path, reusing the existing
  path-based restore/bind-mount plumbing rather than a copy step.

I considered going further with a repository-agnostic shared snapshot
pool keyed by project name (so any two checkouts with the same name
could share snapshots, not just worktrees of one repo). I left that out:
project names collide too easily across unrelated projects, and a git
worktree relationship is a precise, verifiable identity check that a
name is not. The fully general case - "restore a snapshot from anywhere
on disk" - is already covered by the existing path argument.

## Manual Testing Instructions

1. Create a git repo and a worktree of it, each with a DDEV project at
   the same relative path (project names deliberately differ, since
   that's the normal case for worktrees):

   ```bash
   git init repo && cd repo && git commit --allow-empty -m init
   ddev config --project-type=php --project-name=repo-a
   ddev start
   ddev snapshot --name=shared-snapshot
   cd .. && git -C repo worktree add ../repo-b HEAD
   cd repo-b
   ddev config --project-type=php --project-name=repo-b
   ddev start
   ```

2. `ddev snapshot restore` in `repo-b` - the picker should list
   `shared-snapshot (repo)` alongside any of `repo-b`'s own snapshots.
   `ddev snapshot restore --latest` should restore it directly.
3. A separate `git clone` of `repo` at the same relative depth should
   *not* have its snapshots offered from `repo-b`.

## Automated Testing Overview

Covered in the following commit, along with a fix for a real bug found
while writing it.

## Release/Deployment Notes

No config or behavior changes for projects outside a git worktree.
Within a worktree, `ddev snapshot restore` and `--latest` now also see
snapshots from sibling worktrees of the same project; this is additive
and doesn't change what a bare snapshot name resolves to.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
rfay added a commit to rfay/ddev that referenced this pull request Aug 25, 2026
…napshot restore`

## The Issue

Related to ddev#8623 ("Allow worktrees to share DB snapshots" by @tyler36): a
snapshot taken in one git worktree of a project isn't visible to
`ddev snapshot restore` in another worktree of the same repository, so
reusing a database across worktrees means manually copying snapshot
files around.

ddev#8623 predates the path-based snapshot restore/seed support that's
landed on `main` since it was opened (ddev#8704, ddev#8705), and its
`RestoreSnapshot(name, sourceRoot)` signature no longer matches
`RestoreSnapshot(name, force)` on `main` - it needs a rewrite on top of
current code either way. This is that rewrite, built directly on the
newer mechanism instead of duplicating it.

## How This PR Solves The Issue

`ddev snapshot restore` and `ddev snapshot restore --latest` already
support restoring from an arbitrary host path via `resolveSnapshotSource`.
This adds automatic discovery on top of that, rather than a parallel
restore mechanism:

- `DdevApp.ListSnapshotRestoreTargets()` lists the current project's own
  snapshots plus any snapshots found in the same project checked out in
  other worktrees of the same git repository (via `git worktree list`),
  newest first. A worktree match requires the same repository and the
  same relative project path - determined entirely from git and the
  filesystem, never from the `.ddev/config.yaml` project name (worktree
  projects don't usually share a name). A separate clone that happens to
  sit at the same relative path is not offered.
- `DdevApp.GetLatestSnapshotRestoreTarget()` extends `--latest` the same
  way.
- The interactive picker in `ddev snapshot restore` shows a worktree
  snapshot's name and source directory (`snapshot-name (worktree-dir)`);
  selecting one restores by its absolute path, reusing the existing
  path-based restore/bind-mount plumbing rather than a copy step.

I considered going further with a repository-agnostic shared snapshot
pool keyed by project name (so any two checkouts with the same name
could share snapshots, not just worktrees of one repo). I left that out:
project names collide too easily across unrelated projects, and a git
worktree relationship is a precise, verifiable identity check that a
name is not. The fully general case - "restore a snapshot from anywhere
on disk" - is already covered by the existing path argument.

## Manual Testing Instructions

1. Create a git repo and a worktree of it, each with a DDEV project at
   the same relative path (project names deliberately differ, since
   that's the normal case for worktrees):

   ```bash
   git init repo && cd repo && git commit --allow-empty -m init
   ddev config --project-type=php --project-name=repo-a
   ddev start
   ddev snapshot --name=shared-snapshot
   cd .. && git -C repo worktree add ../repo-b HEAD
   cd repo-b
   ddev config --project-type=php --project-name=repo-b
   ddev start
   ```

2. `ddev snapshot restore` in `repo-b` - the picker should list
   `shared-snapshot (repo)` alongside any of `repo-b`'s own snapshots.
   `ddev snapshot restore --latest` should restore it directly.
3. A separate `git clone` of `repo` at the same relative depth should
   *not* have its snapshots offered from `repo-b`.

## Automated Testing Overview

Covered in the following commit, along with a fix for a real bug found
while writing it.

## Release/Deployment Notes

No config or behavior changes for projects outside a git worktree.
Within a worktree, `ddev snapshot restore` and `--latest` now also see
snapshots from sibling worktrees of the same project; this is additive
and doesn't change what a bare snapshot name resolves to.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
rfay added a commit to rfay/ddev that referenced this pull request Aug 27, 2026
…napshot restore`

## The Issue

Related to ddev#8623 ("Allow worktrees to share DB snapshots" by @tyler36): a
snapshot taken in one git worktree of a project isn't visible to
`ddev snapshot restore` in another worktree of the same repository, so
reusing a database across worktrees means manually copying snapshot
files around.

ddev#8623 predates the path-based snapshot restore/seed support that's
landed on `main` since it was opened (ddev#8704, ddev#8705), and its
`RestoreSnapshot(name, sourceRoot)` signature no longer matches
`RestoreSnapshot(name, force)` on `main` - it needs a rewrite on top of
current code either way. This is that rewrite, built directly on the
newer mechanism instead of duplicating it.

## How This PR Solves The Issue

`ddev snapshot restore` and `ddev snapshot restore --latest` already
support restoring from an arbitrary host path via `resolveSnapshotSource`.
This adds automatic discovery on top of that, rather than a parallel
restore mechanism:

- `DdevApp.ListSnapshotRestoreTargets()` lists the current project's own
  snapshots plus any snapshots found in the same project checked out in
  other worktrees of the same git repository (via `git worktree list`),
  newest first. A worktree match requires the same repository and the
  same relative project path - determined entirely from git and the
  filesystem, never from the `.ddev/config.yaml` project name (worktree
  projects don't usually share a name). A separate clone that happens to
  sit at the same relative path is not offered.
- `DdevApp.GetLatestSnapshotRestoreTarget()` extends `--latest` the same
  way.
- The interactive picker in `ddev snapshot restore` shows a worktree
  snapshot's name and source directory (`snapshot-name (worktree-dir)`);
  selecting one restores by its absolute path, reusing the existing
  path-based restore/bind-mount plumbing rather than a copy step.

I considered going further with a repository-agnostic shared snapshot
pool keyed by project name (so any two checkouts with the same name
could share snapshots, not just worktrees of one repo). I left that out:
project names collide too easily across unrelated projects, and a git
worktree relationship is a precise, verifiable identity check that a
name is not. The fully general case - "restore a snapshot from anywhere
on disk" - is already covered by the existing path argument.

## Manual Testing Instructions

1. Create a git repo and a worktree of it, each with a DDEV project at
   the same relative path (project names deliberately differ, since
   that's the normal case for worktrees):

   ```bash
   git init repo && cd repo && git commit --allow-empty -m init
   ddev config --project-type=php --project-name=repo-a
   ddev start
   ddev snapshot --name=shared-snapshot
   cd .. && git -C repo worktree add ../repo-b HEAD
   cd repo-b
   ddev config --project-type=php --project-name=repo-b
   ddev start
   ```

2. `ddev snapshot restore` in `repo-b` - the picker should list
   `shared-snapshot (repo)` alongside any of `repo-b`'s own snapshots.
   `ddev snapshot restore --latest` should restore it directly.
3. A separate `git clone` of `repo` at the same relative depth should
   *not* have its snapshots offered from `repo-b`.

## Automated Testing Overview

Covered in the following commit, along with a fix for a real bug found
while writing it.

## Release/Deployment Notes

No config or behavior changes for projects outside a git worktree.
Within a worktree, `ddev snapshot restore` and `--latest` now also see
snapshots from sibling worktrees of the same project; this is additive
and doesn't change what a bare snapshot name resolves to.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
stasadev added a commit to stasadev/ddev that referenced this pull request Oct 7, 2026
…hand

## Short Summary (TL;DR)

The all-project-types job is the only CI job that runs tests with `GOTEST_SHORT` unset, and it ran a hand-kept list that had fallen behind, so 16 tests that skip or shrink under `GOTEST_SHORT` never ran in full anywhere. The list is now generated from the tests themselves, so it can't fall behind again.

## The Issue

Found while working on ddev#7904, which changes `TestDebugRebuildCmd`: CI logs show `--- SKIP: TestDebugRebuildCmd` in every job, because Buildkite and `test-reusable.yml` set `GOTEST_SHORT=16` and apache-fpm sets `5`.

The list came from ddev#6693 and broke in three ways:

- ddev#7027 renamed `TestComposerCreateCmd` to `TestComposerCreateProjectCmd`, so that entry has matched nothing since.
- ddev#8028 added `GOTEST_SHORT` skips to `TestDebugRebuildCmd`, `TestDdevImportDB`, `TestDdevRestoreSnapshot`, `TestProcessHooks`, and `TestWebserverMariaMySQLDBClient`, and later PRs did the same for `TestEphemeralPortsReusedOnRestart` (ddev#7992), `TestRouterPortSubstitutionPersistsAcrossProjects` (ddev#8653), `TestSnapshotUncompressed` (ddev#8704), `TestDebugDeleteVolumeCmd` (ddev#8756), and `TestDdevExportDB` (ddev#8798), none of them updating the list.
- `TestComposerVersionConfig`, `TestHttpsRedirection`, `TestMysqlCommand`, `TestDdevStartMultipleHostnames`, and `TestProjectAutocompletionForExecCmd` already did less under `GOTEST_SHORT` when ddev#6693 wrote the list, and weren't on it.

## How This PR Solves The Issue

Tests use three `testcommon` helpers instead of reading `GOTEST_SHORT`: `SkipIfGotestShort(t)`, `IsGotestShort(t)`, and `UsesAllTestSites(t)`, a marker for tests that loop over every test site. `.github/workflows/all-project-types-tests.sh` finds the tests that call them and prints the `-run` pattern, and fails if a test other than `TestMain` reads `GOTEST_SHORT` itself.

The pattern is anchored, so prefix matches such as every `TestCmdStart*` test or `TestAutocompleteServiceForServiceFlag` no longer ride along; like `TestAppdirAlreadyInUse` and `TestConfigValidate`, which also leave the list, they don't depend on `GOTEST_SHORT` and run in every job. The `GOTEST_SHORT` branches that ddev#8028 made unreachable in `TestComposerCreateProjectCmd` and `TestDdevAllDatabases` are removed.

## Manual Testing Instructions

```bash
.github/workflows/all-project-types-tests.sh
# Expect ^(TestAutocompletionForDescribeCmd|...|TestWriteDrushConfig)\b with the 42 tests below
```

Adding `if os.Getenv("GOTEST_SHORT") != "" { t.Skip() }` to any test makes the script print that file and line and exit non-zero.

## Automated Testing Overview

In the all-project-types job, the "Compute TESTARGS" step of `prepare-testargs` should print a `-run '^(...)\b'` pattern with exactly these 42 tests, and the test log should show each of them running, none skipped because of `GOTEST_SHORT`:

```text
TestAutocompletionForDescribeCmd TestAutocompletionForStartCmd TestAutocompletionForStopCmd
TestAvailableUpdates TestCmdDescribe TestCmdDescribeAppFunction TestCmdDescribeAppUsingSitename
TestCmdList TestCmdStart TestCmdStop TestComposerCreateProjectCmd TestComposerVersionConfig
TestConfigDatabaseVersion TestDdevAllDatabases TestDdevExportDB TestDdevFullSiteSetup
TestDdevImportDB TestDdevImportFiles TestDdevImportFilesCustomUploadDir TestDdevImportFilesDir
TestDdevRestoreSnapshot TestDdevStartMultipleHostnames TestDdevUploadDirNoPackage
TestDdevXdebugEnabled TestDdevXhprofPrependEnabled TestDdevXhprofXhguiEnabled
TestDebugDeleteVolumeCmd TestDebugRebuildCmd TestEphemeralPortsReusedOnRestart TestGetApps
TestGetAppsEmpty TestHardenedStart TestHttpsRedirection TestMysqlCommand TestPHPConfig
TestPHPWebserverType TestProcessHooks TestProjectAutocompletionForExecCmd
TestRouterPortSubstitutionPersistsAcrossProjects TestSnapshotUncompressed
TestWebserverMariaMySQLDBClient TestWriteDrushConfig
```

Some of the 16 tests that never ran in full may fail after being skipped this long; this PR's run is where that should show up.

🤖 Developed with assistance from [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
stasadev added a commit to stasadev/ddev that referenced this pull request Oct 8, 2026
…hand

## Short Summary (TL;DR)

The all-project-types job is the only CI job that runs tests with `GOTEST_SHORT` unset, and it ran a hand-kept list that had fallen behind, so 16 tests that skip or shrink under `GOTEST_SHORT` never ran in full anywhere. The list is now generated from the tests themselves, so it can't fall behind again.

## The Issue

Found while working on ddev#7904, which changes `TestDebugRebuildCmd`: CI logs show `--- SKIP: TestDebugRebuildCmd` in every job, because Buildkite and `test-reusable.yml` set `GOTEST_SHORT=16` and apache-fpm sets `5`.

The list came from ddev#6693 and broke in three ways:

- ddev#7027 renamed `TestComposerCreateCmd` to `TestComposerCreateProjectCmd`, so that entry has matched nothing since.
- ddev#8028 added `GOTEST_SHORT` skips to `TestDebugRebuildCmd`, `TestDdevImportDB`, `TestDdevRestoreSnapshot`, `TestProcessHooks`, and `TestWebserverMariaMySQLDBClient`, and later PRs did the same for `TestEphemeralPortsReusedOnRestart` (ddev#7992), `TestRouterPortSubstitutionPersistsAcrossProjects` (ddev#8653), `TestSnapshotUncompressed` (ddev#8704), `TestDebugDeleteVolumeCmd` (ddev#8756), and `TestDdevExportDB` (ddev#8798), none of them updating the list.
- `TestComposerVersionConfig`, `TestHttpsRedirection`, `TestMysqlCommand`, `TestDdevStartMultipleHostnames`, and `TestProjectAutocompletionForExecCmd` already did less under `GOTEST_SHORT` when ddev#6693 wrote the list, and weren't on it.

## How This PR Solves The Issue

Tests use three `testcommon` helpers instead of reading `GOTEST_SHORT`: `SkipIfGotestShort(t)`, `IsGotestShort(t)`, and `UsesAllTestSites(t)`, a marker for tests that loop over every test site. `.github/workflows/all-project-types-tests.sh` finds the tests that call them and prints the `-run` pattern, and fails if a test other than `TestMain` reads `GOTEST_SHORT` itself.

The pattern is anchored, so prefix matches such as every `TestCmdStart*` test or `TestAutocompleteServiceForServiceFlag` no longer ride along; like `TestAppdirAlreadyInUse` and `TestConfigValidate`, which also leave the list, they don't depend on `GOTEST_SHORT` and run in every job. The `GOTEST_SHORT` branches that ddev#8028 made unreachable in `TestComposerCreateProjectCmd` and `TestDdevAllDatabases` are removed.

## Manual Testing Instructions

```bash
.github/workflows/all-project-types-tests.sh
# Expect ^(TestAutocompletionForDescribeCmd|...|TestWriteDrushConfig)\b with the 42 tests below
```

Adding `if os.Getenv("GOTEST_SHORT") != "" { t.Skip() }` to any test makes the script print that file and line and exit non-zero.

## Automated Testing Overview

In the all-project-types job, the "Compute TESTARGS" step of `prepare-testargs` should print a `-run '^(...)\b'` pattern with exactly these 42 tests, and the test log should show each of them running, none skipped because of `GOTEST_SHORT`:

```text
TestAutocompletionForDescribeCmd TestAutocompletionForStartCmd TestAutocompletionForStopCmd
TestAvailableUpdates TestCmdDescribe TestCmdDescribeAppFunction TestCmdDescribeAppUsingSitename
TestCmdList TestCmdStart TestCmdStop TestComposerCreateProjectCmd TestComposerVersionConfig
TestConfigDatabaseVersion TestDdevAllDatabases TestDdevExportDB TestDdevFullSiteSetup
TestDdevImportDB TestDdevImportFiles TestDdevImportFilesCustomUploadDir TestDdevImportFilesDir
TestDdevRestoreSnapshot TestDdevStartMultipleHostnames TestDdevUploadDirNoPackage
TestDdevXdebugEnabled TestDdevXhprofPrependEnabled TestDdevXhprofXhguiEnabled
TestDebugDeleteVolumeCmd TestDebugRebuildCmd TestEphemeralPortsReusedOnRestart TestGetApps
TestGetAppsEmpty TestHardenedStart TestHttpsRedirection TestMysqlCommand TestPHPConfig
TestPHPWebserverType TestProcessHooks TestProjectAutocompletionForExecCmd
TestRouterPortSubstitutionPersistsAcrossProjects TestSnapshotUncompressed
TestWebserverMariaMySQLDBClient TestWriteDrushConfig
```

Some of the 16 tests that never ran in full may fail after being skipped this long; this PR's run is where that should show up.

🤖 Developed with assistance from [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support uncompressed snapshots in ddev snapshot, snapshot restore, start, and the bundled base_db image

1 participant