Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: broken TestInspectFile on windows #1133

Merged
merged 1 commit into from
Aug 25, 2024

Conversation

jabdr
Copy link
Contributor

@jabdr jabdr commented Aug 24, 2024

This is a small for TestInspectFile on windows. As windows is not able to run /bin/echo I choose an alternative for this platform.

Why tasklist.exe?

  • it is available on all windows versions
  • it is available on wine
  • it does not require elevated privileges

I also changed the argument from "" to "/?" to ensure that tasklist.exe does not do anything. On *nix this does not have any impact.

Why not XYZ?
I was unable to find a suitable platform independent alternative, as "finding" an available binary (e.g. go) at runtime would make the test more complex than the actual code.

@jabdr jabdr marked this pull request as ready for review August 24, 2024 17:14
@jabdr jabdr requested a review from a team as a code owner August 24, 2024 17:14
Copy link

codecov bot commented Aug 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.14%. Comparing base (4ff1f76) to head (832425c).
Report is 72 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1133      +/-   ##
==========================================
+ Coverage   82.72%   83.14%   +0.42%     
==========================================
  Files         162      164       +2     
  Lines        9080     7687    -1393     
==========================================
- Hits         7511     6391    -1120     
+ Misses       1319     1042     -277     
- Partials      250      254       +4     
Flag Coverage Δ
default 83.14% <ø> (+5.30%) ⬆️
examples 83.14% <ø> (+56.71%) ⬆️
ftw 83.14% <ø> (+35.77%) ⬆️
ftw-multiphase 83.14% <ø> (+33.59%) ⬆️
tinygo 83.14% <ø> (+7.73%) ⬆️

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.

Copy link
Member

@fzipi fzipi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jptosso jptosso merged commit a280f49 into corazawaf:main Aug 25, 2024
8 checks passed
jabdr added a commit to jabdr/coraza that referenced this pull request Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants