[pypy-commit] buildbot default: run own tests in a virtualenv, document the virtualenv requirement
mattip
pypy.commits at gmail.com
Mon Feb 22 11:11:56 EST 2016
Author: mattip <matti.picus at gmail.com>
Branch:
Changeset: r988:d0965d2a7c68
Date: 2016-02-22 17:03 +0100
http://bitbucket.org/pypy/buildbot/changeset/d0965d2a7c68/
Log: run own tests in a virtualenv, document the virtualenv requirement
diff --git a/README_BUILDSLAVE b/README_BUILDSLAVE
--- a/README_BUILDSLAVE
+++ b/README_BUILDSLAVE
@@ -2,7 +2,8 @@
==================================
The recommended setup is to have a "pypy" in your path that will translate and
-a "python" (cpython) in your path that will run the test suites.
+a "python" (cpython) in your path that will run the test suites. You will also
+need a "virtualenv" in your path that will create a cpython virtualenv.
Then you will need to install the ``buildbot-slave`` package, which will
install many other packages like twised, so you may prefer to run the
diff --git a/bot2/pypybuildbot/builds.py b/bot2/pypybuildbot/builds.py
--- a/bot2/pypybuildbot/builds.py
+++ b/bot2/pypybuildbot/builds.py
@@ -406,7 +406,7 @@
# If target_tmpdir is empty, crash.
tmp_or_crazy = '%(prop:target_tmpdir:-crazy/name/so/mkdir/fails/)s'
pytest = "pytest"
- factory.addStep(PytestCmd(
+ factory.addStep(ShellCmd(
description="mkdir for tests",
command=['python', '-c', Interpolate("import os; os.mkdir(r'" + \
tmp_or_crazy + pytest + "') if not os.path.exists(r'" + \
@@ -505,7 +505,7 @@
# If target_tmpdir is empty, crash.
tmp_or_crazy = '%(prop:target_tmpdir:-crazy/name/so/mkdir/fails/)s'
pytest = "pytest"
- self.addStep(PytestCmd(
+ self.addStep(ShellCmd(
description="mkdir for tests",
command=['python', '-c', Interpolate("import os; os.mkdir(r'" + \
tmp_or_crazy + pytest + "') if not os.path.exists(r'" + \
@@ -527,9 +527,26 @@
haltOnFailure=False,
))
+ self.addStep(ShellCmd(
+ description="create virtualenv for tests",
+ command=['virtualenv', 'virt_test'],
+ haltOnFailure=True,
+ ))
+
+ if platform == 'win32':
+ virt_python = 'virt_test/Scripts/python'
+ else:
+ virt_python = 'virt_test/bin/python'
+
+ self.addStep(ShellCmd(
+ description="install requirments to virtual environment",
+ command=[virt_python, '-mpip', 'install', '-r', 'requirements.txt'],
+ haltOnFailure=True,
+ ))
+
self.addStep(PytestCmd(
description="pytest pypy",
- command=["python", "testrunner/runner.py",
+ command=[virt_python, "testrunner/runner.py",
"--logfile=testrun.log",
"--config=pypy/testrunner_cfg.py",
"--config=~/machine_cfg.py",
@@ -544,7 +561,7 @@
self.addStep(PytestCmd(
description="pytest rpython",
- command=["python", "testrunner/runner.py",
+ command=[virt_python, "testrunner/runner.py",
"--logfile=testrun.log",
"--config=pypy/testrunner_cfg.py",
"--config=~/machine_cfg.py",
@@ -707,6 +724,7 @@
self.addStep(Translate(translationArgs, targetArgs,
interpreter=interpreter))
+
name = build_name(platform, flags=translationArgs)
self.addStep(ShellCmd(
description="compress pypy-c",
@@ -809,18 +827,14 @@
'--upload-executable', 'pypy-c' + postfix,
'--upload-project', 'PyPy',
'--revision', WithProperties('%(got_revision)s'),
- # HACK: branches are not uploaded any more, so that
- # codespeed will display it, even if not "default"
- #'--branch', WithProperties('%(branch)s'),
+ '--branch', WithProperties('%(branch)s'),
'--upload-urls', 'http://speed.pypy.org/',
'--upload-baseline',
'--upload-baseline-executable', 'pypy-c-jit' + postfix,
'--upload-baseline-project', 'PyPy',
'--upload-baseline-revision',
WithProperties('%(got_revision)s'),
- # HACK: branches are not uploaded any more, so that
- # codespeed will display it, even if not "default"
- #'--upload-baseline-branch', WithProperties('%(branch)s'),
+ '--upload-baseline-branch', WithProperties('%(branch)s'),
'--upload-baseline-urls', 'http://speed.pypy.org/',
],
workdir='./benchmarks',
More information about the pypy-commit
mailing list