Skip to content

chore: add Pyrameter test-shape enforcement#1358

Open
samsonasik wants to merge 4 commits into
codeigniter4:developfrom
samsonasik:chore-add-pyrameter
Open

chore: add Pyrameter test-shape enforcement#1358
samsonasik wants to merge 4 commits into
codeigniter4:developfrom
samsonasik:chore-add-pyrameter

Conversation

@samsonasik

Copy link
Copy Markdown
Member

Description

This PR adds Pyrameter phpunit extension:

https://github.com/boundwize/pyrameter

Pyrameter classifies executed tests as unit, functional, integration, or e2e based on the code they use, then compares the totals with your target shape.

Per current tests, here the target limit defined:

Defines target limits:

  • Unit: minimum 40%
  • Functional: maximum 10%
  • Integration: maximum 50%
  • End-to-end: maximum 0%

and get output

=========
Pyrameter
=========

Shape:  Inverted Pyramid
Result: Passed ✓

        ▀▀▀▀▀▀▀▀▀▀▀▀▀  Integration  ✓
          ▀▀▀▀▀▀▀▀▀  Unit           ✓
            ▀▀▀▀▀  Functional       ✓
              ▼  E2E                ✓

+=============+=======+========+============+
|    KIND     | TESTS | ACTUAL |   TARGET   |
+=============+=======+========+============+
| Unit        |   277 |  44.8% | >= 40.0% ✓ |
+-------------+-------+--------+------------+
| Functional  |    38 |   6.2% | <= 10.0% ✓ |
+-------------+-------+--------+------------+
| Integration |   303 |  49.0% | <= 50.0% ✓ |
+-------------+-------+--------+------------+
| E2E         |     0 |   0.0% | <=  0.0% ✓ |
+-------------+-------+--------+------------+

Total: 618 tests

Your heavier tests outnumber your unit tests.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@samsonasik samsonasik changed the title chore(test): add Pyrameter test-shape enforcement chore: add Pyrameter test-shape enforcement Jul 15, 2026
@samsonasik samsonasik marked this pull request as draft July 15, 2026 14:01
@samsonasik samsonasik marked this pull request as ready for review July 15, 2026 14:07
@samsonasik

Copy link
Copy Markdown
Member Author

Ready to review/merge 👍

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.

1 participant