Testing in a sandbox
This page is for developers who are about to publish a site package, or send it by pull request. A site package writes a database and a whole set of settings when it is installed; the only safe place to try it is an installation that exists for that purpose. This page shows how to make one, what to test, and how to remove it again.
7x and the Exponential Foundation strongly encourage you to submit your tested site package by pull request to se7enxweb/exponential.packages.exponential.earth: see Contribute your site package. Reviewers will ask how you tested it.
Contents
- Make the sandbox
- Round 1: the archives
- Round 2: a dry run
- Round 3: a full install
- Round 4: look at the result
- Clean up
Make the sandbox
Use a separate checkout of Exponential 6.0, never the directory of a site that matters:
git clone https://github.com/se7enxweb/exponential.git sandbox-acme
cd sandbox-acme
composer installThe ways to get the code, and what composer install does, are in
3. Getting the code.
Point it at the server that holds your test packages (Pointing a site at your package server):
# settings/override/package.ini.append.php
[RepositorySettings]
RemotePackagesIndexURL=https://packages.example.com/exponential/6.0/6.0.15SQLite is the default database of exp:install and needs no server: the database is one file in
var/storage/sqlite3/, which makes the sandbox easy to throw away.
Warning
exp:install --db-action=remove (the default) empties the database first, and --force replaces an existing
installation's database and settings. In a sandbox that is what you want; anywhere else it is not.
Round 1: the archives
On your build machine, before anything is published:
tar -tzf acme_site.ezpkg | head # package.xml at the top
php ezpm.php validate /path/to/acme_site.ezpkg # in the sandbox: the kernel's checks, nothing importedSee Rebuilding with build.sh and Validating a package before publishing.
Round 2: a dry run
php bin/php/console exp:install --package=acme_site --print
php bin/php/console exp:install --package=acme_site --dry-run--print shows the configuration and stops. --dry-run connects to the database and fetches your site package and
its requirements into var/storage/packages/dryrun/, which is removed again; it writes no database and no settings
(7.6). It proves that your index can be read, every
archive downloads and imports, and every <require> is found. With a kickstart.ini:
php bin/php/console exp:kickstarter run --dry-run does the same (6.7).
Round 3: a full install
php bin/php/console exp:install --apply --package=acme_site --url=http://localhost:8080 --random-passwordRun it as the user the web server's PHP runs as, so the files it creates stay writable (7.3). Then read the logs:
| Log | What to look for |
|---|---|
var/log/setup.log | every step, download retries, warnings of your installer script |
var/log/kickstart.log | the kickstarter's run (with exp:kickstarter run) |
| the summary printed at the end | site address, administration login, siteaccesses |
A post-install step that aborts the chain is reported: eZSiteInstaller::abortedStep() keeps its number and function
(Changing the installer script).
Round 4: look at the result
- To do: The front page and a few content pages render, in every siteaccess and language the package creates.
- To do: The administration opens; Setup > Packages lists your packages as installed or imported, with no warnings.
- To do: The content classes are those you expect (the class list of the administration), with their names in every language.
- To do: The roles and policies your installer creates exist, and a test user of each role can do what it should.
- To do: Pages that use layouts show their blocks.
- To do: Install a second time with the
_cleanvariant, if you ship one. - To do: Repeat the full install from scratch once more: an installer that only works the first time fails for the next person.
Clean up
A sandbox left behind takes disk space and may run a server:
- Stop any server you started for it (
exp:velocity stop, or thephp -Sprocess). - Remove the sandbox directory once you have kept what you need (logs, screenshots).
- Remove the test database if you used a database server instead of SQLite.
Keep a short note of what you tested and on which release: it belongs in the pull request description (Contribute your site package).
Related pages
- Making your own site package
- Contribute your site package
- Validating a package before publishing
- How the kickstarter and console use packages
- Installing your package on a test site
- 7. The console install
- Site packages: start here
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.