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

Convert legacy docker tests from bash to golang #11357

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

dereknola
Copy link
Member

@dereknola dereknola commented Nov 22, 2024

Background

The current docker tests use a complex series of bash function hooks to construct k3s cluster out of docker containers, using the rancher/k3s image we publish. These tests are difficult to read, difficult to write, and do not match the ginkgo/gomega centric BDD testing frameworks we have constructed for integration and E2E tests.

Proposed Changes

  • Convert the old docker tests to use Ginkgo/Gomega BDD testing framework. This framework is currently similar but separate from E2E and Integration frameworks. Future work is to potentially combine all 3 frameworks where it makes sense.
  • Precompile Go tests binaries during a separate build job to speed of the actual running of the tests. This runs in parallel with the Building of the k3s binary and image, which is the current bottleneck.
  • compat test is now skew test, as we are testing the skew policy of K8s.

Note: For now this is going to exist alongside the legacy docker tests. More work needs to be done to ensure things like log output and failures are handled effectively.

Types of Changes

Major CI change, Testing

Verification

image

Testing

Linked Issues

TBD

User-Facing Change


Further Comments

Prebuild K3s Go Tests

Strip go test binaries to reduce size

Crank native GHA compression

Signed-off-by: Derek Nola <[email protected]>
Signed-off-by: Derek Nola <[email protected]>
Signed-off-by: Derek Nola <[email protected]>
Signed-off-by: Derek Nola <[email protected]>
Signed-off-by: Derek Nola <[email protected]>
Copy link

codecov bot commented Nov 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 42.37%. Comparing base (cd4dded) to head (66340b3).
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #11357      +/-   ##
==========================================
- Coverage   47.18%   42.37%   -4.81%     
==========================================
  Files         179      179              
  Lines       18600    18600              
==========================================
- Hits         8776     7882     -894     
- Misses       8469     9512    +1043     
+ Partials     1355     1206     -149     
Flag Coverage Δ
e2etests 34.27% <ø> (-7.94%) ⬇️
inttests 18.82% <ø> (-15.87%) ⬇️
unittests 13.82% <ø> (ø)

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.


🚨 Try these New Features:

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.

1 participant