-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Functional replacement for Tag Collector build queue.
RESTful service to schedule and keep track of the build requests added. It implements the following APIs: GET /buildrequests GET /buildrequests/<id> POST /buildrequests PATCH /buildrequests/<id> DELETE /buildrequests/<id>[,<id>] more descriptions about those can be found in the README.md manual.
- Loading branch information
Showing
4 changed files
with
219 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/usr/bin/env python | ||
|
||
from urllib2 import urlopen, Request | ||
import urllib | ||
import json | ||
TEST_SERVER_URL="https://localhost:8443/cgi-bin/buildrequests" | ||
|
||
# Get all requests. | ||
print urlopen(TEST_SERVER_URL).read() | ||
# Create a request. | ||
request = { | ||
"architecture": "slc5_amd64_gcc472", | ||
"release_name": "CMSSW_6_2_X_2013-04-08-0200", | ||
"repository": "cms", | ||
"PKGTOOLS": "ktf:my-branch", | ||
"CMSDIST": "ktf:another-branch", | ||
"ignoreErrors": True, | ||
"package": "cmssw-ib", | ||
"continuations": "cmssw-qa:slc5_amd64_gcc472", | ||
"syncBack": False, | ||
"debug": False, | ||
"hostnameFilter": ".*", | ||
} | ||
result = json.loads(urlopen(TEST_SERVER_URL, json.dumps(request)).read()) | ||
print result | ||
print result["id"] | ||
assert(result["hostnameFilter"] == ".*") | ||
# Update the lastModiied timestamp. | ||
update = { | ||
"state": "Stopped", | ||
"pid": "100", | ||
"url": "http://www.foo.bar", | ||
} | ||
req = Request(url=TEST_SERVER_URL + "/" + result["id"], | ||
data=json.dumps(update)) | ||
req.get_method = lambda : "PATCH" | ||
print "update" | ||
result = json.loads(urlopen(req).read()) | ||
assert(result["pid"] == "100") | ||
assert(result["state"] == "Stopped") | ||
assert(result["url"] == "http://www.foo.bar") | ||
# Delete the request just created. | ||
print "delete" | ||
req = Request(url=TEST_SERVER_URL + "/" + str(int(result["id"])-1) + "," + result["id"]) | ||
req.get_method = lambda : "DELETE" | ||
print urlopen(req).read() |