template.jinja: also clean up /var/lib/{rpm,dnf} for reproducibility#888
Conversation
|
I have manually verified that a downstream image can do e.g. |
9a787bd to
9b57d1b
Compare
Signed-off-by: Jonathan Dowland <jdowland@redhat.com>
Extend macro repo_clear_cache to also remove /var/lib/rpm and /var/lib/dnf. Don't bother checking for the existence of the directories: rm -rf will return success even if they do not exist. Additionally, merge two adjacent RUN rm -rf commands that handle scripts and artifacts. Fixes cekit#886. Signed-off-by: Jonathan Dowland <jdowland@redhat.com>
These tests fail after adjustments were made to the template to stop calling "pkg_manager clean all" and instead simply remove the files that the package managers leave behind. The test test_cleanup_rpm_dnf_default_pkg_manager handles checking for the clean-up lines. Signed-off-by: Jonathan Dowland <jdowland@redhat.com>
This path would be cleaned up by "apt-get clean" but we have stopped calling it in the template. Signed-off-by: Jonathan Dowland <jdowland@redhat.com>
dnf (full version) writes to /var/cache/dnf. Signed-off-by: Jonathan Dowland <jdowland@redhat.com>
|
Further test failures to adjust
|
I think at the time I did that to make sure the multistage was accurately building what the users wanted. While fiddly it was meant to catch mistakes in the generation. |
The test was very sensitive to the template's generated post-install cleanup code. Move to a more scoped regular-expression-based check. regex_dockerfile copied from test_dockerfile; in future it might be nice to move it to some common test library/utility class. Signed-off-by: Jonathan Dowland <jdowland@redhat.com>
These tests started to fail with (otherwise unrelated) adjustments to the template. Longer term I think we should rework these tests to be less sensitive (see cekit#890). Signed-off-by: Jonathan Dowland <jdowland@redhat.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #888 +/- ##
========================================
Coverage 90.16% 90.16%
========================================
Files 42 42
Lines 3263 3263
========================================
Hits 2942 2942
Misses 321 321 ☔ View full report in Codecov by Sentry. |
|
Cheers! 🍻 |
hopefully addresses #886 .