fix(test): use local apt repo with fake packages to avoid flakiness in TestExtraPackages - #8323
Merged
Merged
Conversation
…n TestExtraPackages [skip buildkite] ## The Issue - Refs https://github.com/ddev/ddev/actions/runs/24502796076/job/71627009789 - When upstream Debian/Ubuntu apt repositories are down (e.g. https://status.canonical.com incident), TestExtraPackages fails because it tries to install real packages (`sudo`, `bind9-dnsutils`) from the network during the Docker image build. ## How This PR Solves The Issue A `pre.Dockerfile.fake-ddev-test` is written to `web-build/` and `db-build/` before the test starts. It runs inside the container build after `FROM $BASE_IMAGE` but before the injected `apt-get install` step. The Dockerfile fragment uses `dpkg-deb` (part of the `dpkg` package, always present in Debian images — no network needed) to create minimal fake `.deb` packages and registers them as a local deb822 apt source (`file:///var/local-apt-repo`). When the extra_packages `apt-get install` runs it finds the packages locally regardless of external repo availability. The test packages are renamed `fake-ddev-test-sudo` / `fake-ddev-test-bind9-dnsutils` so they cannot be mistaken for real system packages. A latent bug is also fixed: the post-install `command -v` check was hardcoded to `sudo` instead of using the `addedDBPackage` variable. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
rfay
approved these changes
Apr 16, 2026
rfay
left a comment
Member
There was a problem hiding this comment.
Nice idea, completely safe, great step forward, thanks!
|
Download the artifacts for this pull request:
See Testing a PR. |
rfay
approved these changes
Apr 16, 2026
rfay
left a comment
Member
There was a problem hiding this comment.
This is test-only, and a good idea, and it passed the key tests. I'm going to go aheaad and pull it. I think the Canonical archive problem is over, but we have lots of tests to fix.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Issue
sudo,bind9-dnsutils) from the network during the Docker image build.How This PR Solves The Issue
A
pre.Dockerfile.fake-ddev-testis written toweb-build/anddb-build/before the test starts. It runs inside the container build afterFROM $BASE_IMAGEbut before the injectedapt-get installstep.The Dockerfile fragment uses
dpkg-deb(part of thedpkgpackage, always present in Debian images — no network needed) to create minimal fake.debpackages and registers them as a local deb822 apt source (file:///var/local-apt-repo). When the extra_packagesapt-get installruns it finds the packages locally regardless of external repo availability.The test packages are renamed
fake-ddev-test-sudo/fake-ddev-test-bind9-dnsutilsso they cannot be mistaken for real system packages.Manual Testing Instructions
Automated Testing Overview
Release/Deployment Notes