Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

Commit

Permalink
Merge fbefca2 into 730d9b1
Browse files Browse the repository at this point in the history
  • Loading branch information
usize committed Feb 12, 2015
2 parents 730d9b1 + fbefca2 commit c7ce5ef
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
9 changes: 8 additions & 1 deletion relengapi/blueprints/clobberer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,18 @@ def branches():
return [branch[0] for branch in branches]


@bp.route('/lastclobber/all', methods=['GET'])
@apimethod([rest.ClobberTime])
def lastclobber_all():
"Return a sorted list of all clobbers"
session = g.db.session(DB_DECLARATIVE_BASE)
return session.query(ClobberTime).order_by(ClobberTime.lastclobber)


@bp.route('/lastclobber/branch/by-builder/<string:branch>', methods=['GET'])
@apimethod({unicode: [rest.ClobberTime]}, unicode)
def lastclobber_by_builder(branch):
"Return a dictionary of most recent ClobberTimes grouped by buildername."

session = g.db.session(DB_DECLARATIVE_BASE)

# Isolates the maximum lastclobber for each builddir on a branch
Expand Down
8 changes: 8 additions & 0 deletions relengapi/blueprints/clobberer/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ def test_clobber_request(client):
'No new clobbers were detected, clobber request failed.')


@ test_context
def test_lastclobber_all(client):
rv = client.get('/clobberer/lastclobber/all')
eq_(rv.status_code, 200)
clobbertimes = json.loads(rv.data)["result"]
eq_(len(clobbertimes), len(_clobber_args))


@test_context
def test_clobber_request_of_release(client):
"Ensures that attempting to clobber a release build will fail."
Expand Down

0 comments on commit c7ce5ef

Please sign in to comment.