More client work .. reports wrong benches.

Just need report NPS after running benches

Just need report Results after games
This commit is contained in:
AndyGrant committed 2018-06-11 23:51:25 -04:00
1 parent 009424b616
commit dcce521447
6 files changed
+236 -214

No files matched your search

+1 -1
View File
@@ -27,6 +27,6 @@ urlpatterns = [
path(r'getFiles/', OpenBench.views.getFiles),
path(r'getWorkload/', OpenBench.views.getWorkload),
path(r'wrongBench/', OpenBench.views.wrongBench),
path(r'submitResults/', OpenBench.views.submitResults),
path(r'invalidBench/', OpenBench.views.invalidBench),
]
+3 -1
View File
@@ -69,7 +69,7 @@ def newTest(request):
def getEngine(name, source, protocol, sha, bench):
# Engine may already exist, which is okay
try: return Engine.objects.get(sha=sha)
try: return Engine.objects.get(name=name, source=source, protocol=protocol, sha=sha, bench=bench)
except: pass
# Build new Engine
@@ -169,6 +169,7 @@ def workloadDictionary(machine, result, test):
'booksource' : FRAMEWORK_REPO_URL + '/raw/master/Books/',
'timecontrol' : test.timecontrol,
'dev' : {
'id' : test.dev.id,
'name' : test.dev.name,
'source' : test.dev.source,
'protocol' : test.dev.protocol,
@@ -177,6 +178,7 @@ def workloadDictionary(machine, result, test):
'options' : test.devoptions,
},
'base' : {
'id' : test.base.id,
'name' : test.base.name,
'source' : test.base.source,
'protocol' : test.base.protocol,
+29 -8
View File
@@ -324,7 +324,7 @@ def deleteTest(request, id):
# Delete the provided test
test = Test.objects.get(id=id)
test.delete = True
test.deleted = True
test.save()
# Log the test deltion
@@ -343,7 +343,7 @@ def deleteTest(request, id):
def getFiles(request):
# Core Files should be sitting in framework's repo
source = FRAMEWORK_REPO_URL + '/raw/master/CoreFiles/'
source = FRAMEWORK_REPO_URL + 'raw/master/CoreFiles/'
return HttpResponse(source)
@csrf_exempt
@@ -374,13 +374,34 @@ def getWorkload(request):
# Send ID's and test information as a string dictionary
return HttpResponse(str(OpenBench.utils.workloadDictionary(machine, result, test)))
@csrf_exempt
def wrongBench(request):
# Attempt to login in user
try: loginUser(request, authenticate(
username=request.POST['username'],
password=request.POST['password']))
except: return HttpResponse('Bad Credentials')
# Find the engine with the bad bench
engineid = int(request.POST['engineid'])
engine = Engine.objects.get(id=engineid)
# Find and stop the test with the bad bench
testid = int(request.POST['testid'])
test = Test.objects.get(id=testid)
test.finished = True
test.save()
# Log the bad bench so we know why the test was stopped
LogEvent.objects.create(
data='Invalid bench for {0} with {1}'.format(str(test), str(engine)),
author=request.POST['username']
)
return HttpResponse('None')
@csrf_exempt
def submitResults(request):
pass
@csrf_exempt
def invalidBench(request):
pass