diff options
-rw-r--r-- | .gitlab-ci.yml | 2 | ||||
-rw-r--r-- | tests/server/test_tac.py | 15 | ||||
-rw-r--r-- | tox.ini | 1 |
3 files changed, 7 insertions, 11 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d6a76012..2878d78c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -63,8 +63,6 @@ tests: image: 0xacab.org:4567/leap/soledad:latest services: - couchdb - variables: - SOLEDAD_COUCH_URL: http://couchdb:5984 script: - tox -- --couch-url http://couchdb:5984 diff --git a/tests/server/test_tac.py b/tests/server/test_tac.py index 7f52481c..45bbb142 100644 --- a/tests/server/test_tac.py +++ b/tests/server/test_tac.py @@ -36,6 +36,7 @@ from twisted.web.client import Agent TAC_FILE_PATH = resource_filename('leap.soledad.server', 'server.tac') +@pytest.mark.usefixtures("couch_url") class TacServerTestCase(unittest.TestCase): def test_tac_file_exists(self): @@ -68,14 +69,12 @@ class TacServerTestCase(unittest.TestCase): twistd = os.path.join(path, 'bin', 'twistd') args = [twistd, '--pidfile=', '-noy', TAC_FILE_PATH] - # run Users API on port 2424 without TLS - env = {'DEBUG_SERVER': 'yes'} - - # allow passing of couch url using environment variable, used by gitlab - # ci with docker - couch_url = os.environ.get('SOLEDAD_COUCH_URL') - if couch_url: - env.update({'SOLEDAD_COUCH_URL': couch_url}) + # Use a special environment when running twistd that allow passing of + # couch url using environment variable, used by gitlab ci with docker + env = { + 'DEBUG_SERVER': 'yes', # run Users API on port 2424 without TLS + 'SOLEDAD_COUCH_URL': self.couch_url, # used by gitlab ci + } protocol = ProcessProtocol() proc = reactor.spawnProcess(protocol, twistd, args, env=env) @@ -42,7 +42,6 @@ setenv = TERM=xterm XDG_CACHE_HOME=./.cache/ CHECK_SQLCIPHER={toxinidir}/scripts/testing/ensure-pysqlcipher-has-usleep.sh -passenv = SOLEDAD_COUCH_URL install_command = pip install {opts} {packages} [testenv:py34] |