Mercurial > kallithea
annotate rhodecode/tests/vcs/conf.py @ 4116:ffd45b185016 rhodecode-2.2.5-gpl
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
This imports changes between changesets 21af6c4eab3d and 6177597791c2 in
RhodeCode's original repository, including only changes to Python files and HTML.
RhodeCode clearly licensed its changes to these files under GPLv3
in their /LICENSE file, which states the following:
The Python code and integrated HTML are licensed under the GPLv3 license.
(See:
https://code.rhodecode.com/rhodecode/files/v2.2.5/LICENSE
or
http://web.archive.org/web/20140512193334/https://code.rhodecode.com/rhodecode/files/f3b123159901f15426d18e3dc395e8369f70ebe0/LICENSE
for an online copy of that LICENSE file)
Conservancy reviewed these changes and confirmed that they can be licensed as
a whole to the Kallithea project under GPLv3-only.
While some of the contents committed herein are clearly licensed
GPLv3-or-later, on the whole we must assume the are GPLv3-only, since the
statement above from RhodeCode indicates that they intend GPLv3-only as their
license, per GPLv3ยง14 and other relevant sections of GPLv3.
author | Bradley M. Kuhn <bkuhn@sfconservancy.org> |
---|---|
date | Wed, 02 Jul 2014 19:03:13 -0400 |
parents | d7488551578e |
children | 7e5f8c12a3fc |
rev | line source |
---|---|
2451
402a96fcfa22
Added vcs testsuite for better integration tests + added fetching
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
1 """ |
402a96fcfa22
Added vcs testsuite for better integration tests + added fetching
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
2 Unit tests configuration module for vcs. |
402a96fcfa22
Added vcs testsuite for better integration tests + added fetching
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
3 """ |
402a96fcfa22
Added vcs testsuite for better integration tests + added fetching
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
4 import os |
402a96fcfa22
Added vcs testsuite for better integration tests + added fetching
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
5 import time |
402a96fcfa22
Added vcs testsuite for better integration tests + added fetching
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
6 import hashlib |
402a96fcfa22
Added vcs testsuite for better integration tests + added fetching
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
7 import tempfile |
402a96fcfa22
Added vcs testsuite for better integration tests + added fetching
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
8 import datetime |
3501
3d5f4d2f0826
fixed edge case in tests when we run them from virtualmachine and not as owner of files
Marcin Kuzminski <marcin@python-works.com>
parents:
2459
diff
changeset
|
9 import shutil |
2451
402a96fcfa22
Added vcs testsuite for better integration tests + added fetching
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
10 from utils import get_normalized_path |
402a96fcfa22
Added vcs testsuite for better integration tests + added fetching
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
11 from os.path import join as jn |
402a96fcfa22
Added vcs testsuite for better integration tests + added fetching
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
12 |
3797
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3501
diff
changeset
|
13 __all__ = ( |
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3501
diff
changeset
|
14 'TEST_HG_REPO', 'TEST_GIT_REPO', 'HG_REMOTE_REPO', 'GIT_REMOTE_REPO', |
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3501
diff
changeset
|
15 'SCM_TESTS', |
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3501
diff
changeset
|
16 ) |
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3501
diff
changeset
|
17 |
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3501
diff
changeset
|
18 SCM_TESTS = ['hg', 'git'] |
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3501
diff
changeset
|
19 uniq_suffix = str(int(time.mktime(datetime.datetime.now().timetuple()))) |
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3501
diff
changeset
|
20 |
2451
402a96fcfa22
Added vcs testsuite for better integration tests + added fetching
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
21 THIS = os.path.abspath(os.path.dirname(__file__)) |
3797
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3501
diff
changeset
|
22 |
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3501
diff
changeset
|
23 GIT_REMOTE_REPO = 'git://github.com/codeinn/vcs.git' |
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3501
diff
changeset
|
24 |
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3501
diff
changeset
|
25 TEST_TMP_PATH = os.environ.get('VCS_TEST_ROOT', '/tmp') |
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3501
diff
changeset
|
26 TEST_GIT_REPO = os.environ.get('VCS_TEST_GIT_REPO', |
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3501
diff
changeset
|
27 jn(TEST_TMP_PATH, 'vcs-git')) |
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3501
diff
changeset
|
28 TEST_GIT_REPO_CLONE = os.environ.get('VCS_TEST_GIT_REPO_CLONE', |
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3501
diff
changeset
|
29 jn(TEST_TMP_PATH, 'vcsgitclone%s' % uniq_suffix)) |
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3501
diff
changeset
|
30 TEST_GIT_REPO_PULL = os.environ.get('VCS_TEST_GIT_REPO_PULL', |
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3501
diff
changeset
|
31 jn(TEST_TMP_PATH, 'vcsgitpull%s' % uniq_suffix)) |
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3501
diff
changeset
|
32 |
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3501
diff
changeset
|
33 HG_REMOTE_REPO = 'http://bitbucket.org/marcinkuzminski/vcs' |
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3501
diff
changeset
|
34 TEST_HG_REPO = os.environ.get('VCS_TEST_HG_REPO', |
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3501
diff
changeset
|
35 jn(TEST_TMP_PATH, 'vcs-hg')) |
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3501
diff
changeset
|
36 TEST_HG_REPO_CLONE = os.environ.get('VCS_TEST_HG_REPO_CLONE', |
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3501
diff
changeset
|
37 jn(TEST_TMP_PATH, 'vcshgclone%s' % uniq_suffix)) |
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3501
diff
changeset
|
38 TEST_HG_REPO_PULL = os.environ.get('VCS_TEST_HG_REPO_PULL', |
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3501
diff
changeset
|
39 jn(TEST_TMP_PATH, 'vcshgpull%s' % uniq_suffix)) |
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3501
diff
changeset
|
40 |
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3501
diff
changeset
|
41 TEST_DIR = os.environ.get('VCS_TEST_ROOT', tempfile.gettempdir()) |
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3501
diff
changeset
|
42 TEST_REPO_PREFIX = 'vcs-test' |
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3501
diff
changeset
|
43 |
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3501
diff
changeset
|
44 |
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3501
diff
changeset
|
45 def get_new_dir(title): |
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3501
diff
changeset
|
46 """ |
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3501
diff
changeset
|
47 Returns always new directory path. |
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3501
diff
changeset
|
48 """ |
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3501
diff
changeset
|
49 name = TEST_REPO_PREFIX |
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3501
diff
changeset
|
50 if title: |
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3501
diff
changeset
|
51 name = '-'.join((name, title)) |
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3501
diff
changeset
|
52 hex = hashlib.sha1(str(time.time())).hexdigest() |
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3501
diff
changeset
|
53 name = '-'.join((name, hex)) |
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3501
diff
changeset
|
54 path = os.path.join(TEST_DIR, name) |
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3501
diff
changeset
|
55 return get_normalized_path(path) |
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3501
diff
changeset
|
56 |
2451
402a96fcfa22
Added vcs testsuite for better integration tests + added fetching
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
57 |
402a96fcfa22
Added vcs testsuite for better integration tests + added fetching
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
58 PACKAGE_DIR = os.path.abspath(os.path.join( |
402a96fcfa22
Added vcs testsuite for better integration tests + added fetching
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
59 os.path.dirname(__file__), '..')) |
3797
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3501
diff
changeset
|
60 _dest = jn(TEST_TMP_PATH, 'aconfig') |
3501
3d5f4d2f0826
fixed edge case in tests when we run them from virtualmachine and not as owner of files
Marcin Kuzminski <marcin@python-works.com>
parents:
2459
diff
changeset
|
61 shutil.copy(jn(THIS, 'aconfig'), _dest) |
3d5f4d2f0826
fixed edge case in tests when we run them from virtualmachine and not as owner of files
Marcin Kuzminski <marcin@python-works.com>
parents:
2459
diff
changeset
|
62 TEST_USER_CONFIG_FILE = _dest |
3797
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3501
diff
changeset
|
63 |
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3501
diff
changeset
|
64 #overide default configurations with rhodecode ones |
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3501
diff
changeset
|
65 from rhodecode.tests import * |