Docker-compose for GreenwaveΒΆ

To run functional tests or verify interoperability with ResultsDB and WaiverDB services, you can use podman-compose (or docker-compose) to run the services in a containerized environment.

Install podman-compose either using pip or from a package:

sudo dnf install podman-compose

Makefile and make commands are used here to simplify setting up the development containers.

Build the container image:

make build

Start the containers:

make up

If there are any problems setting up the message bus, start the containers without messaging support:

GREENWAVE_LISTENERS=0 make up

Verify that containers are running:

podman ps

Check logs if needed:

podman logs greenwave_greenwave_1

Run unit and functional tests:

make test

Run a specific test:

make test ARGS="-vv -x greenwave/tests/test_rules.py -k test_remote_rule

Stop the containers:

make down

The Greenwave container is restarted automatically if the code changes. Sometimes this can fail due to syntax errors or bugs in the code. In such case restart the container with:

podman restart greenwave_greenwave_1

You could encounter the following error when executing the application or tests:

ImportError while loading conftest '/code/conftest.py'.
py._path.local.LocalPath.ImportMismatchError: ('conftest', '/home/user/proj/greenwave/conftest.py', local('/code/conftest.py'))

To resolve this, remove old generated *.pyc files in the project directory:

find -name '*.pyc' -delete

See the docker-compose reference for a full description.