-
Notifications
You must be signed in to change notification settings - Fork 392
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tr/making the tests great #50
Conversation
PR Review 🔍
|
CI Failure Feedback 🧐(Checks updated until commit 0f9463e)
✨ CI feedback usage guide:The CI feedback tool (
In addition to being automatically triggered, the tool can also be invoked manually by commenting on a PR:
where Configuration options
See more information about the |
PR Code Suggestions ✨
|
Looks like CI test is failing. Code coverage also dropped by 70%. How about using this branch to extend coverage? 😄 |
cover_agent/PromptBuilder.py
Outdated
@@ -125,6 +127,7 @@ def build_prompt(self) -> dict: | |||
"source_file_name": self.source_file_name, | |||
"test_file_name": self.test_file_name, | |||
"source_file_numbered": self.source_file_numbered, | |||
"test_file_numbered": self.test_fule_numbered, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spelling error: fule
but should be file
. Need to refactor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
cover_agent/UnitTestGenerator.py
Outdated
@@ -201,14 +201,18 @@ def build_prompt(self): | |||
failed_test_runs_value = "" | |||
try: | |||
for failed_test in self.failed_test_runs: | |||
code = failed_test['code'].strip() | |||
failed_test_dict = failed_test['code'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested by PR Agent:
failed_test_dict = failed_test['code'] | |
failed_test_dict = failed_test.get('code', {}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
cover_agent/main.py
Outdated
|
||
# Write test_gen.prompt to a debug markdown file | ||
write_prompt_to_file(GENERATED_PROMPT_NAME, test_gen.prompt) | ||
|
||
# Validate each test and append the results to the test results list | ||
for generated_test in generated_tests: | ||
test_result = test_gen.validate_test(generated_test) | ||
for generated_test in generated_tests_dict['tests']: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion from PR Agent
for generated_test in generated_tests_dict['tests']: | |
for generated_test in generated_tests_dict.get('tests', []): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
/improve |
PR Code Suggestions ✨
|
The real deal - implementing #39 and #40
PR Type
Enhancement, Tests
Description
generate_tests
andvalidate_test
methods inUnitTestGenerator.py
to handle JSON serialization, new imports, and specific line insertions.PromptBuilder.py
to include numbered test file content in the prompt.main.py
to handle the new dictionary structure returned bygenerate_tests
.test_generation_prompt.toml
.UI
andGithub
) and HTML structure for the GitHub User Finder application.UI
class using Vitest.Changes walkthrough 📝
9 files
UnitTestGenerator.py
Enhance test generation and validation logic
cover_agent/UnitTestGenerator.py
generate_tests
method to handle JSON serialization offailed test runs.
validate_test
method to handle new imports and inserttests at specific lines.
extract_error_message
for extracting errormessages.
PromptBuilder.py
Include numbered test file content in prompt
cover_agent/PromptBuilder.py
test_file_numbered
in the prompt dictionary.main.py
Update main function for new test generation structure
cover_agent/main.py
returned by
generate_tests
.test_generation_prompt.toml
Update test generation prompt guidelines and model
cover_agent/settings/test_generation_prompt.toml
suite.
relevant_line_to_insert_after
andneeded_indent
inthe
NewTests
model.ui.js
Add UI class for handling user interactions
templated_tests/js_vanilla/ui.js
UI
class to handle user interface interactions.index.html
Add HTML structure for GitHub User Finder
templated_tests/js_vanilla/index.html
github.js
Add Github class for API interactions
templated_tests/js_vanilla/github.js
Github
class to handle GitHub API interactions.package.json
Add package configuration for js-vanilla-example
templated_tests/js_vanilla/package.json
app.js
Add main application logic for GitHub User Finder
templated_tests/js_vanilla/app.js
GitHub user data.
2 files
ui.test.js
Add initial tests for UI class
templated_tests/js_vanilla/ui.test.js
UI
class using Vitest.vitest.config.js
Add Vitest configuration for testing
templated_tests/js_vanilla/vitest.config.js
1 files
README.md
Add README for js-vanilla-example project
templated_tests/js_vanilla/README.md