Skip to content

test-groups should allow to declare environment variables #4

@tdudgeon

Description

@tdudgeon

The test-groups feature allows to fire up additional containers using a Docker compose file.
Access to those containers from tests is typically done using environment variables.
Currently these have to be declared manually before running the test, but it would be better if the test-groups section allowed to declare the values for a set of env variables.

As an example, consider this declaration (found here:

test-groups:
- name: moldb
  compose:
    file: docker-compose-moldb.yaml
    delay-seconds: 5

If fires up a postgres db and for the tests to access it you need to manually set these env variables:

$ export POSTGRES_SERVER=postgres
$ export POSTGRES_DATABASE=postgres
$ export POSTGRES_USERNAME=postgres
$ export POSTGRES_PASSWORD=squonk

If you don't do this the test fail.

Better would be to be able to declare them in the test-group. e.g.

test-groups:
- name: moldb
  compose:
    file: docker-compose-moldb.yaml
    delay-seconds: 5
 environment:
 - POSTGRES_SERVER: postgres
 - POSTGRES_DATABASE: postgres
 - POSTGRES_USERNAME: postgres
 - POSTGRES_PASSWORD: squonk

Those env variables would then be automatically set for all tests in that test-group.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions