Mercurial > kallithea
comparison scripts/generate-ini.py @ 6857:cddff7f0dd08
tests: use temporary copy of test.ini, possibly customized for TEST_DB
It was an undocumented feature that if setting the environment variable
TEST_DB, that would be used for tests instead of the default
kallithea/tests/test.ini sqlalchemy.url . That did however not work for Git
hooks and tests would fail.
Instead, create a copy of test.ini in the temp folder and use that for testing.
If TEST_DB is set, edit the file so the specified DB URL is used. This fixes
Git hook related tests if TEST_DB is used.
Since this also changes the path of %(here)s to the temporary location, just
use the default paths.
This also has the advantage that the data folders are now in the temp folder
as well. Therefore a broken data folder, from a past run, can no longer
influence a test.
author | domruf <dominikruf@gmail.com> |
---|---|
date | Mon, 14 Aug 2017 22:34:28 +0200 |
parents | a4715df40299 |
children | 665dfa112f2c |
comparison
equal
deleted
inserted
replaced
6856:dfb31968225d | 6857:cddff7f0dd08 |
---|---|
39 '[app:main]': { | 39 '[app:main]': { |
40 'app_instance_uuid': 'test', | 40 'app_instance_uuid': 'test', |
41 'show_revision_number': 'true', | 41 'show_revision_number': 'true', |
42 'beaker.cache.sql_cache_short.expire': '1', | 42 'beaker.cache.sql_cache_short.expire': '1', |
43 'beaker.session.secret': '{74e0cd75-b339-478b-b129-07dd221def1f}', | 43 'beaker.session.secret': '{74e0cd75-b339-478b-b129-07dd221def1f}', |
44 'cache_dir': '%(here)s/../../data/test/cache', | |
45 'index_dir': '%(here)s/../../data/test/index', | |
46 'archive_cache_dir': '%(here)s/../../data/test/tarballcache', | |
47 'beaker.cache.data_dir': '%(here)s/../../data/test/cache/data', | |
48 'beaker.cache.lock_dir': '%(here)s/../../data/test/cache/lock', | |
49 'sqlalchemy.url': 'sqlite:///%(here)s/kallithea_test.sqlite', | |
50 }, | 44 }, |
51 '[handler_console]': { | 45 '[handler_console]': { |
52 'level': 'DEBUG', | 46 'level': 'DEBUG', |
53 'formatter': 'color_formatter', | 47 'formatter': 'color_formatter', |
54 }, | 48 }, |