Skip to content

Conversation

@martincostello
Copy link
Owner

Fix error if a benchmark has failed and has no Statistics.

Found via martincostello/aspnetcore-openapi#231.

Fix error if a benchmark has failed and has no `Statistics`.
@martincostello martincostello added bug Something isn't working javascript Pull requests that update Javascript code labels Mar 20, 2025
@codecov
Copy link

codecov bot commented Mar 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.85%. Comparing base (c9e0171) to head (e2d9511).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #266      +/-   ##
==========================================
+ Coverage   84.68%   84.85%   +0.17%     
==========================================
  Files           2        2              
  Lines         346      350       +4     
  Branches       79       83       +4     
==========================================
+ Hits          293      297       +4     
  Misses         52       52              
  Partials        1        1              
Flag Coverage Δ
linux 84.85% <100.00%> (+0.17%) ⬆️
macos 84.85% <100.00%> (+0.17%) ⬆️
windows 84.85% <100.00%> (+0.17%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

martincostello added a commit to martincostello/aspnetcore-openapi that referenced this pull request Mar 20, 2025
Set the value to `NaN` to avoid it being serialized as `null`.
martincostello added a commit to martincostello/benchmarks-dashboard that referenced this pull request Mar 20, 2025
Handle `"NaN"` as a value in the benchmark data if a benchmark run fails.

See martincostello/benchmarkdotnet-results-publisher#266.
martincostello added a commit to martincostello/benchmarks-dashboard that referenced this pull request Mar 20, 2025
Handle `"NaN"` as a value in the benchmark data if a benchmark run fails.

See martincostello/benchmarkdotnet-results-publisher#266.
@martincostello martincostello marked this pull request as ready for review March 20, 2025 19:00
Copilot AI review requested due to automatic review settings March 20, 2025 19:00
Copy link

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 updates the benchmark publishing logic to handle cases where a benchmark fails and no Statistics are available.

  • Introduces fallback values for benchmarks with missing Statistics in the publisher.
  • Adds a failing benchmark test fixture and an associated test case to verify proper handling.

Reviewed Changes

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

File Description
tests/fixtures/failing-benchmark/BenchmarkDotNet.Artifacts/results/TodoApp.OpenApiBenchmarks-report-github.md Adds a new test fixture report for a failing benchmark scenario
src/BenchmarksPublisher.ts Updates logic to use fallback values for missing Statistics in benchmarks
tests/main.test.ts Adds a test case for the failing benchmark scenario
Files not reviewed (3)
  • tests/snapshots/main.test.ts.snap: Language not supported
  • tests/fixtures/failing-benchmark.json: Language not supported
  • tests/fixtures/failing-benchmark/BenchmarkDotNet.Artifacts/results/TodoApp.OpenApiBenchmarks-report-full-compressed.json: Language not supported

@martincostello martincostello added this to the v1.0.2 milestone Mar 20, 2025
@martincostello martincostello merged commit abcb3ce into main Mar 20, 2025
12 checks passed
@martincostello martincostello deleted the handle-broken-benchmarks branch March 20, 2025 19:02
martincostello added a commit to martincostello/aspnetcore-openapi that referenced this pull request Mar 21, 2025
martincostello added a commit to martincostello/aspnetcore-openapi that referenced this pull request Mar 21, 2025
martincostello added a commit to martincostello/aspnetcore-openapi that referenced this pull request Apr 4, 2025
martincostello added a commit to martincostello/aspnetcore-openapi that referenced this pull request Apr 4, 2025
martincostello added a commit to martincostello/aspnetcore-openapi that referenced this pull request Apr 4, 2025
martincostello added a commit to martincostello/aspnetcore-openapi that referenced this pull request Apr 5, 2025
martincostello added a commit to martincostello/aspnetcore-openapi that referenced this pull request Apr 6, 2025
martincostello added a commit to martincostello/aspnetcore-openapi that referenced this pull request Apr 8, 2025
martincostello added a commit to martincostello/aspnetcore-openapi that referenced this pull request Apr 11, 2025
martincostello added a commit to martincostello/aspnetcore-openapi that referenced this pull request Apr 25, 2025
martincostello added a commit to martincostello/aspnetcore-openapi that referenced this pull request Apr 26, 2025
martincostello added a commit to martincostello/aspnetcore-openapi that referenced this pull request May 2, 2025
martincostello added a commit to martincostello/aspnetcore-openapi that referenced this pull request May 13, 2025
martincostello added a commit to martincostello/aspnetcore-openapi that referenced this pull request May 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working javascript Pull requests that update Javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants