Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Add snapshot test support for coverage implementation #3368

Merged
merged 12 commits into from
Aug 8, 2023
Merged

Conversation

Porges
Copy link
Member

@Porges Porges commented Aug 1, 2023

Adds a test for srcview that exercises it against a real executable, as prep for #3362. This also adds test coverage for a lot of code we didn't have covered before.

Add a snapshot-based test to our coverage implementation. This adds coverage for a bunch of code which did not previously have it, and allows us to easily see that coverage is being generated as expected.

A fix was made to the recording code to remove the use of TargetAllowList as it was easy to misconfigure CoverageRecorder when using it. The use of TargetAllowList is now only a container struct in our generic coverage task.

@codecov-commenter
Copy link

codecov-commenter commented Aug 1, 2023

Codecov Report

Merging #3368 (e28f16f) into main (d464e34) will increase coverage by 2.48%.
The diff coverage is 46.66%.

@@            Coverage Diff             @@
##             main    #3368      +/-   ##
==========================================
+ Coverage   32.21%   34.70%   +2.48%     
==========================================
  Files         302      302              
  Lines       36931    36917      -14     
==========================================
+ Hits        11897    12811     +914     
+ Misses      25034    24106     -928     
Files Changed Coverage Δ
src/agent/coverage/src/allowlist.rs 89.79% <ø> (+11.03%) ⬆️
src/agent/coverage/src/binary.rs 66.66% <0.00%> (+12.06%) ⬆️
...c/agent/onefuzz-task/src/tasks/coverage/generic.rs 0.00% <0.00%> (ø)
src/agent/coverage/src/record/windows.rs 64.51% <42.85%> (+39.24%) ⬆️
src/agent/coverage/src/record.rs 78.89% <71.42%> (+3.44%) ⬆️
src/agent/coverage/src/record/linux.rs 64.28% <100.00%> (ø)
src/agent/coverage/src/source.rs 91.66% <100.00%> (+80.20%) ⬆️

... and 13 files with indirect coverage changes

@Porges Porges changed the title Srcview test Srcview binary test Aug 1, 2023
@Porges Porges marked this pull request as ready for review August 1, 2023 03:29
@Porges Porges changed the title Srcview binary test Add snapshot test support for coverage implementation Aug 1, 2023
@Porges Porges requested a review from ranweiler August 1, 2023 22:02
@Porges Porges enabled auto-merge (squash) August 7, 2023 23:14
@Porges Porges merged commit d53646e into main Aug 8, 2023
24 checks passed
@Porges Porges deleted the srcview-test branch August 8, 2023 00:38
@AdamL-Microsoft AdamL-Microsoft mentioned this pull request Aug 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants