Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make host/port env vars available for substitution in setenv #55

Open
thenewguy opened this issue May 26, 2020 · 1 comment
Open

Make host/port env vars available for substitution in setenv #55

thenewguy opened this issue May 26, 2020 · 1 comment

Comments

@thenewguy
Copy link
Contributor

Have had a little bit of a trouble getting elastic/apm-server:7.7.0 image working with tox. One problem I am not able to workaround easily is configuration by environment variables using the variables set by tox-docker.

If the host and port environment variables were available for substitution during setenv it would be helpful:

setenv =
    ...
    ELASTIC_APM_SERVER_URL=http://{env:ELASTIC_APM_SERVER_HOST}:{env:ELASTIC_APM_SERVER_8200_TCP_PORT}

Attempting to set ELASTIC_APM_SERVER_URL to the connection string for apm-server raises tox.exception.MissingSubstitution: MissingSubstitution: ELASTIC_APM_SERVER_HOST.

Here is the relavent configuration to run the apm-server image:

docker =
    ...
    elastic/apm-server:7.7.0
[docker:elastic/apm-server:7.7.0]
healthcheck_cmd = true
healthcheck_interval = 15
healthcheck_timeout = 15
healthcheck_retries = 30
healthcheck_start_period = 10
ports = 8200/tcp
@dcrosta
Copy link
Member

dcrosta commented Jun 14, 2020

I think this may be really difficult -- pinging @tox-dev/maintainers in case you have any ideas? The values of the env vars isn't known until after tox_runtest_pre runs, which I believe is after all the config value substitution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants