Repository navigation
test(bats): export CI=true - #118
Merged
Merged
Conversation
## Short Summary (TL;DR) `tests/test.bats` now sets `CI=true`, so local test runs print the logs of a container that fails during `ddev start` or `ddev restart`, the same way GitHub Actions runs do. ## The Issue - For ddev/ddev#8920 When a container fails during a local test run, the output only suggests `ddev logs` and `docker logs`, and teardown removes the containers before you can run them. ## How This PR Solves The Issue - Adds `export CI=true` to `setup()` in `tests/test.bats`. With ddev/ddev#8920, DDEV prints the failed container's logs when `CI=true`. - `update-checker.sh` now reports add-ons whose `tests/test.bats` doesn't set `export CI=true`. ## Manual Testing Instructions ```bash ddev utility download-ddev --pr 8920 export PATH="$HOME/tmp/ddev-download-ddev/pr-8920:$PATH" ddev add-on get ddev/ddev-addon-template --pr 118 sed -i 's/command: .*/command: ["sh", "-c", "echo INTENTIONAL_BREAKAGE_MARKER; exit 1"]/' .ddev/docker-compose.addon-template.yaml CI=true ddev restart # Expect "Logs from failed ddev-<project>-addon-template container:" followed by INTENTIONAL_BREAKAGE_MARKER ``` ## Automated Testing Overview The existing bats tests pass with `CI=true`. ## Release/Deployment Notes With a DDEV release that doesn't include ddev/ddev#8920, `CI=true` only disables instrumentation, which `DDEV_NO_INSTRUMENTATION=true` already does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rfay
reviewed
Oct 9, 2026
rfay
left a comment
Member
There was a problem hiding this comment.
I'm surprised CI wasn't already set (on github)
Member
Author
It is set. The change is needed for local development, otherwise you can't see the errors with |
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.
Short Summary (TL;DR)
tests/test.batsnow setsCI=true, so local test runs print the logs of a container that fails duringddev startorddev restart, the same way GitHub Actions runs do.The Issue
When a container fails during a local test run, the output only suggests
ddev logsanddocker logs, and teardown removes the containers before you can run them.How This PR Solves The Issue
export CI=truetosetup()intests/test.bats. With feat: show failed container logs when CI=true ddev#8920, DDEV prints the failed container's logs whenCI=true.update-checker.shnow reports add-ons whosetests/test.batsdoesn't setexport CI=true.Manual Testing Instructions
Automated Testing Overview
The existing bats tests pass with
CI=true.Release/Deployment Notes
With a DDEV release that doesn't include ddev/ddev#8920,
CI=trueonly disables instrumentation, whichDDEV_NO_INSTRUMENTATION=truealready does.