Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[WIP] Add CI badge to display test count#1034

Merged
SkBlaz merged 4 commits intomasterSkBlaz/py3plex:masterfrom
copilot/add-ci-badge-for-testsSkBlaz/py3plex:copilot/add-ci-badge-for-testsCopy head branch name to clipboard
Jan 9, 2026
Merged

[WIP] Add CI badge to display test count#1034
SkBlaz merged 4 commits intomasterSkBlaz/py3plex:masterfrom
copilot/add-ci-badge-for-testsSkBlaz/py3plex:copilot/add-ci-badge-for-testsCopy head branch name to clipboard

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 9, 2026

Plan: Add CI Badge for Test Count

  • Create a Python script to count test functions (similar to count_loc.py)
  • Create a GitHub Actions workflow to run the test count script
  • Update the workflow to generate a badge-compatible JSON output
  • Configure the workflow to update the README with the test count badge
  • Add the test count badge to README.md after existing badges
  • Add test-stats.json to .gitignore
  • Address code review feedback
    • Document error handling in count_tests.py
    • Fixed sed regex pattern to handle all number formats (999, 6.1K, 1.2M)
  • Complete implementation

Summary

Successfully added a CI badge that displays the total number of test functions (6.1K tests across 391 files) in the py3plex test suite. The implementation follows the same pattern as the existing LOC badge workflow and will automatically update when tests are added or removed.

Original prompt

This section details on the original issue you should resolve

<issue_title>ci test num</issue_title>
<issue_description>add a ci badge that counts number of all tests</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits January 9, 2026 20:53
- Create count_tests.py script to count test functions using AST parsing
- Add test-count.yml workflow that runs on push/PR
- Workflow updates README badge automatically on push to main branches
- Add test count badge (6.1K tests) to README.md
- Add test-stats.json to .gitignore

Co-authored-by: SkBlaz <10035780+SkBlaz@users.noreply.github.com>
- Use errors='replace' instead of 'ignore' for better visibility of file encoding issues
- Fix sed regex to handle plain numbers and K/M suffixes (not just K)

Co-authored-by: SkBlaz <10035780+SkBlaz@users.noreply.github.com>
- Document why errors='ignore' is used (to skip binary files)

Co-authored-by: SkBlaz <10035780+SkBlaz@users.noreply.github.com>
@SkBlaz SkBlaz marked this pull request as ready for review January 9, 2026 20:57
@SkBlaz SkBlaz self-requested a review as a code owner January 9, 2026 20:57
@SkBlaz SkBlaz merged commit 4434866 into master Jan 9, 2026
32 checks passed
Copilot stopped work on behalf of SkBlaz due to an error January 9, 2026 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci test num

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.