emteknetnz/legion

There is no license information available for the latest version (dev-master) of this package.

Parallel silverstripe testing using docker

dev-master 2023-08-02 01:54 UTC

This package is auto-updated.

Last update: 2024-03-31 03:12:00 UTC


README

This is a dev only module to get phpunit running parallel in silverstripe projects using docker

Installation

composer require --dev emteknetnz/legion

Usage

vendor/bin/legion app/tests

Details

Host -> Docker container A -- Primary controller for multiple container B secondaries -> Docker container Bs -- Large number of these are spawned to run tests

Even though container Bs are created from inside of container A, they're actually siblings because of the shared /var/run/docker.sock between host, container A and container Bs. This is the simplest way to enable 'docker in docker'

The /tmp folder is also shared between host, container A and container Bs. This is so that when you run ?flush on container A, it's immediately usable with container Bs which spin in and out of existance as needed.

Host needs to share /tmp because container A and container Bs are siblings volume mounts won't work easily out of the box. Also, possibly it would be better if it wasn't the /tmp folder shared, instead should maybe use /silverstripe-cache/ ?

. .