rancher / distros-test-framework

5 stars 9 forks source link

Add an applyWorkload variable to workload functions #39

Closed rancher-max closed 9 months ago

rancher-max commented 10 months ago

Proposed Changes

This adds another variable to the functions that deal with workloads. This new variable controls whether or not to apply the workload. Without this, we could have false positives in cases where we want tests that had previously deployed a workload to ensure that workload still exists.

These changes also brought to light a flag, deployWorkload, that is used in version bump tests. This actually was more of a deleteWorkload flag, but now we have both deploy and delete as part of these changes.

Types of Changes

Fix and refactor

Testing

Checklist:

  1. If your PR changes anything on or related to Jenkins, run it pointing to your branch to make sure it's okay. Jenkins jobs run for SUC Upgrade and etcd version bump available upon request.

  2. Verify code lint; we should not have errors.

  3. Update the documentation if needed.

  4. Update makefile and docker run if adding new tests.

  5. Run your tests at least 4 times with all configurations needed and possible.

  6. If needed test with different os types.

Linked Issues

Hackweek!

Further Comments

In the case of the DNS tests, the workload is just a pod. Therefore, it should be deleted during upgrade, so I am still applying the workload post upgrade.

I have the commits separated out to make review easier for where things changed,

fmoral2 commented 10 months ago

have u tested some of those tests from version template? since we are changing stuff on template and signature, it would be good die for sure

fmoral2 commented 10 months ago

please before merge post in here on the PR description 2 successfull jobs from jenkins pointing to your branch:

rancher-max commented 10 months ago

Sent you links to jobs directly! Should be ready for re-review

fmoral2 commented 10 months ago

Overall LGTM 👍 . Suggestion if we can/want to rename the variable DEPLOY_WORKLOAD to APPLY_WORKLOAD and make similar changes to the deployWorkload variable name to applyWorkload to be consistent with its functionality

rancher-max commented 10 months ago

Should be addressed by https://github.com/rancher/distros-test-framework/pull/39/commits/7c0557ad925570bd1354a2fb44c6eb158e968e90

fmoral2 commented 10 months ago

after comment addressed please post a screenshot of any bump version working .

rancher-max commented 10 months ago
image

This is from: go test -timeout=30m -v -tags=versionbump ./entrypoint/versionbump/... -cmd "/var/lib/rancher/k3s/data/current/bin/cni, k3s -v" -expectedValue "v1.3.0-k3s1, v1.27" -testCase "TestServiceClusterIP" -applyWorkload=true -deleteWorkload=true -workloadName="bandwidth-annotations.yaml"