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.
lets not make the yml file cluttered, encouraging to use shell files for same
There was a problem hiding this comment.
Sure Yash! I also took the chance to move the parsing to a new script as well
| id: language-detection | ||
| shell: bash | ||
| run: | | ||
| declare -A extensions=( |
There was a problem hiding this comment.
it would be great to support jsx and tsx
There was a problem hiding this comment.
Sure, Adding this!
| - name: Install analysis tools | ||
| shell: bash | ||
| run: | | ||
| for lang in ${{ steps.language-detection.outputs.languages }}; do |
There was a problem hiding this comment.
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.
Sure, I have added a check for it as well
…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 |
| @@ -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.
Add a fallback here, what if no tests were executed?
There was a problem hiding this comment.
Added a fallback message : No tests were executed!
|
|
||
| - name: Grant permissions to scripts | ||
| run: | | ||
| chmod +x ${GITHUB_ACTION_PATH}/install.sh |
There was a problem hiding this comment.
Repeating chmod +x multiple times. Anyway we can batch update permissions in one step?
There was a problem hiding this comment.
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! |
- 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! |
|
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