Skip to content

Commit

Permalink
updating test handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
patel-bhavin committed Jul 9, 2024
1 parent 125417d commit d84aac3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/format_test_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ def main():
print(f"{name:<80} | {status:<6} | {test_type:<10} | {'-':<50}")

# Check if total_fail is a valid integer and greater than or equal to one
if re.match(r'^[0-9]+$', str(total_fail)) and int(total_fail) >= 1:
if int(total_fail) >=1:
# Print the message in bold
print("CI Failure: There are failed tests.\n")
sys.exit(0)
else:
print("CI Success: No failed tests.\n\n")
print("**CI Failure: There are failed tests.**\n")
sys.exit(1)
else:
print("**CI Success: No failed tests.**\n\n")
sys.exit(0)

if __name__ == "__main__":
main()
18 changes: 8 additions & 10 deletions .github/workflows/unit-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,13 @@ jobs:
continue-on-error: true

- name: Formatted Final Report
run: |
pwd
ls -la .github/workflows
python .github/workflows/format_test_results.py >> $GITHUB_STEP_SUMMARY 2>&1
run: |
python .github/workflows/format_test_results.py >> $GITHUB_STEP_SUMMARY
- name: Check Test Summary Results
if: ${{ success() }}
run: echo "Test Summary failed tests, failing the CI job. See details in the unit-testing job summary UI" && exit 1
# - name: Check Test Summary Results
# if: ${{ success() }}
# run: echo "Test Summary failed tests, failing the CI job. See details in the unit-testing job summary UI" && exit 1

- name: Success handling
if: ${{ failure() }}
run: echo "Unit Testing passed for all detections, CI job is successful."
# - name: Success handling
# if: ${{ failure() }}
# run: echo "Unit Testing passed for all detections, CI job is successful."

0 comments on commit d84aac3

Please sign in to comment.