project-stacker / stacker

Build OCI images natively from a declarative format
https://stackerbuild.io
Apache License 2.0
208 stars 34 forks source link

test: Fix test failure due to .coverage changing during tar creation. #557

Closed smoser closed 1 year ago

smoser commented 1 year ago

This seems to be a transient failure, but is legitimate issue.

When coverage binary is being used, this test case could fail with:

#  + mkdir /output
# + tar -cf /output/installer-iso.tar -C /stacker .
# tar: ./.coverage: file changed as we read it

The /stacker/.coverage file was being updated by the stacker binary itself. This is just a race condition based on when the file gets written to and when it was being collected by tar.

The change is just to only have tar collect the .cpio files.

What type of PR is this?

Which issue does this PR fix:

What does this PR do / Why do we need it:

If an issue # is not available please add repro steps and logs showing the issue:

Testing done on this change:

Automation added to e2e:

Will this break upgrades or downgrades?

Does this PR introduce any user-facing change?:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

codecov[bot] commented 1 year ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (a34ebfa) 54.24% compared to head (045d32a) 5.72%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #557 +/- ## ========================================== - Coverage 54.24% 5.72% -48.53% ========================================== Files 64 64 Lines 7473 7473 ========================================== - Hits 4054 428 -3626 - Misses 2728 6982 +4254 + Partials 691 63 -628 ```

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