jobset icon indicating copy to clipboard operation
jobset copied to clipboard

test: add unit test for jobset controller

Open googs1025 opened this issue 2 years ago • 17 comments

issue from https://github.com/kubernetes-sigs/jobset/issues/476 It's a bit embarrassing. I accidentally deleted the PR during synchronization and resubmitted a new one. Sorry. When there is rebase, I don’t know how to do it, and I often close the submission.

googs1025 avatar Mar 28 '24 05:03 googs1025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: googs1025 Once this PR has been reviewed and has the lgtm label, please assign danielvegamyhre for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

k8s-ci-robot avatar Mar 28 '24 05:03 k8s-ci-robot

Hi @googs1025. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

k8s-ci-robot avatar Mar 28 '24 05:03 k8s-ci-robot

Deploy Preview for kubernetes-sigs-jobset canceled.

Name Link
Latest commit 96fdbd24c0458ed9d459d58a7b568719ad963f17
Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-jobset/deploys/662baff29528d60009af0571

netlify[bot] avatar Mar 28 '24 05:03 netlify[bot]

When there is rebase, I don’t know how to do it, and I often close the submission.

No worries! I will take a look at this tomorrow.

danielvegamyhre avatar Mar 28 '24 05:03 danielvegamyhre

/ok-to-test

danielvegamyhre avatar Mar 28 '24 05:03 danielvegamyhre

@googs1025 I am refactoring createJobs() to make it more testable in https://github.com/kubernetes-sigs/jobset/pull/496 since right now this function does a lot things unrelated to creating jobs (enforcing startup policy rules, suspend/resume, etc.) which makes it harder to unit test thoroughly.

This will make it easier for you to write the tests, and easier for me to review them as well.

I added some preliminary notes on some of your test in the meantime.

danielvegamyhre avatar Apr 04 '24 23:04 danielvegamyhre

@danielvegamyhre Thank you for your response. I will update the content of this PR after you merge your pr.

googs1025 avatar Apr 05 '24 01:04 googs1025

Maybe this PR can wait until @danielvegamyhre these PRs https://github.com/kubernetes-sigs/jobset/pull/496 https://github.com/kubernetes-sigs/jobset/pull/494 are merged before I make new changes.

googs1025 avatar Apr 05 '24 23:04 googs1025

We can prioritize handling this PR https://github.com/kubernetes-sigs/jobset/pull/490 first.

googs1025 avatar Apr 05 '24 23:04 googs1025

We can prioritize handling this PR #490 first.

Sounds good I will take a look at #490 again

danielvegamyhre avatar Apr 06 '24 00:04 danielvegamyhre

/hold

until comments addressed

danielvegamyhre avatar Apr 23 '24 02:04 danielvegamyhre

@googs1025 I am refactoring createJobs() to make it more testable in #496 since right now this function does a lot things unrelated to creating jobs (enforcing startup policy rules, suspend/resume, etc.) which makes it harder to unit test thoroughly.

This will make it easier for you to write the tests, and easier for me to review them as well.

I added some preliminary notes on some of your test in the meantime.

The refactor is complete, feel free to resume this PR

danielvegamyhre avatar Apr 23 '24 02:04 danielvegamyhre

@danielvegamyhre Okay, I plan to spend some time next week working on this PR

googs1025 avatar Apr 25 '24 05:04 googs1025

@googs1025 Ok please submit PRs with tests for only 1 function at a time, so that it is easier to review.

danielvegamyhre avatar Apr 25 '24 15:04 danielvegamyhre

@googs1025: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-jobset-verify-main 96fdbd24c0458ed9d459d58a7b568719ad963f17 link true /test pull-jobset-verify-main

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

k8s-ci-robot avatar Apr 26 '24 13:04 k8s-ci-robot

@googs1025 are you still working on this?

danielvegamyhre avatar May 10 '24 02:05 danielvegamyhre

@googs1025 are you still working on this?

Yes, I have been quite busy with work recently. I will start this PR next week. thanks for reminding

googs1025 avatar May 10 '24 04:05 googs1025

Just following up on this @googs1025, do you still plan to finish this?

danielvegamyhre avatar May 30 '24 20:05 danielvegamyhre

Just following up on this @googs1025, do you still plan to finish this? @danielvegamyhre Sorry, maybe I can let this issue go, I have other things with higher priority to do

googs1025 avatar May 31 '24 04:05 googs1025