Skip to content

test(bats): export CI=true - #118

Merged
stasadev merged 1 commit into
mainfrom
20261009_stasadev_ci_true
Oct 9, 2026
Merged

stasadev merged 1 commit into
mainfrom
20261009_stasadev_ci_true

Conversation

@stasadev

@stasadev stasadev commented Oct 9, 2026

Copy link
Copy Markdown
Member

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

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

Manual Testing Instructions

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.

## 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 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.

I'm surprised CI wasn't already set (on github)

@stasadev

stasadev commented Oct 9, 2026 •

Copy link
Copy Markdown
Member Author

I'm surprised CI wasn't already set (on github)

It is set. The change is needed for local development, otherwise you can't see the errors with bats.

@stasadev
stasadev merged commit 302d67f into main Oct 9, 2026
4 checks passed
@stasadev
stasadev deleted the 20261009_stasadev_ci_true branch October 9, 2026 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants