Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests for Git submodule #3737

Merged
merged 1 commit into from
Mar 6, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion readthedocs/rtd_tests/utils.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
"""Utility functions for use in tests."""

from __future__ import absolute_import

import logging
import subprocess
from os import chdir, environ, getcwd
from os.path import abspath, join as pjoin
from shutil import copytree
import subprocess
from tempfile import mkdtemp

from django_dynamic_fixture import new
from django.contrib.auth.models import User


log = logging.getLogger(__name__)


Expand All @@ -31,7 +34,19 @@ def make_test_git():
env = environ.copy()
env['GIT_DIR'] = pjoin(directory, '.git')
chdir(directory)

# Initialize and configure
log.info(check_output(['git', 'init'] + [directory], env=env))
log.info(check_output(
['git', 'config', 'user.email', '[email protected]'],
env=env
))
log.info(check_output(
['git', 'config', 'user.name', 'Read the Docs'],
env=env
))

# Set up the actual repository
log.info(check_output(['git', 'add', '.'], env=env))
log.info(check_output(['git', 'commit', '-m"init"'], env=env))
# Add repo itself as submodule
Expand Down