Skip to content

Commit

Permalink
rolled back commit which added installer (will put on separate fork i…
Browse files Browse the repository at this point in the history
…nstead
  • Loading branch information
vkethana committed Jul 17, 2024
1 parent 13f2894 commit 2df3a6d
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 40 deletions.
5 changes: 1 addition & 4 deletions r2e/generators/testgen/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,8 @@ class TestGenArgs(LLMArgs):
None,
description="The input file for the test generator",
)

exp_id: str = Field(
"temp",
description="Experiment ID used for prefixing the generated tests file.",
)
max_tests: int = Field(
None,
description="Maximum number of tests you want to generate",
)
24 changes: 0 additions & 24 deletions r2e/generators/testgen/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,35 +28,11 @@ class R2ETestGenerator:
def generate(args):
"""Generate tests for functions"""
functions = load_functions(EXTRACTED_DATA_DIR / args.in_file)
#print(type(functions))
#print(len(functions))
#print(functions)
function_names = ([i.function_id.identifier.replace('main.', '') for i in functions])

if args.max_tests:
functions = functions[0:args.max_tests]

print(functions)
print(type(functions))
print(len(functions))

tasks = R2ETestGenerator.prepare_tasks(functions)
payloads = [task.chat_messages for task in tasks]

outputs = LLMCompletions.get_llm_completions(args, payloads)
# If any of the words in function_names, replace them with themselves+"reference_" prepended
print(outputs)
for i in range(len(outputs)):
for j in range(len(function_names)):
#outputs[i][0] = outputs[i][0].replace(function_names[j], "reference_"+function_names[j])
outputs[i][0] = outputs[i][0].replace(function_names[j], "reference_"+function_names[j])
outputs[i][0] = outputs[i][0].replace("reference_reference_", "reference_")


print(outputs)
print(len(outputs))
print(type(outputs))


results = get_generated_tests(outputs)
futs = [create_code_under_test(func) for func in functions]
Expand Down
12 changes: 0 additions & 12 deletions r2e/installer.py

This file was deleted.

0 comments on commit 2df3a6d

Please sign in to comment.