Skip to content

Commit 16065e0

Browse files
authored
Merge pull request #49 from commit-0/fix-test
Fix test
2 parents 2f7a044 + 9da2aa5 commit 16065e0

File tree

120 files changed

+38
-26
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+38
-26
lines changed

agent/run_agent.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,17 @@ def run_agent_for_repo(
115115
message = get_message(
116116
agent_config, repo_path, test_dir=example["test"]["test_dir"]
117117
)
118+
agent_config_log_file = os.path.abspath(
119+
RUN_AIDER_LOG_DIR / "no_tests" / ".agent.yaml"
120+
)
121+
os.makedirs(os.path.dirname(agent_config_log_file), exist_ok=True)
122+
# write agent_config to .agent.yaml
123+
with open(agent_config_log_file, "w") as agent_config_file:
124+
yaml.dump(agent_config, agent_config_file)
125+
118126
for f in target_edit_files:
119127
file_name = f.replace(".py", "").replace("/", "__")
120128
log_dir = RUN_AIDER_LOG_DIR / "no_tests" / file_name
121-
# write agent_config to .agent.yaml
122-
with open(
123-
RUN_AIDER_LOG_DIR / "no_tests" / file_name / ".agent.yaml", "w"
124-
) as agent_config_file:
125-
yaml.dump(agent_config, agent_config_file)
126129
lint_cmd = get_lint_cmd(local_repo, agent_config.use_lint_info)
127130
agent.run(message, "", lint_cmd, [f], log_dir)
128131

commit0/cli.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,10 @@ def test(
221221
timeout: int = typer.Option(1800, help="Timeout for tests in seconds"),
222222
num_cpus: int = typer.Option(1, help="Number of CPUs to use"),
223223
reference: Annotated[
224-
bool, typer.Option("--reference", help="Test the reference commit.")
224+
bool, typer.Option("--reference", help="Test the reference commit")
225+
] = False,
226+
coverage: Annotated[
227+
bool, typer.Option("--coverage", help="Whether to get coverage information")
225228
] = False,
226229
rebuild: bool = typer.Option(
227230
False, "--rebuild", help="Whether to rebuild an image"
@@ -266,6 +269,7 @@ def test(
266269
repo_or_repo_path,
267270
branch, # type: ignore
268271
test_ids,
272+
coverage,
269273
backend,
270274
timeout,
271275
num_cpus,
@@ -286,6 +290,9 @@ def evaluate(
286290
reference: Annotated[
287291
bool, typer.Option("--reference", help="Evaluate the reference commit.")
288292
] = False,
293+
coverage: Annotated[
294+
bool, typer.Option("--coverage", help="Whether to get coverage information")
295+
] = False,
289296
commit0_dot_file_path: str = typer.Option(
290297
".commit0.yaml",
291298
help="Path to the commit0 dot file, where the setup config is stored",
@@ -309,6 +316,7 @@ def evaluate(
309316
commit0_config["repo_split"],
310317
commit0_config["base_dir"],
311318
branch,
319+
coverage,
312320
backend,
313321
timeout,
314322
num_cpus,

commit0/data/test_ids/attrs.bz2

7.75 KB
Binary file not shown.
-7.87 KB
Binary file not shown.

commit0/data/test_ids/babel.bz2

17.2 KB
Binary file not shown.
-17.3 KB
Binary file not shown.
5.34 KB
Binary file not shown.
-5.46 KB
Binary file not shown.
996 Bytes
Binary file not shown.
-1.08 KB
Binary file not shown.

0 commit comments

Comments
 (0)