Raise test coverage from 46% to 97% of lines - #56
Open
loevgaard wants to merge 1 commit into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## fix/31-readme #56 +/- ##
================================================
Coverage ? 96.82%
Complexity ? 170
================================================
Files ? 35
Lines ? 535
Branches ? 0
================================================
Hits ? 518
Misses ? 17
Partials ? 0 🚀 New features to boost your workflow:
|
loevgaard
force-pushed
the
fix/31-readme
branch
from
September 7, 2026 12:18
2fd1342 to
8706e6a
Compare
loevgaard
force-pushed
the
fix/32-test-coverage
branch
from
September 7, 2026 12:18
cb71f21 to
ee5d996
Compare
loevgaard
force-pushed
the
fix/31-readme
branch
from
September 7, 2026 12:47
8706e6a to
a8816a6
Compare
loevgaard
force-pushed
the
fix/32-test-coverage
branch
from
September 7, 2026 12:47
ee5d996 to
61c8a7d
Compare
loevgaard
force-pushed
the
fix/31-readme
branch
from
September 7, 2026 12:51
a8816a6 to
c1ee41a
Compare
loevgaard
force-pushed
the
fix/32-test-coverage
branch
from
September 7, 2026 12:51
61c8a7d to
8353c59
Compare
Most of the bugs this series fixed lived in code no test touched. Cover what was left: the request populators, the consent checker, both tag bag subscribers, StoreFbcSubscriber and CookieBasedFbpContext. Add an end to end test that dispatches a real event through a booted kernel and asserts what reaches the client and the tag bag, including that nothing is sent or enriched for a bot, and gate coverage in Codecov so it cannot regress silently. Fixes #32
loevgaard
force-pushed
the
fix/31-readme
branch
from
September 7, 2026 12:57
c1ee41a to
c8953ac
Compare
loevgaard
force-pushed
the
fix/32-test-coverage
branch
from
September 7, 2026 12:57
8353c59 to
68485b3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #32
Where it started
Only two classes were fully covered, and most subscriber coverage came from
getSubscribedEvents()being called during kernel boot rather than from behaviour being exercised. Nearly every bug this series fixed lived in that untested half.Where it ends
The earlier PRs covered what they changed. This one closes what was left:
PopulateRequestPropertiesSubscriber,PopulatePixelsSubscriber,PopulateFbpAndFbcPropertiesSubscriber,ConsentChecker,AddEventToTagBagSubscriber,AddLibraryToTagBagSubscriberandStoreFbcSubscriber.The end-to-end test
PipelineTestis the one this series needed most. It boots a real kernel with both sides enabled and a recordingClientInterface, pushes a request, registers an application listener atPRIORITY_ENRICH, dispatches a realConversionsApiEventRaised, and then asserts on both ends:fbp, and the enriching listener's email as a SHA-256 hash;fbq('init')andfbq('track')calls, carrying the sameeventIDas the server payload, which is what makes Meta deduplicate the pair.A second test sends a
Googlebotuser agent and asserts nothing reaches the client, nothing is rendered, and the application's enrichment listener was never invoked.That test exercises the wiring between listeners, which is where a missing service argument or a bus that no longer exists actually shows up. It would have caught the very first issue in this series.
Keeping it there
codecov.ymlturns coverage into a gate: 95% on the project with a 1% threshold, 90% on the patch. The coverage job already uploaded to Codecov but nothing consumed the result.