Show More
@@ -726,11 +726,9 b' def create_test_index(repo_location, con' | |||
|
726 | 726 | |
|
727 | 727 | def create_test_env(repos_test_path, config): |
|
728 | 728 | """ |
|
729 |
Makes a fresh database |
|
|
730 | installs test repository into tmp dir | |
|
729 | Makes a fresh database. | |
|
731 | 730 | """ |
|
732 | 731 | from rhodecode.lib.db_manage import DbManage |
|
733 | from rhodecode.tests import HG_REPO, GIT_REPO, SVN_REPO, TESTS_TMP_PATH | |
|
734 | 732 | |
|
735 | 733 | # PART ONE create db |
|
736 | 734 | dbconf = config['sqlalchemy.db1.url'] |
@@ -752,7 +750,18 b' def create_test_env(repos_test_path, con' | |||
|
752 | 750 | dbmanage.create_permissions() |
|
753 | 751 | dbmanage.populate_default_permissions() |
|
754 | 752 | Session().commit() |
|
755 | # PART TWO make test repo | |
|
753 | ||
|
754 | create_test_repositories(repos_test_path, config) | |
|
755 | ||
|
756 | ||
|
757 | def create_test_repositories(path, config): | |
|
758 | """ | |
|
759 | Creates test repositories in the temporary directory. Repositories are | |
|
760 | extracted from archives within the rc_testdata package. | |
|
761 | """ | |
|
762 | import rc_testdata | |
|
763 | from rhodecode.tests import HG_REPO, GIT_REPO, SVN_REPO, TESTS_TMP_PATH | |
|
764 | ||
|
756 | 765 | log.debug('making test vcs repositories') |
|
757 | 766 | |
|
758 | 767 | idx_path = config['search.location'] |
@@ -767,21 +776,12 b' def create_test_env(repos_test_path, con' | |||
|
767 | 776 | log.debug('remove %s', data_path) |
|
768 | 777 | shutil.rmtree(data_path) |
|
769 | 778 | |
|
770 | # CREATE DEFAULT TEST REPOS | |
|
771 | cur_dir = dn(dn(abspath(__file__))) | |
|
772 | with tarfile.open(jn(cur_dir, 'tests', 'fixtures', | |
|
773 | 'vcs_test_hg.tar.gz')) as tar: | |
|
774 | tar.extractall(jn(TESTS_TMP_PATH, HG_REPO)) | |
|
775 | ||
|
776 | cur_dir = dn(dn(abspath(__file__))) | |
|
777 | with tarfile.open(jn(cur_dir, 'tests', 'fixtures', | |
|
778 | 'vcs_test_git.tar.gz')) as tar: | |
|
779 | tar.extractall(jn(TESTS_TMP_PATH, GIT_REPO)) | |
|
779 | rc_testdata.extract_hg_dump('vcs_test_hg', jn(TESTS_TMP_PATH, HG_REPO)) | |
|
780 | rc_testdata.extract_git_dump('vcs_test_git', jn(TESTS_TMP_PATH, GIT_REPO)) | |
|
780 | 781 | |
|
781 | 782 | # Note: Subversion is in the process of being integrated with the system, |
|
782 | 783 | # until we have a properly packed version of the test svn repository, this |
|
783 | 784 | # tries to copy over the repo from a package "rc_testdata" |
|
784 | import rc_testdata | |
|
785 | 785 | svn_repo_path = rc_testdata.get_svn_repo_archive() |
|
786 | 786 | with tarfile.open(svn_repo_path) as tar: |
|
787 | 787 | tar.extractall(jn(TESTS_TMP_PATH, SVN_REPO)) |
General Comments 0
You need to be logged in to leave comments.
Login now