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

add ut for enqueue action #3453

Merged
merged 1 commit into from May 20, 2024
Merged

Conversation

googs1025
Copy link
Contributor

What type of PR is this?

/kind feature

What this PR does / why we need it:

  • add ut for action: enqueue

Which issue(s) this PR fixes:

Fixes ##3053

Special notes for your reviewer:

Does this PR introduce a user-facing change?


@volcano-sh-bot volcano-sh-bot added the kind/feature Categorizes issue or PR as related to a new feature. label May 7, 2024
@volcano-sh-bot volcano-sh-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label May 7, 2024
@lowang-bh
Copy link
Member

Are there any cases about job can not enqueue?

@googs1025
Copy link
Contributor Author

googs1025 commented May 8, 2024

Are there any cases about job can not enqueue?

I added two type case, one: when pg is in running state, it will not join the queue, and the second one is when the specified queue does not exist, it will not join the queue.

@googs1025 googs1025 requested a review from lowang-bh May 8, 2024 04:47
@lowang-bh
Copy link
Member

How about queue's allocation plus the incoming inqueue's resource will exceed queue's capacity?

@googs1025
Copy link
Contributor Author

How about queue's allocation plus the incoming inqueue's resource will exceed queue's capacity?

Yes, I thought about this case. I thought that these scenarios would be covered by the plugins test cases, so I did not add these cases. If needed, I can add it.

@volcano-sh-bot volcano-sh-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 8, 2024
@volcano-sh-bot volcano-sh-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 8, 2024
@lowang-bh
Copy link
Member

How about queue's allocation plus the incoming inqueue's resource will exceed queue's capacity?

If needed, I can add it.

I advise to add some cases.

@googs1025
Copy link
Contributor Author

How about queue's allocation plus the incoming inqueue's resource will exceed queue's capacity?

If needed, I can add it.

I advise to add some cases.

done, i add the case "pggroup cannot enqueue because queue resources are less than podgroup MinResources"

@lowang-bh
Copy link
Member

/lgtm

@Monokaix @hwdef please also help to take a look. thanks.

@volcano-sh-bot volcano-sh-bot added the lgtm Indicates that a PR is ready to be merged. label May 11, 2024
Copy link
Member

@hwdef hwdef left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

action := New()
test.Run([]framework.Action{action})
if err := test.CheckAll(i); err != nil {
t.Fatalf("case: (index: %v/name: %s), action: %s, error: %s", i, test.Name, action.Name(), err)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicate error message。 just need print the error which has included detail.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@volcano-sh-bot volcano-sh-bot removed the lgtm Indicates that a PR is ready to be merged. label May 18, 2024
@googs1025 googs1025 requested a review from hwdef May 18, 2024 06:38
@googs1025 googs1025 requested a review from lowang-bh May 18, 2024 06:38
@googs1025 googs1025 force-pushed the add_enqueue_ut branch 2 times, most recently from 8ff3fbc to 43c02b3 Compare May 20, 2024 00:53
Signed-off-by: googs1025 <googs1025@gmail.com>
@volcano-sh-bot volcano-sh-bot added the lgtm Indicates that a PR is ready to be merged. label May 20, 2024
@volcano-sh-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lowang-bh

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

The pull request process is described 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

@volcano-sh-bot volcano-sh-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 20, 2024
@volcano-sh-bot volcano-sh-bot merged commit 3520a0f into volcano-sh:master May 20, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants