mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
improve test performance
This commit is contained in:
@@ -21,7 +21,7 @@ steps:
|
||||
# Fix Git SSL errors
|
||||
echo "Using pipenv python version: $(PIPENV_DEFAULT_PYTHON_VERSION)"
|
||||
git submodule sync && git submodule update --init --recursive
|
||||
pipenv run pytest -n 4 --junitxml=junit/test-results.xml --timeout=300 tests
|
||||
pipenv run pytest -n 4 --junitxml=junit/test-results.xml tests
|
||||
displayName: Run integration tests
|
||||
env:
|
||||
PYTHONWARNINGS: ignore:DEPRECATION
|
||||
|
||||
@@ -46,7 +46,7 @@ steps:
|
||||
- script: |
|
||||
git submodule sync
|
||||
git submodule update --init --recursive
|
||||
pipenv run pytest -ra -n 4 --junit-xml=junit/test-results.xml --timeout=300 tests/
|
||||
pipenv run pytest -ra -n 4 --junit-xml=junit/test-results.xml tests/
|
||||
failOnStderr: false
|
||||
displayName: Run integration tests
|
||||
env:
|
||||
|
||||
@@ -80,4 +80,4 @@ jobs:
|
||||
PYTHONIOENCODING: 'utf-8'
|
||||
GIT_SSH_COMMAND: ssh -o StrictHostKeyChecking=accept-new -o CheckHostIP=no
|
||||
run: |
|
||||
pipenv run pytest -ra -n 4 --timeout=300 tests
|
||||
pipenv run pytest -ra -n 4 tests
|
||||
|
||||
@@ -41,8 +41,7 @@ python_version=3.6
|
||||
mypy_path=typeshed/pyi:typeshed/imports
|
||||
|
||||
[tool:pytest]
|
||||
addopts = -ra -n auto
|
||||
plugins = xdist
|
||||
addopts = -ra
|
||||
testpaths = tests
|
||||
; Add vendor and patched in addition to the default list of ignored dirs
|
||||
; Additionally, ignore tasks, news, test subdirectories and peeps directory
|
||||
|
||||
@@ -69,7 +69,7 @@ def check_github_ssh():
|
||||
# GitHub does not provide shell access.' if ssh keys are available and
|
||||
# registered with GitHub. Otherwise, the command will fail with
|
||||
# return_code=255 and say 'Permission denied (publickey).'
|
||||
c = delegator.run('ssh -o StrictHostKeyChecking=accept-new -o CheckHostIP=no -T git@github.com', timeout=30)
|
||||
c = delegator.run('ssh -o StrictHostKeyChecking=no -o CheckHostIP=no -T git@github.com', timeout=30)
|
||||
res = True if c.return_code == 1 else False
|
||||
except KeyboardInterrupt:
|
||||
warnings.warn(
|
||||
|
||||
@@ -360,8 +360,7 @@ def test_multiple_editable_packages_should_not_race(PipenvInstance, testsroot):
|
||||
with PipenvInstance(chdir=True) as p:
|
||||
for pkg_name in pkgs:
|
||||
source_path = p._pipfile.get_fixture_path("git/{0}/".format(pkg_name)).as_posix()
|
||||
c = delegator.run("git clone {0} ./{1}".format(source_path, pkg_name))
|
||||
assert c.return_code == 0
|
||||
shutil.copytree(source_path, pkg_name)
|
||||
|
||||
pipfile_string += '"{0}" = {{path = "./{0}", editable = true}}\n'.format(pkg_name)
|
||||
|
||||
|
||||
@@ -240,15 +240,13 @@ def test_get_vcs_refs(PipenvInstance_NoPyPI):
|
||||
@pytest.mark.install
|
||||
@pytest.mark.needs_internet
|
||||
@pytest.mark.py3_only
|
||||
@pytest.mark.skip_py38
|
||||
def test_vcs_entry_supersedes_non_vcs(PipenvInstance):
|
||||
"""See issue #2181 -- non-editable VCS dep was specified, but not showing up
|
||||
in the lockfile -- due to not running pip install before locking and not locking
|
||||
the resolution graph of non-editable vcs dependencies.
|
||||
"""
|
||||
with PipenvInstance(chdir=True) as p:
|
||||
# pyinstaller_path = p._pipfile.get_fixture_path("git/pyinstaller")
|
||||
pyinstaller_uri = "https://github.com/pyinstaller/pyinstaller.git"
|
||||
jinja2_uri = p._pipfile.get_fixture_path("git/jinja2").as_uri()
|
||||
with open(p.pipfile_path, "w") as f:
|
||||
f.write(
|
||||
"""
|
||||
@@ -258,20 +256,20 @@ verify_ssl = true
|
||||
name = "pypi"
|
||||
|
||||
[packages]
|
||||
PyUpdater = "*"
|
||||
PyInstaller = {{ref = "v3.6", git = "{0}"}}
|
||||
""".format(pyinstaller_uri).strip()
|
||||
Flask = "*"
|
||||
Jinja2 = {{ref = "2.11.0", git = "{0}"}}
|
||||
""".format(jinja2_uri).strip()
|
||||
)
|
||||
c = p.pipenv("install")
|
||||
assert c.return_code == 0
|
||||
installed_packages = ["PyUpdater", "PyInstaller"]
|
||||
installed_packages = ["Flask", "Jinja2"]
|
||||
assert all([k in p.pipfile["packages"] for k in installed_packages])
|
||||
assert all([k.lower() in p.lockfile["default"] for k in installed_packages])
|
||||
assert all([k in p.lockfile["default"]["pyinstaller"] for k in ["ref", "git"]]), str(p.lockfile["default"])
|
||||
assert p.lockfile["default"]["pyinstaller"].get("ref") is not None
|
||||
assert all([k in p.lockfile["default"]["jinja2"] for k in ["ref", "git"]]), str(p.lockfile["default"])
|
||||
assert p.lockfile["default"]["jinja2"].get("ref") is not None
|
||||
assert (
|
||||
p.lockfile["default"]["pyinstaller"]["git"]
|
||||
== pyinstaller_uri
|
||||
p.lockfile["default"]["jinja2"]["git"]
|
||||
== jinja2_uri
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user