Skip to content

Conversation

@weitzman
Copy link
Contributor

@weitzman weitzman commented Jul 3, 2025

The Issue

Allow bats runners to avoid deletion of the testdir. Helpful when uploading artifacts as per

How This PR Solves The Issue

Detect GITHUB_ENV env variable and avoid deleting the test directory. This is set to true for runs in GitHub Actions. Locally you can set it as well for same behavior.

Manual Testing Instructions

git clone --branch preserve-dir --single-branch https://github.com/weitzman/ddev-addon-template
cd ddev-addon-template
GITHUB_ENV=1 bats ./tests/test.bats --filter-tags '!release'
# and see ~/tmp/test-ddev-addon-template.XXXXXX after the test is done

Working example is in:

@stasadev stasadev self-requested a review July 3, 2025 16:24
Copy link
Member

@stasadev stasadev left a comment

Choose a reason for hiding this comment

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

On second thought, we don't even need this DDEV_PRESERVE_TESTDIR, if we can look at GITHUB_ENV, right?

Please update the OP using the template. Giving link to external website is not useful.

weitzman and others added 2 commits July 3, 2025 13:42
Co-authored-by: Stanislav Zhuk <stasadev@gmail.com>
Co-authored-by: Stanislav Zhuk <stasadev@gmail.com>
@weitzman weitzman changed the title Honor new DDEV_PRESERVE_TESTDIR env variable Preserve TESTDIR when using Github Actions Jul 3, 2025
Co-authored-by: Stanislav Zhuk <stasadev@gmail.com>
Co-authored-by: Stanislav Zhuk <stasadev@gmail.com>
Copy link
Member

@stasadev stasadev left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@stasadev stasadev requested a review from julienloizelet July 3, 2025 18:25
Copy link
Contributor

@julienloizelet julienloizelet left a comment

Choose a reason for hiding this comment

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

Ok for me ! Thank you

@stasadev
Copy link
Member

stasadev commented Jul 4, 2025

@stasadev stasadev merged commit 6e5c998 into ddev:main Jul 4, 2025
2 checks passed
@stasadev
Copy link
Member

stasadev commented Jul 4, 2025

Additional fix to upload all test results:

stasadev added a commit that referenced this pull request Jul 4, 2025
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.

3 participants