Various improvements to unit test running
- units.sh should exit on error. - Add race detector to unit test runner. - Use local testing/cover/cover tool in gen_coverage_report.sh and units.sh - Use the scheduler to parallelise the unit tests. - Make test run id a string and differentiate between unit runs and integration runs in the scheduler. - Pipe circle env vars through to build container so we can detect when to use the scheduler - Add python requests to the weave build container. - Quote test names in urls, make flask handle url segments with slashes in.
This commit is contained in:
1 parent
7aab5cc5b4
commit
13f1239a3e
12 files changed
+82
-33
No files matched your search
@@ -0,0 +1,7 @@
|
||||
*.egg-info
|
||||
*.dist-info
|
||||
flask
|
||||
jinja2
|
||||
markupsafe
|
||||
werkzeug
|
||||
itsdangerous.*
|
||||
@@ -0,0 +1,6 @@
|
||||
To upload newer version:
|
||||
|
||||
```
|
||||
pip install -r requirements.txt -t .
|
||||
appcfg.py update .
|
||||
```
|
||||
@@ -19,7 +19,7 @@ class Test(ndb.Model):
|
||||
class Schedule(ndb.Model):
|
||||
shards = ndb.JsonProperty()
|
||||
|
||||
@app.route('/record/<test_name>/<runtime>', methods=['POST'])
|
||||
@app.route('/record/<path:test_name>/<runtime>', methods=['POST'])
|
||||
@ndb.transactional
|
||||
def record(test_name, runtime):
|
||||
test = Test.get_by_id(test_name)
|
||||
@@ -30,13 +30,13 @@ def record(test_name, runtime):
|
||||
test.put()
|
||||
return ('', 204)
|
||||
|
||||
@app.route('/schedule/<int:test_run>/<int:shard_count>/<int:shard>', methods=['POST'])
|
||||
@app.route('/schedule/<test_run>/<int:shard_count>/<int:shard>', methods=['POST'])
|
||||
def schedule(test_run, shard_count, shard):
|
||||
# read tests from body
|
||||
test_names = flask.request.get_json(force=True)['tests']
|
||||
|
||||
# first see if we have a scedule already
|
||||
schedule_id = "%d-%d" % (test_run, shard_count)
|
||||
schedule_id = "%s-%d" % (test_run, shard_count)
|
||||
schedule = Schedule.get_by_id(schedule_id)
|
||||
if schedule is not None:
|
||||
return flask.json.jsonify(tests=schedule.shards[str(shard)])
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
flask
|
||||
Reference in new issue
Block a user