Skip to content

Commit

Permalink
Pass environment variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
sydoluciani committed Sep 3, 2020
1 parent 41ca461 commit 6ceb42c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion deformdemo/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def setUpModule():
from selenium.webdriver import Remote

start_firefox()
time.sleep(os.getenv('DOCKER_RUN_TIMEOUT', 30))
time.sleep(os.getenv('WAITTOSTART', 30))

selenium_grid_url = "http://localhost:4444/wd/hub"
capabilities = DesiredCapabilities.FIREFOX.copy()
Expand Down
7 changes: 6 additions & 1 deletion selenium_containers.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
import os
import docker


def start_firefox():

container_time_zone = os.getenv('CONTAINERTZ', "TZ=US/Mountain")

client = docker.from_env()
client.containers.run(
"selenium/standalone-firefox:4.0.0-alpha-7-prerelease-20200826",
ports={'4444/tcp': 4444, '5900/tcp': 5900},
volumes={'/dev/shm': {'bind': '/dev/shm', 'mode': 'rw'}, },
detach=True,
remove=True,
auto_remove=True)
auto_remove=True,
environment=[container_time_zone])


def stop_selenium_containers():
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ basepython =
usedevelop = true

[testenv:functional3]
passenv = DISPLAY WEBDRIVER DISPLAY FIREFOX_PATH TRAVIS URL DOCKER_RUN_TIMEOUT
passenv = DISPLAY WEBDRIVER DISPLAY FIREFOX_PATH TRAVIS URL WAITTOSTART CONTAINERTZ
whitelist_externals = tox.sh
commands =
pip install -Ur requirements-dev.txt
Expand Down

0 comments on commit 6ceb42c

Please sign in to comment.