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

Consolidate test utility functions into top level package #11711

Merged
merged 7 commits into from
Feb 5, 2025

Conversation

dereknola
Copy link
Member

Proposed Changes

  • Consolidate relevant "client-go" type helper functions into a single package for use across Integration, Docker, and E2E tests. Docker and Integration were already directly using their respective client-go functions, E2E reqiured more work (as those relied on kubectl calls on the host, not client-go API calls).
  • Add missing Context levels in several E2E tests.
  • Convert several E2E test functions into methods, consolidate common variables into Test Config struct. This brings E2E closer to how the docker tests are constructed, enabling easier "translation" between a docker or a E2E test.

Types of Changes

Testing

Verification

CI still green for all tests.

Testing

Testing all the way down

Linked Issues

#11710

User-Facing Change


Further Comments

@dereknola dereknola requested a review from a team as a code owner February 4, 2025 17:54
Copy link

codecov bot commented Feb 4, 2025

Codecov Report

Attention: Patch coverage is 0% with 101 lines in your changes missing coverage. Please review.

Project coverage is 47.41%. Comparing base (1666b5c) to head (2d1c463).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
tests/client.go 0.00% 101 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #11711      +/-   ##
==========================================
- Coverage   47.65%   47.41%   -0.25%     
==========================================
  Files         185      186       +1     
  Lines       19353    19454     +101     
==========================================
+ Hits         9223     9224       +1     
- Misses       8797     8896      +99     
- Partials     1333     1334       +1     
Flag Coverage Δ
e2etests 40.38% <ø> (ø)
inttests 35.06% <ø> (+0.04%) ⬆️
unittests 16.95% <0.00%> (-0.09%) ⬇️

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.

@dereknola dereknola merged commit bb79c2b into k3s-io:master Feb 5, 2025
44 checks passed
@dereknola dereknola deleted the e2e_testconfig branch February 7, 2025 17:04
dereknola added a commit to dereknola/k3s that referenced this pull request Feb 7, 2025
* [e2e] Convert RunCmdOnNode to method
* Consolidate e2e variables into TestConfig struct
* Consolidate docker and integration test helper functions
* E2E: Directly count daemonsets, not their pods
* Add missing Context levels for E2E tests
* Migrate e2e.ParsePods to new tests client package
* Run the go test compile test on their respective architectures

Signed-off-by: Derek Nola <[email protected]>
dereknola added a commit to dereknola/k3s that referenced this pull request Feb 7, 2025
* [e2e] Convert RunCmdOnNode to method
* Consolidate e2e variables into TestConfig struct
* Consolidate docker and integration test helper functions
* E2E: Directly count daemonsets, not their pods
* Add missing Context levels for E2E tests
* Migrate e2e.ParsePods to new tests client package
* Run the go test compile test on their respective architectures

Signed-off-by: Derek Nola <[email protected]>
dereknola added a commit to dereknola/k3s that referenced this pull request Feb 7, 2025
* [e2e] Convert RunCmdOnNode to method
* Consolidate e2e variables into TestConfig struct
* Consolidate docker and integration test helper functions
* E2E: Directly count daemonsets, not their pods
* Add missing Context levels for E2E tests
* Migrate e2e.ParsePods to new tests client package
* Run the go test compile test on their respective architectures

Signed-off-by: Derek Nola <[email protected]>
dereknola added a commit to dereknola/k3s that referenced this pull request Feb 7, 2025
* [e2e] Convert RunCmdOnNode to method
* Consolidate e2e variables into TestConfig struct
* Consolidate docker and integration test helper functions
* E2E: Directly count daemonsets, not their pods
* Add missing Context levels for E2E tests
* Migrate e2e.ParsePods to new tests client package
* Run the go test compile test on their respective architectures

Signed-off-by: Derek Nola <[email protected]>
dereknola added a commit to dereknola/k3s that referenced this pull request Feb 7, 2025
* [e2e] Convert RunCmdOnNode to method
* Consolidate e2e variables into TestConfig struct
* Consolidate docker and integration test helper functions
* E2E: Directly count daemonsets, not their pods
* Add missing Context levels for E2E tests
* Migrate e2e.ParsePods to new tests client package
* Run the go test compile test on their respective architectures

Signed-off-by: Derek Nola <[email protected]>
dereknola added a commit that referenced this pull request Feb 7, 2025
* [e2e] Convert RunCmdOnNode to method
* Consolidate e2e variables into TestConfig struct
* Consolidate docker and integration test helper functions
* E2E: Directly count daemonsets, not their pods
* Add missing Context levels for E2E tests
* Migrate e2e.ParsePods to new tests client package
* Run the go test compile test on their respective architectures

Signed-off-by: Derek Nola <[email protected]>
dereknola added a commit that referenced this pull request Feb 8, 2025
* [e2e] Convert RunCmdOnNode to method
* Consolidate e2e variables into TestConfig struct
* Consolidate docker and integration test helper functions
* E2E: Directly count daemonsets, not their pods
* Add missing Context levels for E2E tests
* Migrate e2e.ParsePods to new tests client package
* Run the go test compile test on their respective architectures

Signed-off-by: Derek Nola <[email protected]>
dereknola added a commit that referenced this pull request Feb 8, 2025
* [e2e] Convert RunCmdOnNode to method
* Consolidate e2e variables into TestConfig struct
* Consolidate docker and integration test helper functions
* E2E: Directly count daemonsets, not their pods
* Add missing Context levels for E2E tests
* Migrate e2e.ParsePods to new tests client package
* Run the go test compile test on their respective architectures

Signed-off-by: Derek Nola <[email protected]>
dereknola added a commit that referenced this pull request Feb 8, 2025
* [e2e] Convert RunCmdOnNode to method
* Consolidate e2e variables into TestConfig struct
* Consolidate docker and integration test helper functions
* E2E: Directly count daemonsets, not their pods
* Add missing Context levels for E2E tests
* Migrate e2e.ParsePods to new tests client package
* Run the go test compile test on their respective architectures

Signed-off-by: Derek Nola <[email protected]>
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