From 0af5658b090e507b75fa93b9cd18904d99fd8f52 Mon Sep 17 00:00:00 2001 From: Egor Matveev Date: Tue, 8 Feb 2022 00:09:42 +0300 Subject: [PATCH] checker --- SprintLib/testers/BaseTester.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SprintLib/testers/BaseTester.py b/SprintLib/testers/BaseTester.py index a0ccbdb..8e16ade 100644 --- a/SprintLib/testers/BaseTester.py +++ b/SprintLib/testers/BaseTester.py @@ -43,7 +43,6 @@ class BaseTester: with open(join(self.path, 'expected.txt'), 'w') as fs: fs.write(self.predicted) try: - call(f"docker run --name solution_{self.solution.id}_checker --volume=/sprint-data/solutions/{self.solution.id}:/app -t -d python:3.6", shell=True) 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) @@ -96,6 +95,8 @@ class BaseTester: docker_command = f"docker run --name solution_{self.solution.id} --volume=/sprint-data/solutions/{self.solution.id}:/{self.working_directory} -t -d {self.solution.language.image}" print(docker_command) call(docker_command, shell=True) + if len(ExtraFile.objects.filter(task=self.solution.task, filename='checker.py')) != 0: + call(f"docker run --name solution_{self.solution.id}_checker --volume=/sprint-data/solutions/{self.solution.id}:/app -t -d python:3.6", shell=True) print("Container created") for file in ExtraFile.objects.filter(task=self.solution.task): with open(