Skip to content

Conversation

@rfay
Copy link
Member

@rfay rfay commented Oct 22, 2025

The Issue

How This PR Solves The Issue

Remove web/ directories from all test fixtures. These contain generated
Drupal core and contributed modules that can be recreated via composer
install when needed for testing.

  • Use only one basic drupal installation
  • Add upsun/platform config files to it per test

This reduces repository size significantly:

  • 123,949 files removed
  • ~744 MB of Drupal core source code removed
  • Fixtures now contain only essential config files:
    • composer.json/composer.lock (dependencies)
    • .upsun/config.yaml or .platform* files (platform configs)
    • config/sync/ (Drupal configuration)
    • drush/ (deployment scripts)
    • db.sql.gz (database fixtures)

Tests can regenerate web/ directories on-demand with:
composer install --no-dev --no-interaction

Closes #11

🤖 Generated with Claude Code

Co-Authored-By: Claude [email protected]## The Issue

rfay and others added 7 commits October 22, 2025 13:38
Remove web/ directories from all test fixtures. These contain generated
Drupal core and contributed modules that can be recreated via composer
install when needed for testing.

This reduces repository size significantly:
- 123,949 files removed
- ~744 MB of Drupal core source code removed
- Fixtures now contain only essential config files:
  - composer.json/composer.lock (dependencies)
  - .upsun/config.yaml or .platform* files (platform configs)
  - config/sync/ (Drupal configuration)
  - drush/ (deployment scripts)
  - db.sql.gz (database fixtures)

Tests can regenerate web/ directories on-demand with:
  composer install --no-dev --no-interaction

Closes #11

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Document that web/ and vendor/ directories are no longer tracked in git,
and explain how to regenerate fixtures when needed with composer install.

This clarifies the new workflow after removing 123,949 generated files
from the repository.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
After removing web/ and vendor/ from git tracking, tests need to run
'ddev composer install' to generate these directories from composer.lock.

This installs:
- vendor/bin/drush - Required for drush commands in tests
- web/core/ - Drupal core files needed for site to function

Without this, tests fail with drush not found errors.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
While web/ directory is gitignored, we need to keep the custom settings
files that configure Drupal for Upsun/DDEV:
- web/sites/default/settings.php - Custom Drupal settings
- web/sites/default/settings.upsun.php - Upsun-specific configuration

These files won't be created by 'composer install' and are required for
tests to work properly.

Total: 12 settings files (2 per fixture × 6 fixtures)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Instead of 6 duplicate Drupal installations, now using:
- ONE drupal11-base/ directory with Drupal core
- SIX platform-configs/ subdirectories with just platform configs

This reduces repository size:
- Before: ~120 MB (6 × ~20 MB)
- After: ~150 MB (base with vendor/web + 6 tiny configs)

Test changes:
- Copy drupal11-base to test dir
- Overlay platform-specific config from platform-configs/
- Run composer install (now very fast due to cached vendor/)

Benefits:
- Single source of truth for Drupal installation
- Much faster composer install in tests (cached dependencies)
- Easier to update Drupal version (only one place)
- Still tests all 6 platform config variants

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
After refactoring to use drupal11-base with platform-configs overlays, remove the old separate fixture directories:
- drupal11-mariadb-fixed/
- drupal11-mariadb-flex/
- drupal11-mysql-fixed/
- drupal11-mysql-flex/
- drupal11-postgres-fixed/
- drupal11-postgres-flex/

These have been replaced with:
- drupal11-base/ (single Drupal installation)
- platform-configs/* (6 subdirectories with just config files)

This completes the test fixture refactoring.
PostgreSQL tests were failing because they were trying to import a MySQL database dump. Split the single db.sql.gz into:
- db-mysql.sql.gz (for MySQL and MariaDB tests)
- db-postgres.sql.gz (for PostgreSQL tests)

Updated per_test.sh to select the correct dump based on EXPECTED_DB_TYPE variable set by the test framework.

This fixes postgres-flex and postgres-fixed test failures on CI.
@rfay rfay marked this pull request as ready for review October 22, 2025 21:09
@rfay rfay force-pushed the 20251022_test_fixtures branch from a558365 to 8ebcdfc Compare October 22, 2025 22:24
@rfay rfay merged commit 9ad962f into main Oct 22, 2025
24 checks passed
@rfay rfay deleted the 20251022_test_fixtures branch October 22, 2025 22:38
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.

Improve and simplify initial drupal test fixtures

2 participants