Skip to content

Add more benchmarks, smoke tests, make FilterVar serializable#1607

Merged
alganet merged 1 commit intomainfrom
smoke-tests
Jan 19, 2026
Merged

Add more benchmarks, smoke tests, make FilterVar serializable#1607
alganet merged 1 commit intomainfrom
smoke-tests

Conversation

@alganet
Copy link
Copy Markdown
Member

@alganet alganet commented Jan 16, 2026

This commit introduces a new feature test: SerializableTest, that
tests several validators for their ability to be serialized and
unserialized.

It also makes it so that the same list of validators can be used
by both simple benchmarks and "smoke tests" of all kinds, including
this serialize/unserialize one.

Additionally, the FilterVar validator was modified. Previously, due
to the use of Callback, it was not serializable, but now it is.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.78%. Comparing base (8e5938a) to head (558d5ca).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1607      +/-   ##
============================================
+ Coverage     97.51%   97.78%   +0.27%     
- Complexity     1006     1011       +5     
============================================
  Files           212      213       +1     
  Lines          2334     2351      +17     
============================================
+ Hits           2276     2299      +23     
+ Misses           58       52       -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances testing infrastructure by consolidating validator test data into a reusable trait, adding comprehensive benchmarks, and making the FilterVar validator serializable.

Changes:

  • Introduced SmokeTestProvider trait with comprehensive validator test data for reuse across benchmarks and serialization tests
  • Added serialization test coverage to verify validators can be serialized and deserialized
  • Refactored FilterVar from extending Envelope to directly implementing Validator to support serialization

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/library/SmokeTestProvider.php New trait providing test data for all validators, enabling reuse across different test types
tests/unit/SerializableTest.php New test verifying validators can be serialized/unserialized while maintaining functionality
tests/benchmark/ValidatorBench.php Refactored to use SmokeTestProvider, expanding benchmark coverage from ~50 to ~150 validators
phpbench.json.dist Updated bootstrap path to use tests/bootstrap.php for proper test environment setup
library/Validators/FilterVar.php Refactored to implement Validator directly instead of extending Envelope for serialization support

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread library/Validators/FilterVar.php Outdated
@alganet alganet marked this pull request as ready for review January 16, 2026 05:08
@alganet alganet requested a review from henriquemoody January 16, 2026 05:08
@henriquemoody
Copy link
Copy Markdown
Member

I would be great if you could add the information you have in the pull request to the commit message, it helps with adding more context when looking at the git logs.

Personally, I prefer when the commit tells what it does in the subject line, and explain why in the body. This subject line tells 3 different things, and it would be best to have a subject line that expresses (in imperative mood) the overarching subject of the commit.

Copy link
Copy Markdown
Member

@henriquemoody henriquemoody left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My comments are mostly cosmetic, but the place where that test is, I think we should really change.

Comment thread library/Validators/FilterVar.php
Comment thread tests/unit/SerializableTest.php Outdated
Comment thread library/Validators/FilterVar.php Outdated
Comment thread tests/unit/SerializableTest.php Outdated
This commit introduces a new feature test: SerializableTest, that
tests several validators for their ability to be serialized and
unserialized.

It also makes it so that the same list of validators can be used
by both simple benchmarks and "smoke tests" of all kinds, including
this serialize/unserialize one.

Additionally, the FilterVar validator was modified. Previously, due
to the use of Callback, it was not serializable, but now it is.
@alganet alganet merged commit 0090191 into main Jan 19, 2026
11 checks passed
@alganet alganet deleted the smoke-tests branch January 19, 2026 09:24
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.

3 participants