Improved extension test runner
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Armin Ronacher · committed by Armin Ronacher · parent d455135 · Browse files · 1 file·+23 added−5 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
1 file+23 added−5 removed
- tests:+23 added−5 removed
Provenance
- Commit
63a37b7- Tree
569c7a2- Author
Armin Ronacher <armin.ronacher@active-4.com>- Committer
Armin Ronacher <armin.ronacher@active-4.com>- Parent
d455135
1 file changed+23 added−5 removed
modified:tests/flaskext_test.py+23 added-5 removed
72 unmodified lines73 <th>Version74 <th>Author75 <th>License76 <th>Outcome77+ {%- for iptr, _ in results[0].logs|dictsort %}78+ <th>{{ iptr }}79+ {%- endfor %}80 </tr>81 </thead>82 <tbody>83 {%- for result in results %}3 unmodified lines87 <td>{{ result.version }}88 <td>{{ result.author }}89 <td>{{ result.license }}90 <td>{{ outcome }}91+ {%- for iptr, _ in result.logs|dictsort %}92+ <td><a href="#{{ result.name }}-{{ iptr }}">see log</a>93+ {%- endfor %}94 </tr>95 {%- endfor %}96 </tbody>97 </table>98 <h2>Test Logs</h2>99 <p>Detailed test logs for all tests on all platforms:100 {%- for result in results %}101 {%- for iptr, log in result.logs|dictsort %}102+ <h3 id="{{ result.name }}-{{ iptr }}">96- <h3>{{ result.name }} - {{ result.version }} [{{ iptr }}]</h3>103+ {{ result.name }} - {{ result.version }} [{{ iptr }}]</h3>104 <pre>{{ log }}</pre>105 {%- endfor %}106 {%- endfor %}107 '''135 unmodified lines243 rv = subprocess.call(['tox'], cwd=checkout_path)244 return TestResult(name, checkout_path, rv, interpreters)245 246 240-def run_tests(interpreters, only_approved=True):247+def run_tests(extensions, interpreters):248 results = {}249 create_tdir()250 log('Packaging Flask')251 flask_dep = package_flask()252 log('Running extension tests')253 log('Temporary Environment: %s', tdir)247- for name in iter_extensions(only_approved):254+ for name in extensions:255 log('Testing %s', name)256 result = test_extension(name, interpreters, flask_dep)257 if result.success:258 log('Extension test succeeded')19 unmodified lines278 parser.add_argument('--all', dest='all', action='store_true',279 help='run against all extensions, not just approved')280 parser.add_argument('--browse', dest='browse', action='store_true',281 help='show browser with the result summary')282+ parser.add_argument('--env', dest='env', default='py25,py26,py27',283+ help='the tox environments to run against')284+ parser.add_argument('--extension=', dest='extension', default=None,285+ help='tests a single extension')286 args = parser.parse_args()287 288+ if args.extension is not None:289+ only_approved = False290+ extensions = [args.extension]291+ else:292+ only_approved = not args.all293+ extensions = iter_extensions(only_approved)294+277- results = run_tests(['py26'], not args.all)278- filename = render_results(results, not args.all)295+ results = run_tests(extensions, [x.strip() for x in args.env.split(',')])296+ filename = render_results(results, only_approved)297 if args.browse:298 import webbrowser299 webbrowser.open('file:///' + filename.lstrip('/'))300 print 'Results written to', filename4 unmodified lines