Skip to content

fix: run all-project-types in full and fix the bugs it found (#8903) [skip ci] - #8903

Merged
rfay merged 7 commits into
ddev:mainfrom
stasadev:20261006_stasadev_all_project_types_tests
Oct 8, 2026
Merged

rfay merged 7 commits into
ddev:mainfrom
stasadev:20261006_stasadev_all_project_types_tests

Conversation

@stasadev

@stasadev stasadev commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

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, and the job is split into two halves because running the full list took it from about 115 to over 160 minutes.

Running that list in full turned up three bugs, all fixed here too: for webserver_type: generic, DDEV reported a direct HTTPS URL (https://127.0.0.1:<port>) on a port that only speaks plain HTTP; on main since #8828, Backdrop project builds failed with 403 once the GitHub API's limit for unauthenticated requests ran out; and since #8234, ddev composer create-project dropped flags such as --no-dev and -vvv from the Composer scripts it runs after creating the project.

The Issue

Found while working on #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 #6693 and broke in three ways:

The first full run of the new list failed in TestDdevStartMultipleHostnames, which had never run against every test site in CI, on four sites:

  • sveltekit and nodejs: the direct HTTPS URL answered http: server gave HTTP response to HTTPS client. fix: replace broken http and https port lookup, fixes #7246 #7259 (fixing ddev share uses web_extra_exposed_ports instead of main http port #7246) made GetWebContainerDirectHTTPPort fall back to the published web_extra_exposed_ports container port for generic projects, because a generic web container doesn't publish port 80; sveltekit's TestDdevFullSiteSetup needed that. It added the same fallback to GetWebContainerDirectHTTPSPort, but the router always reaches a container_port over plain HTTP and terminates TLS itself, so the "HTTPS" port it returned was the same HTTP port. ddev describe (host_https_url) and GetAllURLs have listed that broken URL since then. TestGetWebContainerDirectURLsWithGenericWebserver didn't catch it because it only checked the URL's format.
  • typo3: its static test file comes from the files tarball, which this test never imported, so it only passed when an earlier test had imported files for the first site.
  • silverstripe: it had no static test URL, so the test requested /, which redirects to /dev/build until a database is imported.

The second run failed every test that starts the Backdrop site, because the web image build got 403 from api.github.com. Since #8828 moved the Backdrop Drush extension install from the shared web image into each Backdrop project's build, every build asks the API for the extension's latest tag without a token. Runners share IPs and the image's .curlrc retries each request five times, so the limit of 60 unauthenticated requests per hour runs out. The first Backdrop build in that job already failed, so the IP had used up its limit before the job began.

The third run failed TestComposerCreateProjectCmd: ddev composer create-project ... --no-dev ran composer run-script post-root-package-install without --no-dev. isValidComposerOption decides which flags to pass on by running each one with --dry-run and reading Composer's error through util.CaptureUserOut(), but since #8234 moved app.Exec to the docker-compose library, Exec returns the output instead of printing it, so the capture was always empty. Every flag was then rejected for run-script, and no unknown flag was ever rejected for create-project. That run also took 162 minutes, against about 115 for the job on main, and TestComposerCreateProjectCmd alone would have added about 26 minutes once passing, since it ran the same four commands for every project type.

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 #8028 made unreachable in TestComposerCreateProjectCmd and TestDdevAllDatabases are removed.

The job is now two, like podman-rootless. The script takes pkg or cmd and prints one half: all-project-types-pkg runs the tests under pkg/ with make testpkg, and all-project-types-cmd runs the tests under cmd/ plus TestDdevAllDatabases and TestHttpsRedirection (about 40 and 13 minutes) with make test, which evens them out at about 68 minutes of tests each by the last run's timings. The halves are complements of each other, so a new test can make them uneven but can't fall out of both. TestComposerCreateProjectCmd now runs for php and drupal only, which cover its four commands, since they only vary by docroot and by php versus any other type; the quickstart tests already run ddev composer create-project with real packages for each project type.

isValidComposerOption reads the stderr that app.Exec returns, where Composer prints the option does not exist error.

GetWebContainerDirectHTTPSPort drops the web_extra_exposed_ports fallback and only returns a published port 443, as it did before #7259, so a generic project without one has no direct HTTPS URL instead of a broken one. The FrankenPHP add-on, which does serve HTTPS in the container, publishes 443 itself and is unaffected. The HTTP fallback stays. TestGetWebContainerDirectURLsWithGenericWebserver now requests every URL GetAllURLs reports and expects each to serve a test file; against the old code it fails on the direct HTTPS URL with EOF.

TestDdevStartMultipleHostnames imports the files tarball before checking URLs, as TestConfigValidate already does, except for sites without upload_dirs: the php test site has a tarball, but its static test file comes from the source, and a type: php project has nowhere to import files. Also, silverstripe gets a static test URL from its source, /_resources/themes/startup-theme/css/breadcrumbs.css.

The Backdrop Drush extension download is pinned to 1.4.1 on the renamed backdrop-contrib/backdrop-drush-extension repo, so the build no longer calls the API. 1.4.1 is what the lookup returned anyway, and it's the release that deprecated the extension in favor of Bee, so there's no newer version to track.

SkipIfGotestShort runs the test anyway when DDEV_RUN_TEST_ANYWAY=true, matching how other tests use that variable. .claude/settings.json presets it, along with the opt-in switches CI sets (DDEV_RUN_DOWNLOAD_DDEV_TEST, DDEV_TEST_SHARE_CMD, DDEV_TEST_OUTSIDE_HOME), so Claude Code can run any test locally against a single site.

Manual Testing Instructions

.github/workflows/all-project-types-tests.sh
# Expect ^(TestAutocompletionForDescribeCmd|...|TestWriteDrushConfig)\b with the 42 tests below
.github/workflows/all-project-types-tests.sh pkg
.github/workflows/all-project-types-tests.sh cmd
# Expect the 25 and 17 tests listed below, which together are the same 42

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

For the direct HTTPS URL, use the generic PHP server from the quickstart:

ddev utility download-ddev --pr 8903
export PATH="$HOME/tmp/ddev-download-ddev/pr-8903:$PATH"
mkdir ~/tmp/generic-https && cd ~/tmp/generic-https
ddev config --project-type=php
echo "<?php phpinfo(); ?>" > index.php
cat <<'EOF' > .ddev/config.php-server.yaml
webserver_type: generic
web_extra_daemons:
    - name: "php-server"
      command: "php -S 0.0.0.0:8000 -t \"${DDEV_DOCROOT:-.}\""
      directory: /var/www/html
web_extra_exposed_ports:
    - name: "php-server"
      container_port: 8000
      http_port: 80
      https_port: 443
EOF
ddev start -y
ddev describe -j | jq -r '.raw.services.web.host_https_url, .raw.services.web.host_http_url'
# Expect an empty first line and a working http://127.0.0.1:<port> second line.
# With the released DDEV, the first line is https://127.0.0.1:<same port>, and
# curl -k on it fails because the port only speaks HTTP.

For the Composer flags, with the same binary on PATH:

mkdir ~/tmp/create-no-dev && cd ~/tmp/create-no-dev
ddev config --project-type=php
ddev composer create-project ddev/ddev-test-composer-create --no-dev . v1.0.0
# Expect "Executing Composer command: [composer run-script post-root-package-install --no-dev]"
# and the same --no-dev on post-create-project-cmd. The released DDEV leaves --no-dev off both.

Automated Testing Overview

Please recheck the CI run of this PR on these points:

  • The "Compute TESTARGS" step of prepare-testargs prints testargs_pkg and testargs_cmd, two -run '^(...)\b' patterns that together contain exactly the 42 tests below.
  • Each test runs in its half's log, and none is skipped: search both logs for --- SKIP, which should only show subtests skipped for reasons other than GOTEST_SHORT.
  • all-project-types-pkg and all-project-types-cmd take about the same time, each roughly 80 minutes including setup, instead of 162 minutes for the single job. If one half takes much longer, move a test between them with MOVE_TO_CMD in the script.

all-project-types-pkg, 25 tests:

TestAvailableUpdates TestComposerVersionConfig TestDdevExportDB TestDdevFullSiteSetup
TestDdevImportDB TestDdevImportFiles TestDdevImportFilesCustomUploadDir TestDdevImportFilesDir
TestDdevRestoreSnapshot TestDdevStartMultipleHostnames TestDdevUploadDirNoPackage
TestDdevXdebugEnabled TestDdevXhprofPrependEnabled TestDdevXhprofXhguiEnabled
TestEphemeralPortsReusedOnRestart TestGetApps TestGetAppsEmpty TestHardenedStart TestPHPConfig
TestPHPWebserverType TestProcessHooks TestRouterPortSubstitutionPersistsAcrossProjects
TestSnapshotUncompressed TestWebserverMariaMySQLDBClient TestWriteDrushConfig

all-project-types-cmd, 17 tests:

TestAutocompletionForDescribeCmd TestAutocompletionForStartCmd TestAutocompletionForStopCmd
TestCmdDescribe TestCmdDescribeAppFunction TestCmdDescribeAppUsingSitename TestCmdList TestCmdStart
TestCmdStop TestComposerCreateProjectCmd TestConfigDatabaseVersion TestDdevAllDatabases
TestDebugDeleteVolumeCmd TestDebugRebuildCmd TestHttpsRedirection TestMysqlCommand
TestProjectAutocompletionForExecCmd

TestDdevStartMultipleHostnames was the only failure in the first run; it passes locally against typo3, silverstripe, sveltekit, nodejs, and php, and TestGetWebContainerDirectURLsWithGenericWebserver runs in every job. The second run's failures were all the Backdrop 403; TestWriteDrushConfig passes locally against Backdrop with the pinned download. TestComposerCreateProjectCmd was the only failure in the third run, and it passes locally for php and drupal.

Release/Deployment Notes

For webserver_type: generic projects that don't publish port 443 themselves, ddev describe no longer shows a direct HTTPS URL (host_https_url). The one it showed before never worked.

ddev composer create-project again passes flags such as --no-dev and -vvv on to the post-root-package-install and post-create-project-cmd scripts it runs.

🤖 Developed with assistance from Claude Code

Co-Authored-By: Claude Opus 5.5 [email protected]

@stasadev
stasadev requested a review from a team as a code owner October 6, 2026 19:51
@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Download this PR's build for your OS and architecture with:

ddev utility download-ddev --pr 8903

Or download the artifact for your OS and architecture directly:

See Testing a PR.

Open in GitHub Codespaces

@stasadev

stasadev commented Oct 6, 2026

Copy link
Copy Markdown
Member Author

Moving it to draft, I forgot about DDEV_RUN_TEST_ANYWAY, which should work here too, and Claude should be able to run any test locally.

@stasadev
stasadev marked this pull request as draft October 6, 2026 21:23
@stasadev

stasadev commented Oct 6, 2026

Copy link
Copy Markdown
Member Author

https://github.com/ddev/ddev/actions/runs/37521992844/job/112469608265?pr=8903#step:13:47

TESTARGS=-run '^(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)\b'

This part looks good.

stasadev added a commit to stasadev/ddev that referenced this pull request Oct 6, 2026
## Short Summary (TL;DR)

`ddev restart -s solr,redis` gives just those services new containers with the current configuration and leaves the rest of the project running, so an unhealthy or crashed service comes back without a full restart. `ddev restart --profiles=x` replaces `ddev restart && ddev start --profiles=x`. `ddev utility rebuild -s` also takes several services now.

## The Issue

- Fixes ddev#7904

Restarting one service meant remembering `ddev utility rebuild -s <service> --cache`, and an add-on with a profile needed `ddev restart && ddev start --profiles=<profile>`.

## How This PR Solves The Issue

`--service` re-renders the compose files, then recreates the named services in one compose `Up`, as `ddev utility rebuild -s` has done since ddev#8463, so edits to `.ddev/docker-compose.*.yaml` apply. A new container also avoids the healthcheck delay the issue mentions. A named service has to have a container, so an unhealthy or crashed service is replaced like any other. Starting a service that has none is left to `ddev start --profiles` and `ddev xhgui on`, because they also run setup some services need, such as the database xhgui uses, and the error names the command to run. A `depends_on` service keeps its container, so naming a service that depends on `web` doesn't touch `web`. Like `ddev start`, it builds their images first, so Dockerfile edits apply too, and `--no-cache` builds them without the cache. Also like `ddev start`, it refuses to recreate `db` when `config.yaml` names a different database type or version than the volume holds, before building anything, instead of running the new image against the old data. Naming `web` restarts the whole project, since `ddev start` sets up more than its container, and starts the profiles of the services that were started, so xhgui or another optional service survives it. Plain `ddev restart` still drops them, as before. `--service` can't be combined with `--all`, `--profiles`, `--reset-database`, or `--seed-snapshot`.

`--profiles` is passed to `RestartWith()`, which ddev#8820 prepared for it.

`ddev utility rebuild --service` takes a comma-separated list too, and both commands share the new `RecreateServices()`. Rebuild still recreates only the services that have a container, and with `web` named it keeps the optional services that were started, as `ddev restart -s web` does.

## Manual Testing Instructions

Set up a project with a profile service that has a `build:` and a dependency with a healthcheck in the same profile:

```bash
ddev utility download-ddev --pr 8906
export PATH="$HOME/tmp/ddev-download-ddev/pr-8906:$PATH"
mkdir -p ~/tmp/restart-7904 && cd ~/tmp/restart-7904
ddev config --project-type=php
cat > .ddev/docker-compose.busybox.yaml <<'EOF'
services:
  busybox1:
    build:
      context: .
      dockerfile_inline: |
        FROM busybox:stable
        RUN cat /proc/sys/kernel/random/uuid > /built
        ENV RESTART_BUILT=first
    init: true
    command: tail -f /dev/null
    environment:
      - RESTART_TEST=first
    depends_on:
      - busybox2
    profiles:
      - busybox
    container_name: ddev-${DDEV_SITENAME}-busybox1
  busybox2:
    image: busybox:stable
    init: true
    command: sh -c 'touch /tmp/healthy && exec tail -f /dev/null'
    healthcheck:
      test: test -f /tmp/healthy
      interval: 1s
      retries: 1
    profiles:
      - busybox
    container_name: ddev-${DDEV_SITENAME}-busybox2
EOF
containers() { docker ps --filter label=com.ddev.site-name=restart-7904 --format '{{.Names}} {{.ID}}' | sort; }
busybox1() { docker exec ddev-restart-7904-busybox1 sh -c 'echo "$RESTART_TEST $RESTART_BUILT $(cat /built)"'; }
ddev start
containers
```

A profile service, before and after its profile is started:

```bash
ddev restart -s busybox1
# Expect "service busybox1 is not running, use 'ddev start --profiles=busybox' to start it"
ddev start --profiles=busybox
containers
ddev restart -s busybox1
containers
# Expect only busybox1 to get a new ID
busybox1
# Expect "first first <uuid>"
```

Compose file and Dockerfile edits, and `--no-cache`:

```bash
sed -i 's/=first/=second/' .ddev/docker-compose.busybox.yaml
ddev restart -s busybox1
busybox1
# Expect "second second" and the same uuid: the image was rebuilt from the cache
ddev restart -s busybox1 --no-cache
busybox1
# Expect "second second" and a new uuid: the image was rebuilt without the cache
```

`--profiles`:

```bash
ddev restart
containers
# Expect only web and db
ddev restart --profiles=busybox --no-cache
# Expect "Started optional compose profiles 'busybox'"
busybox1
# Expect a new uuid
```

Several services, including a built-in profile, and `ddev utility rebuild`:

```bash
ddev restart -s xhgui
# Expect "service xhgui is not running, use 'ddev xhgui on' to start it"
ddev xhgui on
ddev restart -s xhgui,db
# Expect "Waiting for containers to become ready: [xhgui db]" and "Restarted xhgui, db in restart-7904"
ddev utility rebuild --cache -s db,xhgui
# Expect "Recreated db, xhgui for restart-7904"
```

An unhealthy service and a crashed one:

```bash
ddev exec -s busybox2 rm /tmp/healthy
sleep 2
docker inspect --format '{{.State.Health.Status}}' ddev-restart-7904-busybox2
# Expect "unhealthy"
ddev restart -s busybox2
docker inspect --format '{{.State.Health.Status}}' ddev-restart-7904-busybox2
# Expect "healthy"
docker kill ddev-restart-7904-db
ddev restart -s db
# Expect "Restarted db in restart-7904"
```

`web`, rejected flags, and a stopped project:

```bash
ddev restart -s web
# Expect "web can't restart on its own, restarting the whole project..."
containers
# Expect every container to have a new ID, xhgui, busybox1, and busybox2 included
ddev restart -s db --profiles=busybox
# Expect "if any flags in the group [service profiles] are set none of the others can be"
ddev stop
ddev restart -s db
# Expect "service db is not running, use 'ddev start' to start it"
```

## Automated Testing Overview

- `TestRestartServices` covers restarting `db` alone and `db` with a profile service together, replacing an exited `db`, refusing a profile service that wasn't started or a `db` that doesn't match its volume, leaving its dependency's container alone, applying a compose file and Dockerfile edit, rebuilding a `build:` service's cached layers only with `NoCache`, an unknown service, and the full restart for `web` keeping the running profile services running.
- `TestCmdRestartProfilesAndServices` runs `ddev restart --profiles` and `ddev restart -s db,busybox1`, checks that `--service` with `--profiles` is rejected, and checks that `-s db,<TAB>` completes the next service that has a container.
- `TestDebugRebuildCmd` rebuilds `--service=db,xhgui`. It skips under `GOTEST_SHORT`, so CI runs it in the all-project-types job once ddev#8903 is merged. It passes locally with the skip removed.

## Release/Deployment Notes

- `DdevApp.RecreateServices()`, `DdevApp.RestartServices()`, and `DdevApp.RestartKeepingProfiles()` are new in the Go API.
- `ddev utility rebuild -s web` keeps the optional services that were started instead of stopping them.
- `ddev utility rebuild` prints `Recreated <services> for <project>` instead of `Recreated <service> service for <project>`.
- `ddev utility rebuild -s` now starts a dependency of the rebuilt service if it isn't running, instead of ignoring it.
- `ddev utility rebuild -s db` refuses to recreate `db` when its configured type or version doesn't match the database volume, as `ddev start` does.

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

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@stasadev
stasadev force-pushed the 20261006_stasadev_all_project_types_tests branch from c9ec1e2 to 0d2a095 Compare October 7, 2026 09:07
@stasadev stasadev changed the title ci: find the tests all-project-types runs instead of listing them by hand fix: drop broken direct HTTPS URL for generic webserver, generate all-project-types test list Oct 7, 2026

@rfay rfay left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great initiative!

@rfay

rfay commented Oct 7, 2026

Copy link
Copy Markdown
Member

I'm having trouble now remembering all the ways we skip or don't skip tests. Maybe I'll figure out a way to solve that. The naming doesn't seem obvious.

stasadev and others added 7 commits October 8, 2026 08:50
…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]>
…t HTTPS URL

TestDdevStartMultipleHostnames failed in the all-project-types job on four sites, each for a different reason:

- sveltekit and nodejs: for `webserver_type: generic`, GetWebContainerDirectHTTPSPort fell back to the published `web_extra_exposed_ports` container port. The router reaches that port over plain HTTP, so `ddev describe` and GetAllURLs listed an `https://127.0.0.1:<port>` URL that answers with HTTP. The fallback was added in ddev#7259 alongside the HTTP one, which was the fallback that PR needed; the FrankenPHP add-on publishes 443 itself and never reached it. TestGetWebContainerDirectURLsWithGenericWebserver only checked the format of that URL, so it now requests every URL GetAllURLs reports; against the old code the direct HTTPS URL fails with EOF.
- typo3: its static test file comes from the files tarball, which the test never imported, so it only passed when an earlier test had imported files for the first site.
- silverstripe: it had no static test URL, so the test requested `/`, which redirects to `/dev/build` until a database is imported. It now uses a theme stylesheet that ships with the source.

SkipIfGotestShort now runs the test anyway when DDEV_RUN_TEST_ANYWAY=true, and `.claude/settings.json` presets that and the opt-in test switches CI sets, so Claude Code can run any test locally against a single site.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…t tag on the GitHub API

Since ddev#8828 moved the extension install from the shared web image into each Backdrop project's build, every build asked `api.github.com` for the latest tag without a token. Runners share IPs and the image's `.curlrc` retries each request five times, so the 60-requests-per-hour limit for unauthenticated calls ran out and the all-project-types job failed every Backdrop build with 403.

The download now uses a fixed 1.4.1 link on the renamed `backdrop-contrib/backdrop-drush-extension` repo. 1.4.1 is the release that deprecated the extension in favor of Bee, so no newer version is coming to track.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…es without upload_dirs

The files-tarball import added for TYPO3 failed on TestPkgPHP, which has a tarball but, as type php, no upload_dirs, so ImportFiles returned "upload_dirs is not set". Its static test file comes from the source repo, so the import is not needed there.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Since ddev#8234 moved app.Exec to the docker-compose library, Exec returns the command's output instead of writing it to UserOut, so the CaptureUserOut in isValidComposerOption always read an empty string. Every option then failed validation for `run-script`, which dropped `--no-dev` and `-vvv` from the post-root-package-install and post-create-project-cmd runs, and no unknown option was ever rejected for `create-project`. It now reads the stderr that Exec returns, where Composer prints the "option does not exist" error.

TestComposerCreateProjectCmd caught this in the all-project-types job, which hadn't run it since ddev#7027 renamed it in March 2025.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Running the 16 tests that never ran in full took the job from about 115 minutes to over 160. The job is now two, like podman-rootless:

- all-project-types-pkg runs the tests under pkg/ with `make testpkg`.
- all-project-types-cmd runs the tests under cmd/ plus TestDdevAllDatabases and TestHttpsRedirection, with `make test` since those two are in pkg/ddevapp.

From the last run's timings each half has about 68 minutes of tests. all-project-types-tests.sh takes `pkg` or `cmd` and prints that half's pattern; the halves are complements of each other, so a new test can make them uneven but can't fall out of both.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
It ran the same four commands for every project type, which took about 26 minutes in CI, but the commands only vary by docroot and by php versus any other type. php and drupal, the alias for the latest stable Drupal, cover all four, and drupal keeps the composer_root-equals-docroot case. The quickstart tests already run `ddev composer create-project` with real packages for each project type.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@stasadev
stasadev force-pushed the 20261006_stasadev_all_project_types_tests branch from ebdfd68 to 552782b Compare October 8, 2026 06:15
@stasadev stasadev changed the title fix: drop broken direct HTTPS URL for generic webserver, generate all-project-types test list fix: run all-project-types in full and fix the bugs it found Oct 8, 2026
@stasadev
stasadev marked this pull request as ready for review October 8, 2026 08:57
@rfay

rfay commented Oct 8, 2026

Copy link
Copy Markdown
Member

GOTEST_SHORT is a pretty old and pretty lame concept (and overused too many ways). Maybe we should retire it with something that is named better and focused better?

@stasadev

stasadev commented Oct 8, 2026

Copy link
Copy Markdown
Member Author

GOTEST_SHORT is a pretty old and pretty lame concept (and overused too many ways). Maybe we should retire it with something that is named better and focused better?

I agree, let's continue in:

This PR already grew more than I expected from fixing all these tests.

@rfay

rfay commented Oct 8, 2026

Copy link
Copy Markdown
Member

Nice! I didn't remember that issue :)

@rfay

rfay commented Oct 8, 2026

Copy link
Copy Markdown
Member

If you want, this stuff can be pulled as an interim solution to the basic problem though.

@stasadev

stasadev commented Oct 8, 2026 •

Copy link
Copy Markdown
Member Author

If you want, this stuff can be pulled as an interim solution to the basic problem though.

Yes, let's merge it.

I'm not happy with SkipIfGotestShort(t), IsGotestShort(t), and UsesAllTestSites(t) either. They're only here so the script can find these tests, and UsesAllTestSites doesn't even do anything.

Ideally, I would like to have one function with a clear name that takes the conditions a test skips on.

@rfay rfay changed the title fix: run all-project-types in full and fix the bugs it found fix: run all-project-types in full and fix the bugs it found (#8903) [skip ci] Oct 8, 2026
@rfay
rfay merged commit 5fdde42 into ddev:main Oct 8, 2026
52 checks passed
@rfay
rfay deleted the 20261006_stasadev_all_project_types_tests branch October 8, 2026 16:45
rfay added a commit to rfay/ddev that referenced this pull request Oct 30, 2026
…after alias updates

## Short Summary (TL;DR)

After DDEV reconnects `ddev-router` to update its aliases, Docker Desktop on macOS can forward a router port to a stale target, so requests get `connection reset by peer`. DDEV now warns about it, and `TestGetWebContainerDirectURLsWithGenericWebserver` logs better diagnostics and tolerates the delay on Docker Desktop.

## The Issue

`TestGetWebContainerDirectURLsWithGenericWebserver` failed 15 times on `ddev-macos-arm64-mutagen` since 2026-10-08, counting retried jobs. That is about 7% of test jobs. Every failure came right after `Updating router network aliases in place`. Traefik had the route, but `127.0.0.1:443` or `:80` reset the connection and was still resetting 5s later.

The reset is a long-standing Docker Desktop problem. ddev#8627 skipped about 18 tests for it. This test started requesting router URLs in ddev#8903, after that skip.

`warnUnreachableRouterPorts` could not see it: it only looked for refused connections, and it only ran when the router was recreated.

## How This PR Solves The Issue

- `netutil.IsPortUnreachable` (formerly `IsPortRefused`) sends a minimal HTTP request. A refused connection, or one that closes or resets before any response, counts as unreachable.
- `warnUnreachableRouterPorts` also runs after the in-place alias update.
- `logRouterDiagnostics` logs the router's published ports and curls the URL from containers on `ddev_default` and the host network. It then polls the URL for up to 60s and logs how long recovery takes.
- On Docker Desktop, the test passes when the URL recovers within that time. Otherwise it fails as before.

## Manual Testing Instructions

```bash
ddev utility download-ddev --pr 9026
export PATH="$HOME/tmp/ddev-download-ddev/pr-9026:$PATH"
ddev start   # in a first project
ddev start   # in a second project with a new hostname
# Expect no "nothing answers on host port(s)" warning on a healthy provider
```

## Automated Testing Overview

`TestIsPortUnreachable` covers answering, refused, reset, and closed-without-answer listeners. In the Docker Desktop CI logs, look for `recovered after Ns` from `logRouterDiagnostics`. It shows whether polling is enough here and in `TestCmdLogs`, or whether these tests need the ddev#8627 skip.

🤖 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants