(self, code_id, test_id)
| 167 | self.total_tests_requested += 1 |
| 168 | |
| 169 | def test_pair(self, code_id, test_id): |
| 170 | exit_code, logs = copy_and_run_pytest( |
| 171 | args.sources_dirname, |
| 172 | args.function_name, |
| 173 | code_id, |
| 174 | test_id, |
| 175 | self.docker_execute) |
| 176 | |
| 177 | if exit_code != 0: |
| 178 | logging.info(f"Test failed: code {code_id} <-> test {test_id}: exit_code={exit_code} logs={logs}") |
| 179 | |
| 180 | if len(logs) == "": |
| 181 | logging.info("Test failed really badly somehow. Deleting {code_id} and {test_id} to avoid repeating this error.") |
| 182 | self.codes.remove(code_id) |
| 183 | self.tests.remove(test_id) |
| 184 | return False |
| 185 | |
| 186 | logging.info(f"Test passed: code {code_id} <-> test {test_id} - Asking judge if we are done") |
| 187 | |
| 188 | code = self.contents[code_id] |
| 189 | test = self.contents[test_id] |
| 190 | judge_id = self.manager.add_judge_pair_job(code, test) |
| 191 | self.pair_scores[judge_id] = (code_id, test_id, None) |
| 192 | |
| 193 | return True |
| 194 | |
| 195 | def handle_code(self, code_id, code, score, improved=False): |
| 196 | print(f"Task ID {code_id}: Generated code (improved={improved}) with score {score} and len={len(code)}") |
no test coverage detected