Commit 3b4496ab authored by Daniel Brown's avatar Daniel Brown
Browse files

added multiselect for starting multiple commits at once for a given set of kat files

parent 27b95bbf
...@@ -59,17 +59,19 @@ ...@@ -59,17 +59,19 @@
<div class="new_test"> <div class="new_test">
<h2>Start new test</h2> <h2>Start new test</h2>
<select id="branch_list" style="width: 100px;"> <select id="branch_list" style="width: 200px;">
<option text="develop" value="develop"/> <option text="develop" value="develop"/>
</select> </select>
<select id="commit_list" style="width: 300px;">
</select>
<input type="button" value="Refresh" id="btnGetLogs"/>
<br/> <br/>
<select style="float:left;vertical-align: top; height:210px;width:200px;" multiple="multiple" size="10" id="commit_list" style="width: 300px;">
</select>
<div style="float:left; vertical-align: display:block; width:450px; overflow:auto; padding:5px; margin-left:10px; height:200px; border: 1px solid #aaa;">
<h4 style="padding:0px; margin:0px;" id="gitDescriptionHdr">Git log description</h4>
<p id="gitDescriptionTxt">[Select item to see commit message]</p>
</div>
<br style="clear:both;" />
<input type="checkbox" id="chkNoBuild" />Use previously built kat (Will built if it can't find any previous kats of the requested version)<br> <input type="checkbox" id="chkNoBuild" />Use previously built kat (Will built if it can't find any previous kats of the requested version)<br>
<input type="button" value="Refresh branches and logs" id="btnGetLogs"/>
<input type="button" value="Start new FINESSSE test" id="btnStartTest"/> <input type="button" value="Start new FINESSSE test" id="btnStartTest"/>
<section class="container"> <section class="container">
...@@ -102,6 +104,9 @@ ...@@ -102,6 +104,9 @@
<script type="text/javascript" charset="utf8" src="http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/jquery.dataTables.min.js"></script> <script type="text/javascript" charset="utf8" src="http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/jquery.dataTables.min.js"></script>
<script type="text/JavaScript"> <script type="text/JavaScript">
var commit_msgs = {};
function sortKatList(list){ function sortKatList(list){
// resort alphabetically the options visible // resort alphabetically the options visible
var rvals = $(list); var rvals = $(list);
...@@ -154,6 +159,21 @@ ...@@ -154,6 +159,21 @@
$("#rightValues").append(selectedItem); $("#rightValues").append(selectedItem);
sortKatList("#rightValues"); sortKatList("#rightValues");
}); });
$("#commit_list").change(function(){
vals = $("#commit_list option:selected").val();
if($.isArray(vals)){
$("#gitDescriptionHdr").text("Git log: " + vals[0]);
$("#gitDescriptionTxt").text(commit_msgs[vals[0]]);
}else if(vals.length == 40){
$("#gitDescriptionHdr").text("Git log: " + vals);
$("#gitDescriptionTxt").text(commit_msgs[vals]);
}else{
$("#gitDescriptionHdr").text("Git log: ");
$("#gitDescriptionTxt").text("[Select item to see commit message]");
}
});
$('#btnGetPrevTests').click(function(){ $('#btnGetPrevTests').click(function(){
getPreviousTests(); getPreviousTests();
...@@ -470,13 +490,15 @@ ...@@ -470,13 +490,15 @@
$.ajax({ $.ajax({
type: "POST", type: "POST",
contentType: "application/json; charset=utf-8", contentType: "application/json; charset=utf-8",
url: "/finesse/get_50_" + $("#branch_list").val() + "_logs", url: "/finesse/get_100_" + $("#branch_list").val() + "_logs",
success: function (data) { success: function (data) {
logs = data.logs; logs = data.logs;
list.empty(); list.empty();
commit_msgs = {};
for(var i=0; i<logs.length; i++){ for(var i=0; i<logs.length; i++){
list.append($('<option>', { value: logs[i].commit, text: logs[i].commit + " - " + logs[i].message})); commit_msgs[logs[i].commit] = logs[i].message;
list.append($('<option>', { value: logs[i].commit, text: logs[i].commit}));
} }
$("#btnStartTest").attr("disabled", false); $("#btnStartTest").attr("disabled", false);
......
...@@ -285,6 +285,7 @@ def home_page(): ...@@ -285,6 +285,7 @@ def home_page():
@app.route('/finesse/rerun_test_<id>', methods=["POST"]) @app.route('/finesse/rerun_test_<id>', methods=["POST"])
def finesse_start_rerun(id): def finesse_start_rerun(id):
id = int(id) id = int(id)
try: try:
schedule_lock.acquire() schedule_lock.acquire()
...@@ -339,64 +340,74 @@ def finesse_start_test(): ...@@ -339,64 +340,74 @@ def finesse_start_test():
return jsonify(__finesse_start_test(request.json["git_commit"], request.json["kats"], nobuild)) return jsonify(__finesse_start_test(request.json["git_commit"], request.json["kats"], nobuild))
def __finesse_start_test(git_commit, kats, nobuild=False): def __finesse_start_test(git_commit, kats, nobuild=False):
global current_test, test_id global current_test, test_id
git_commits = []
if type(git_commit) is not list:
git_commits.append(git_commit)
elif type(git_commit) is list:
git_commits = git_commit
else:
raise Exception("git_commit variable was not a list of git commit strings or a single string git commit")
try: try:
schedule_lock.acquire() schedule_lock.acquire()
test_id += 1 for git_commit in git_commits:
TEST_OUTPUT_PATH = os.path.join(app.instance_path, "tests")
if not os.path.exists(TEST_OUTPUT_PATH):
os.mkdir(TEST_OUTPUT_PATH)
TEST_RUN_PATH = os.path.join(TEST_OUTPUT_PATH, str(test_id)) test_id += 1
if os.path.exists(TEST_RUN_PATH): TEST_OUTPUT_PATH = os.path.join(app.instance_path, "tests")
shutil.rmtree(TEST_RUN_PATH)
os.mkdir(TEST_RUN_PATH) if not os.path.exists(TEST_OUTPUT_PATH):
os.mkdir(TEST_OUTPUT_PATH)
# if we are not building then check to see if we can find a previous version
# of kat and if so put it in the correct folder for the test to find
if nobuild:
if sys.platform == "win32":
EXE = ".exe"
else:
EXE = ""
TEST_BUILD_PATH = os.path.join(TEST_RUN_PATH,"build") TEST_RUN_PATH = os.path.join(TEST_OUTPUT_PATH, str(test_id))
KAT_EXE = os.path.join(app.instance_path, "kat_store", "kat_" + str(git_commit) + EXE)
if os.path.exists(KAT_EXE): if os.path.exists(TEST_RUN_PATH):
print "using existing kat file " + KAT_EXE shutil.rmtree(TEST_RUN_PATH)
utils.git(["clone","git://gitmaster.atlas.aei.uni-hannover.de/finesse/base.git",TEST_BUILD_PATH])
KAT_NEW_EXE = os.path.join(TEST_BUILD_PATH,"kat" + EXE)
shutil.copyfile(KAT_EXE, KAT_NEW_EXE)
os.mkdir(TEST_RUN_PATH)
print "nobuild", nobuild
# if we are not building then check to see if we can find a previous version
test = finesse_test.FinesseTestProcess(os.path.join(app.instance_path, "finesse_test"), # of kat and if so put it in the correct folder for the test to find
TEST_RUN_PATH, if nobuild:
git_commit, if sys.platform == "win32":
run_fast=False, kats=kats, test_id=test_id, EXE = ".exe"
emails="", nobuild=nobuild) else:
EXE = ""
db.insert(dict(t="test",
test_id=test.test_id, TEST_BUILD_PATH = os.path.join(TEST_RUN_PATH,"build")
git_commit=test.get_version(), KAT_EXE = os.path.join(app.instance_path, "kat_store", "kat_" + str(git_commit) + EXE)
cancelled=test.cancelling,
error=test.errorOccurred, if os.path.exists(KAT_EXE):
diffFound=test.diffFound, print "using existing kat file " + KAT_EXE
testFinished=test.finished_test)) utils.git(["clone","git://gitmaster.atlas.aei.uni-hannover.de/finesse/base.git",TEST_BUILD_PATH])
KAT_NEW_EXE = os.path.join(TEST_BUILD_PATH,"kat" + EXE)
__run_new(test) shutil.copyfile(KAT_EXE, KAT_NEW_EXE)
test = finesse_test.FinesseTestProcess(os.path.join(app.instance_path, "finesse_test"),
TEST_RUN_PATH,
git_commit,
run_fast=False, kats=kats, test_id=test_id,
emails="", nobuild=nobuild)
db.insert(dict(t="test",
test_id=test.test_id,
git_commit=test.get_version(),
cancelled=test.cancelling,
error=test.errorOccurred,
diffFound=test.diffFound,
testFinished=test.finished_test))
__run_new(test)
finally: finally:
schedule_lock.release() schedule_lock.release()
return {'id':test.test_id} return {'OK'}
@app.route('/finesse/get_tests', methods=["POST"]) @app.route('/finesse/get_tests', methods=["POST"])
def finesse_get_tests(): def finesse_get_tests():
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment