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

Run Docker tests with systemd-node, allows K3s service restarts #11638

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

dereknola
Copy link
Member

@dereknola dereknola commented Jan 22, 2025

Proposed Changes

  • Adds option to use rancher/systemd-node image as the base for K3s Docker tests. The K3s binary is mounted and the service installed via the normal install script. This allows docker tests to operate k3s as a regular service, with stops and restarts.
  • Convert (and fix) the snapshotrestore E2E test from vagrant into a docker test. This allows us to run a test we previously could not in GHA
  • Lay groundwork for consolidating Docker and E2E helper functions into a single test library. No explicit consolidation is in this PR, but the Reducing TestConfig struct and making RunCmdOnNode a method are steps in that direction
  • Move away from controlling K3s config via ENV VARs to more explicit config.yaml
  • Lay groundwork for go coverage reports in Docker tests

Types of Changes

Testing/CI

Verification

CI passes, with new tests

Snapshot Restore Performance Comparison

Type RAM Time
Vagrant 8GB 361.845 seconds
Docker 1.31GB 294.454 seconds

Testing

Its all new tests

Linked Issues

#11625

User-Facing Change


Future PR work:

  • Move to similar functions/method calls on the E2E side, again moving towards consolidating testing helper functions across our test suite (integration, docker, e2e)
  • Convert more E2E tests to Docker tests, focus on the ones currently not running in CI.
  • Coalesce and upload coverage reports from Docker tests

…rename secret -> token - remove unused ENV control vars - Consolidate DeployWorkload function similar to E2E function

Signed-off-by: Derek Nola <[email protected]>
@dereknola dereknola requested a review from a team as a code owner January 22, 2025 20:26
Copy link

codecov bot commented Jan 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 47.81%. Comparing base (3198b32) to head (2e680c9).

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #11638      +/-   ##
==========================================
- Coverage   50.02%   47.81%   -2.21%     
==========================================
  Files         185      185              
  Lines       19265    19265              
==========================================
- Hits         9637     9212     -425     
- Misses       8236     8725     +489     
+ Partials     1392     1328      -64     
Flag Coverage Δ
e2etests 40.60% <ø> (-3.70%) ⬇️
inttests 35.19% <ø> (-0.02%) ⬇️
unittests 17.04% <ø> (-0.01%) ⬇️

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.

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.

2 participants