Download the PHP package university-of-denver/quicksilver-qa-prep without Composer
On this page you can find all versions of the php package university-of-denver/quicksilver-qa-prep. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download university-of-denver/quicksilver-qa-prep
More information about university-of-denver/quicksilver-qa-prep
Files in university-of-denver/quicksilver-qa-prep
Package quicksilver-qa-prep
Short Description Prepare a non-live Pantheon environment for automated QA tests by enabling the testing module
License MIT
Homepage https://github.com/DU-University-Relations/quicksilver-qa-prep
Informations about the package quicksilver-qa-prep
Quicksilver QA Prep
This Quicksilver script automates the preparation of a Pantheon environment for running automated QA tests. It replaces a manual step that was previously run after every database clone:
- Enable the
du_functional_testingmodule – equivalent to:
The du_functional_testing module creates the qa_* test users and grants the
role needed for local logins.
The script is triggered automatically by the Pantheon env:clone workflow
(database clone), so no manual intervention is required after a sync.
Environment restriction: The script executes on any non-live Pantheon environment, including Multidevs. On live, it exits immediately without making changes.
Note: The
du_functional_testinginstall hook is known to sometimes return a non-zero exit code. The script logs any such error and continues regardless, because theqa_*test users are still created even when the hook exits with an error.
This project was developed from a template for new Quicksilver projects to utilize so that Quicksilver scripts can be installed through Composer.
Original template: https://github.com/pantheon-quicksilver/quicksilver-template
Requirements
- PHP 8.0 or higher
- Composer
- Drupal 9+ site running on Pantheon with the
du_functional_testingmodule available in the codebase
Installation
This project is designed to be included from a site's composer.json file, and
placed in its appropriate installation directory by
Composer Installers.
In order for this to work, you should have the following in your composer.json
file:
Then, install this package via Composer:
Add to pantheon.yml
Choose the hooks that match when QA starts for your site. Pantheon's Quicksilver hook reference lists the supported workflows and where each hook runs.
Database clones
Use clone_database when QA follows a content sync, such as Live → Test,
Test → Dev, or a database clone into a Multidev:
This is the smallest recommended configuration for sites where every QA run starts with a database clone.
Autopilot
Autopilot applies updates in an isolated Multidev before running visual
regression tests. Pantheon's documentation does not guarantee that Autopilot's
internal environment clone invokes a site's clone_database hook, so do not
rely on that hook alone for an Autopilot-triggered QA run.
For a separate QA workflow that starts after Autopilot VRT, add the explicit
autopilot_vrt hook. Quicksilver scripts run sequentially, so list this script
before the hook that starts the QA workflow:
The autopilot_vrt hook only supports the after stage. It prepares accounts
for follow-on tests, not for Pantheon's VRT that just completed.
If accounts must exist before Autopilot VRT, add sync_code as an earlier
preparation hook:
Pantheon documents sync_code for Git pushes, upstream updates, Multidev
merges, and automated workflows. On Integrated Composer sites it runs after
build artifacts are deployed. Because it runs frequently, confirm in the
site's workflow logs that it matches the intended Autopilot flow before adding
it only for this purpose.
Other useful hooks
The script is safe to invoke repeatedly because enabling an already-enabled module is idempotent. Depending on the site's workflow, these hooks may also be useful:
| Hook | Add it when |
|---|---|
create_cloud_development_environment (after only) |
A newly created Multidev must be ready for QA even when no separate database clone follows. |
deploy |
QA runs on Test after code is deployed without cloning the database. The script's environment guard makes a Live invocation a no-op. |
sync_code |
QA can follow a Git push, upstream update, Multidev merge, or automated code workflow. This hook runs frequently, so omit it if database-clone coverage is sufficient. |
Do not use clear_cache as a general QA-preparation trigger; cache clears can
happen often and do not indicate that a testable environment was created or
updated.
What the script does
- Runs
drush en du_functional_testing -yto enable the functional testing module, which createsqa_*test user accounts and grants the role needed for local logins. Any errors from the install hook are logged but do not fail the workflow.
No Pantheon secrets are required.