cucumber / godog

Cucumber for golang
MIT License
2.21k stars 249 forks source link

Mark junit test cases as skipped if no pickle step results available #597

Open mrsheepuk opened 4 months ago

mrsheepuk commented 4 months ago

🤔 What's changed?

This allows the junit reporter not to panic if the StopOnFirstFailure flag is used. It marks any subsequent test cases as 'skipped' (seemed like the best choice).

I kept the change as small as possible by recovering from the panics, instead of introducing a suite of "non-must' equivalents on the Storage struct. While that would have been far cleaner as code (recovering from panics feels decidedly icky), this solves the issue with relatively little impact to anything else. But if y'all think adding non-must equivalents onto the Storage struct is a better call, happy to make that change.

⚡️ What's your motivation?

Fixes #387

🏷️ What kind of change is this?

📋 Checklist:

codecov[bot] commented 2 weeks ago

Codecov Report

Attention: Patch coverage is 75.00000% with 9 lines in your changes are missing coverage. Please review.

Project coverage is 83.27%. Comparing base (153db4e) to head (e82afb8). Report is 6 commits behind head on main.

Files Patch % Lines
internal/formatters/fmt_junit.go 75.00% 4 Missing and 5 partials :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #597 +/- ## ========================================== + Coverage 83.21% 83.27% +0.06% ========================================== Files 28 29 +1 Lines 3413 2858 -555 ========================================== - Hits 2840 2380 -460 + Misses 458 357 -101 - Partials 115 121 +6 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.