Skip to content

Feature/env test path#27

Open
mwaltonen wants to merge 13 commits intoddev:mainfrom
mwaltonen:feature/env-test-path
Open

Feature/env test path#27
mwaltonen wants to merge 13 commits intoddev:mainfrom
mwaltonen:feature/env-test-path

Conversation

@mwaltonen
Copy link

@mwaltonen mwaltonen commented Dec 23, 2025

The Issue

Some environments do not allow site developers to save data to the root of the project. For instance, multisite environments on a common Drupal deployment where each site developer can only maintains the code within their site folder (e.g. web/sites/my.site.com.

Additionally, this will address some naming mismatches throughout the add-on (backstop, backstopjs, ddev-backstopjs, etc.)

How This PR Solves The Issue

Using ddev's environment variables for containers, the custom tests path can be saved to the project and updates from this add-on can still be consumed without revisiting configuration. This also allows the developer to save their backstop data to a custom place and still be able to share it with their team.

Manual Testing Instructions

  1. Confirm standard deployment works and a testing report is generated and viewable
ddev add-on get https://github.com/mmunz/ddev-backstopjs/tarball/refs/pull/27/head
ddev restart
ddev backstop init
ddev backstop reference
ddev backstop test
ddev backstop-results
  1. Move the testing folder a confirm everything still works as expected
ddev stop
ddev dotenv set .ddev/.env.backstopjs --backstopjs-testdir tests-new/backstop
mv tests tests-new
ddev start
ddev backstop test
ddev backstop-results
  1. Move to a new path, but fail to move the existing tests dir or create a new dir. Confirm ownership is updated to match your username.
ddev stop
ddev dotenv set .ddev/.env.backstopjs --backstopjs-testdir tests-bad/backstop
ddev start
stat -c '%U:%G' tests-bad/backstop
  1. Confirm everything still works as expected after the permissions fix
ddev backstop init
ddev backstop reference
ddev backstop test
ddev backstop-results
  1. Move to a new path, but fail to move the existing tests dir or create a new dir. Turn off auto repair to confirm user feedback is clear.
ddev stop
ddev dotenv set .ddev/.env.backstopjs --backstopjs-testdir tests-bad2/backstop
ddev dotenv set .ddev/.env.backstopjs --backstopjs-allow-perm-repair false
ddev start
  1. Clean up and confirm everything still works as expected.
ddev stop
ddev dotenv set .ddev/.env.backstopjs --backstopjs-testdir tests/backstop
ddev dotenv set .ddev/.env.backstopjs --backstopjs-allow-perm-repair true
sudo rm -rf tests*
mkdir -p tests/backstop
ddev start
ddev backstop init
ddev backstop reference
ddev backstop test
ddev backstop-results
ddev poweroff

@mwaltonen mwaltonen marked this pull request as ready for review December 23, 2025 21:53
@mmunz mmunz self-assigned this Feb 5, 2026
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