-
Notifications
You must be signed in to change notification settings - Fork 6
feat: add code analysis and reporting for testGPT #10
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
feat: add code analysis and reporting for testGPT #10
Conversation
Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
|
@Sonichigo Do let me know how we can test this / refine this! |
Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
|
@Sonichigo @gouravkrosx Following up on this! |
| with: | ||
| github-token: ${{ inputs.github-token }} | ||
| script: | | ||
| try { |
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.
lets not make the yml file cluttered, encouraging to use shell files for same
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.
Sure Yash! I also took the chance to move the parsing to a new script as well
action.yml
Outdated
| id: language-detection | ||
| shell: bash | ||
| run: | | ||
| declare -A extensions=( |
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.
it would be great to support jsx and tsx
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.
Sure, Adding this!
action.yml
Outdated
| - name: Install analysis tools | ||
| shell: bash | ||
| run: | | ||
| for lang in ${{ steps.language-detection.outputs.languages }}; do |
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.
we should also check if the system has a linter already installed and if yes we should use the same linter, might cause issues if using different linter
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.
Sure, I have added a check for it as well
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.
Please address the comments above
…rsing Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
…esult parsing Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
|
@khareyash05 Your requested changes have been made! |
|
@SkySingh04 please mention the issue in the PR |
parse-results.sh
Outdated
| @@ -0,0 +1,11 @@ | |||
| #!/bin/bash | |||
|
|
|||
| grep -oE "COMPLETE TESTRUN SUMMARY\.\s+Total tests: [0-9]+" ${GITHUB_WORKSPACE}/${WORKDIR}/report.txt | sed -r "s/\x1B\[[0-9;]*[mGK]//g" > ${GITHUB_WORKSPACE}/${WORKDIR}/final_total_tests.out | |||
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.
Add a fallback here, what if no tests were executed?
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.
Added a fallback message : No tests were executed!
action.yml
Outdated
|
|
||
| - name: Grant permissions to scripts | ||
| run: | | ||
| chmod +x ${GITHUB_ACTION_PATH}/install.sh |
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.
Repeating chmod +x multiple times. Anyway we can batch update permissions in one step?
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.
This has been updated!
|
Thanks for the review @Hermione2408 , Will pick this up over the weekend! |
…ing logic - Combined multiple chmod commands into a single line for efficiency in action.yml. - Added a check in parse-results.sh to handle cases where no tests were executed, ensuring proper output generation. Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
…tory checks - Added logging functionality to provide better insights during linter installations and code analysis completion in analyze-code.sh. - Ensured the existence of the analysis-reports directory before generating reports. - Improved error handling in parse-results.sh to check for the presence of the report file and handle cases where no tests were executed. Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
|
@Hermione2408 @khareyash05 Your requested changes have been made! |
Hermione2408
left a comment
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.
please address the comments
- Updated error messages to provide clearer guidance when the test report file is not found and when no valid test summary is present. - Enhanced user feedback to ensure proper understanding of issues related to test execution. Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
|
@Hermione2408 Your requested Changes have been made! |
Hermione2408
left a comment
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.
LGTM!
|
Nice Pr 😄. We currently support Unit Test Generation only for Go projects. |
1 similar comment
|
Nice Pr 😄. We currently support Unit Test Generation only for Go projects. |
TestGPT: PR Analysis with Linting & Static Analysis
Linked Issue : keploy/keploy#2532
Changes
Technical Details
Testing
Signed-off-by: Sky Singh akashsingh2210670@gmail.com