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

Commit

Permalink
Merge branch 'main' into user/noharper/increase-coverage-output
Browse files Browse the repository at this point in the history
  • Loading branch information
nharper285 authored Oct 31, 2023
2 parents 2c13e42 + ca6f3cd commit 011da5f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/agent/onefuzz-task/src/tasks/coverage/generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ use onefuzz_file_format::coverage::{
};
use onefuzz_result::job_result::JobResultData;
use onefuzz_result::job_result::{JobResultSender, TaskJobResultClient};
use onefuzz_telemetry::{event, warn, Event::coverage_data, Event::coverage_failed, EventData};
use onefuzz_telemetry::{
event, warn, Event::coverage_data, Event::coverage_empty, Event::coverage_failed, EventData,
};
use storage_queue::{Message, QueueClient};
use tokio::fs;
use tokio::sync::RwLock;
Expand Down Expand Up @@ -297,6 +299,11 @@ impl<'a> TaskContext<'a> {

async fn try_record_input(&mut self, input: &Path) -> Result<()> {
let coverage = self.record_impl(input).await?;
let coverage_stats = CoverageStats::new(&coverage);
if coverage_stats.covered == 0 {
event!(coverage_empty; EventData::Path = input.display().to_string());
metric!(coverage_empty; 1.0; EventData::Path = input.display().to_string());
}
let mut self_coverage = RwLock::write(&self.coverage).await;
self_coverage.merge(&coverage);
Ok(())
Expand Down
2 changes: 2 additions & 0 deletions src/agent/onefuzz-telemetry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ pub enum Event {
task_start,
coverage_data,
coverage_failed,
coverage_empty,
new_result,
new_crashdump,
new_coverage,
Expand All @@ -94,6 +95,7 @@ impl Event {
Self::task_start => "task_start",
Self::coverage_data => "coverage_data",
Self::coverage_failed => "coverage_failed",
Self::coverage_empty => "coverage_empty",
Self::new_coverage => "new_coverage",
Self::new_crashdump => "new_crashdump",
Self::new_result => "new_result",
Expand Down

0 comments on commit 011da5f

Please sign in to comment.