|
|
@ -85,9 +85,6 @@ class MyshixunsController < ApplicationController
|
|
|
|
# "createPod":"1.610","evaluateAllTime":2820,"evaluateStart":"2017-11-24 11:04:35","execute":"0.294"}'
|
|
|
|
# "createPod":"1.610","evaluateAllTime":2820,"evaluateStart":"2017-11-24 11:04:35","execute":"0.294"}'
|
|
|
|
# params[:pics] = "a.png,b.png,c.png"
|
|
|
|
# params[:pics] = "a.png,b.png,c.png"
|
|
|
|
def training_task_status
|
|
|
|
def training_task_status
|
|
|
|
logger.info("123################{params[:jsonTestDetails]}")
|
|
|
|
|
|
|
|
logger.info("456################{params[:timeCost]}")
|
|
|
|
|
|
|
|
logger.info("666###############{params}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ActiveRecord::Base.transaction do
|
|
|
|
ActiveRecord::Base.transaction do
|
|
|
|
begin
|
|
|
|
begin
|
|
|
@ -98,13 +95,14 @@ class MyshixunsController < ApplicationController
|
|
|
|
return_back_time = format("%.3f", ( t1.to_f - brige_end_time.to_f)).to_f
|
|
|
|
return_back_time = format("%.3f", ( t1.to_f - brige_end_time.to_f)).to_f
|
|
|
|
status = jsonTestDetails['status']
|
|
|
|
status = jsonTestDetails['status']
|
|
|
|
game_id = jsonTestDetails['buildID']
|
|
|
|
game_id = jsonTestDetails['buildID']
|
|
|
|
|
|
|
|
sec_key = jsonTestDetails['sec_key']
|
|
|
|
logger.info("training_task_status start#1**#{game_id}**** #{Time.now.strftime("%Y-%m-%d %H:%M:%S.%L")}")
|
|
|
|
logger.info("training_task_status start#1**#{game_id}**** #{Time.now.strftime("%Y-%m-%d %H:%M:%S.%L")}")
|
|
|
|
resubmit = jsonTestDetails['resubmit']
|
|
|
|
resubmit = jsonTestDetails['resubmit']
|
|
|
|
outPut = tran_base64_decode64(jsonTestDetails['outPut'])
|
|
|
|
outPut = tran_base64_decode64(jsonTestDetails['outPut'])
|
|
|
|
jenkins_testsets = jsonTestDetails['msg']
|
|
|
|
jenkins_testsets = jsonTestDetails['msg']
|
|
|
|
compile_success = jsonTestDetails['compileSuccess']
|
|
|
|
compile_success = jsonTestDetails['compileSuccess']
|
|
|
|
# message = Base64.decode64(params[:msg]) unless params[:msg].blank?
|
|
|
|
# message = Base64.decode64(params[:msg]) unless params[:msg].blank?
|
|
|
|
logger.info(outPut)
|
|
|
|
|
|
|
|
game = Game.find(game_id)
|
|
|
|
game = Game.find(game_id)
|
|
|
|
myshixun = game.myshixun
|
|
|
|
myshixun = game.myshixun
|
|
|
|
challenge = game.challenge
|
|
|
|
challenge = game.challenge
|
|
|
@ -125,7 +123,7 @@ class MyshixunsController < ApplicationController
|
|
|
|
logger.info "actual_output:################################################# #{actual_output}"
|
|
|
|
logger.info "actual_output:################################################# #{actual_output}"
|
|
|
|
Output.create!(:code => status, :game_id => game_id, :out_put => outPut, :test_set_position => j_test_set['caseId'],
|
|
|
|
Output.create!(:code => status, :game_id => game_id, :out_put => outPut, :test_set_position => j_test_set['caseId'],
|
|
|
|
:actual_output => actual_output, :result => j_test_set['passed'].to_i, :query_index => max_query_index,
|
|
|
|
:actual_output => actual_output, :result => j_test_set['passed'].to_i, :query_index => max_query_index,
|
|
|
|
:compile_success => compile_success.to_i)
|
|
|
|
:compile_success => compile_success.to_i, :sec_key => sec_key)
|
|
|
|
# 如果设置了按测试集给分,则需要统计测试集的分值
|
|
|
|
# 如果设置了按测试集给分,则需要统计测试集的分值
|
|
|
|
if challenge.test_set_score && j_test_set['passed'].to_i == 1
|
|
|
|
if challenge.test_set_score && j_test_set['passed'].to_i == 1
|
|
|
|
test_set_score += challenge.test_sets.where(:position => j_test_set['caseId']).pluck(:score).first
|
|
|
|
test_set_score += challenge.test_sets.where(:position => j_test_set['caseId']).pluck(:score).first
|
|
|
|