Raise test coverage from 46% to 97% of lines - #56
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #56 +/- ##
============================================
+ Coverage 81.93% 90.49% +8.56%
+ Complexity 148 147 -1
============================================
Files 31 31
Lines 487 484 -3
============================================
+ Hits 399 438 +39
+ Misses 88 46 -42 🚀 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
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
loevgaard
force-pushed
the
fix/31-readme
branch
from
September 14, 2026 07:29
c8953ac to
d17cc8a
Compare
loevgaard
force-pushed
the
fix/32-test-coverage
branch
from
September 14, 2026 07:29
68485b3 to
201e112
Compare
loevgaard
force-pushed
the
fix/31-readme
branch
from
September 14, 2026 07:39
d17cc8a to
3e99da1
Compare
loevgaard
force-pushed
the
fix/32-test-coverage
branch
from
September 14, 2026 07:39
201e112 to
15a241d
Compare
loevgaard
force-pushed
the
fix/31-readme
branch
from
September 14, 2026 07:42
3e99da1 to
beb8439
Compare
loevgaard
force-pushed
the
fix/32-test-coverage
branch
from
September 14, 2026 07:42
15a241d to
c68e8b1
Compare
loevgaard
force-pushed
the
fix/31-readme
branch
from
September 14, 2026 07:52
beb8439 to
316d328
Compare
loevgaard
force-pushed
the
fix/32-test-coverage
branch
from
September 14, 2026 07:52
c68e8b1 to
0f19fc3
Compare
loevgaard
force-pushed
the
fix/31-readme
branch
from
September 14, 2026 08:01
316d328 to
d6a8206
Compare
loevgaard
force-pushed
the
fix/32-test-coverage
branch
from
September 14, 2026 08:01
0f19fc3 to
f948085
Compare
loevgaard
force-pushed
the
fix/31-readme
branch
from
September 14, 2026 08:07
d6a8206 to
5c74237
Compare
loevgaard
force-pushed
the
fix/32-test-coverage
branch
from
September 14, 2026 08:07
f948085 to
993283f
Compare
loevgaard
force-pushed
the
fix/31-readme
branch
from
September 14, 2026 08:13
5c74237 to
d6a40ee
Compare
loevgaard
force-pushed
the
fix/32-test-coverage
branch
from
September 14, 2026 08:13
993283f to
4fa147e
Compare
loevgaard
force-pushed
the
fix/31-readme
branch
from
September 14, 2026 08:16
d6a40ee to
11fbcd2
Compare
loevgaard
force-pushed
the
fix/32-test-coverage
branch
from
September 14, 2026 08:16
4fa147e to
cf0a340
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/32-test-coverage
branch
from
September 14, 2026 08:27
cf0a340 to
029bb97
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.