Skip to content

Discussion: Run PHPUnit and Codeception tests against local docker gibbon instance #2120

Description

@pli888

Problem

As part of the new Docker-based development environment for Gibbon, it would be good to be able to run PHPUnit and Codeception tests against the Dockerised Gibbon instance. Developers would then be able to run current tests as well as new tests they create.

Proposed Solution

A separate test container could be defined in docker-compose.yaml. This container can then be spun up in a bash script and used to execute the tests using docker commands that might look something like this:

docker-compose run --rm test ./vendor/phpunit/phpunit/phpunit --testsuite unit --bootstrap tests/bootstrap.php --verbose

docker-compose run --rm codecept run --no-redirect -g ok acceptance

See https://docs.gibbonedu.org/explanation/development/core-concepts/testing for how to run tests.

Here's the user story and acceptance criteria for how things might work:

User Story

As a developer
I want to run tests on my local docker Gibbon instance
So that I can check if my new tests are passing
And I can check my changes to the source code have not broken any existing tests

Acceptance Criteria

Given I have executed ./up.sh to deploy a local Docker Gibbon instance
When I execute a bash script to run tests against local Docker Gibbon instance
Then all tests pass

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions