Browse Source

Improved extension test runner

pull/112/head
Armin Ronacher 15 years ago
parent
commit
63a37b75ac
  1. 28
      tests/flaskext_test.py

28
tests/flaskext_test.py

@ -74,6 +74,9 @@ RESULT_TEMPATE = u'''\
<th>Author
<th>License
<th>Outcome
{%- for iptr, _ in results[0].logs|dictsort %}
<th>{{ iptr }}
{%- endfor %}
</tr>
</thead>
<tbody>
@ -85,6 +88,9 @@ RESULT_TEMPATE = u'''\
<td>{{ result.author }}
<td>{{ result.license }}
<td>{{ outcome }}
{%- for iptr, _ in result.logs|dictsort %}
<td><a href="#{{ result.name }}-{{ iptr }}">see log</a>
{%- endfor %}
</tr>
{%- endfor %}
</tbody>
@ -93,7 +99,8 @@ RESULT_TEMPATE = u'''\
<p>Detailed test logs for all tests on all platforms:
{%- for result in results %}
{%- for iptr, log in result.logs|dictsort %}
<h3>{{ result.name }} - {{ result.version }} [{{ iptr }}]</h3>
<h3 id="{{ result.name }}-{{ iptr }}">
{{ result.name }} - {{ result.version }} [{{ iptr }}]</h3>
<pre>{{ log }}</pre>
{%- endfor %}
{%- endfor %}
@ -237,14 +244,14 @@ def test_extension(name, interpreters, flask_dep):
return TestResult(name, checkout_path, rv, interpreters)
def run_tests(interpreters, only_approved=True):
def run_tests(extensions, interpreters):
results = {}
create_tdir()
log('Packaging Flask')
flask_dep = package_flask()
log('Running extension tests')
log('Temporary Environment: %s', tdir)
for name in iter_extensions(only_approved):
for name in extensions:
log('Testing %s', name)
result = test_extension(name, interpreters, flask_dep)
if result.success:
@ -272,10 +279,21 @@ def main():
help='run against all extensions, not just approved')
parser.add_argument('--browse', dest='browse', action='store_true',
help='show browser with the result summary')
parser.add_argument('--env', dest='env', default='py25,py26,py27',
help='the tox environments to run against')
parser.add_argument('--extension=', dest='extension', default=None,
help='tests a single extension')
args = parser.parse_args()
results = run_tests(['py26'], not args.all)
filename = render_results(results, not args.all)
if args.extension is not None:
only_approved = False
extensions = [args.extension]
else:
only_approved = not args.all
extensions = iter_extensions(only_approved)
results = run_tests(extensions, [x.strip() for x in args.env.split(',')])
filename = render_results(results, only_approved)
if args.browse:
import webbrowser
webbrowser.open('file:///' + filename.lstrip('/'))

Loading…
Cancel
Save