checker
This commit is contained in:
parent
0af5658b09
commit
574f9f63db
@ -42,10 +42,7 @@ class BaseTester:
|
|||||||
if exists(join(self.path, "checker.py")):
|
if exists(join(self.path, "checker.py")):
|
||||||
with open(join(self.path, 'expected.txt'), 'w') as fs:
|
with open(join(self.path, 'expected.txt'), 'w') as fs:
|
||||||
fs.write(self.predicted)
|
fs.write(self.predicted)
|
||||||
try:
|
code = call(f'docker exec -i solution_{self.solution.id}_checker sh -c "cd app && python checker.py"', shell=True, timeout=1)
|
||||||
code = call(f'docker exec -i solution_{self.solution.id}_checker sh -c "cd app && python checker.py"', shell=True, timeout=1)
|
|
||||||
finally:
|
|
||||||
call(f"docker rm --force solution_{self.solution.id}_checker", shell=True)
|
|
||||||
if code != 0:
|
if code != 0:
|
||||||
raise TestException("WA")
|
raise TestException("WA")
|
||||||
else:
|
else:
|
||||||
@ -137,6 +134,7 @@ class BaseTester:
|
|||||||
raise e
|
raise e
|
||||||
self.solution.save()
|
self.solution.save()
|
||||||
call(f"docker rm --force solution_{self.solution.id}", shell=True)
|
call(f"docker rm --force solution_{self.solution.id}", shell=True)
|
||||||
|
call(f"docker rm --force solution_{self.solution.id}_checker", shell=True)
|
||||||
self.solution.user.userinfo.refresh_from_db()
|
self.solution.user.userinfo.refresh_from_db()
|
||||||
if self.solution.user.userinfo.notification_solution_result:
|
if self.solution.user.userinfo.notification_solution_result:
|
||||||
bot.send_message(
|
bot.send_message(
|
||||||
|
Loading…
Reference in New Issue
Block a user