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

test: add tests for package resourcequota plugin. #3320

Conversation

Subhasish-Behera
Copy link

partially fixes #3053 .

Add UTs for /volcano/pkg/scheduler/plugins/resourcequota/resourcequota.go

@volcano-sh-bot
Copy link
Contributor

Welcome @Subhasish-Behera!

It looks like this is your first PR to volcano-sh/volcano 馃帀.

Thank you, and welcome to Volcano. 😃

@volcano-sh-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign qiankunli
You can assign the PR to them by writing /assign @qiankunli in a comment when ready.

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

@volcano-sh-bot volcano-sh-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 17, 2024
@volcano-sh-bot volcano-sh-bot added the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label Feb 17, 2024
@Subhasish-Behera Subhasish-Behera force-pushed the test_resoourcequota branch 2 times, most recently from 60b889f to b697c07 Compare February 17, 2024 19:41
@volcano-sh-bot volcano-sh-bot removed the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label Feb 17, 2024
Signed-off-by: Subhasish Behera greendoor3000@gmail.com
Signed-off-by: Subhasish Behera <greendoor3000@gmail.com>
@@ -0,0 +1,146 @@
/*
Copyright 2021 The Volcano Authors.
Copy link
Member

Choose a reason for hiding this comment

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

Please change to 2024.

package resourcequota

import (
"fmt"
Copy link
Member

Choose a reason for hiding this comment

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

Please sort imports.

Plugins: []conf.PluginOption{
{
Name: PluginName,
//Arguments: test.arguments,
Copy link
Member

Choose a reason for hiding this comment

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

commented code can be removed.

job: &api.JobInfo{
UID: "1",
Namespace: "namespace1",
PodGroup: &api.PodGroup{
Copy link
Member

Choose a reason for hiding this comment

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

we can define a function in pkg/scheduler/util/test_utils.go to generate the wanted podgroup, so that code looks more clean.

}
defer framework.CloseSession(ssn)
plugin := &resourceQuotaPlugin{}
plugin.OnSessionOpen(ssn)
Copy link
Member

Choose a reason for hiding this comment

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

framework.OpenSession will run alll your registered plugins'.

@lowang-bh
Copy link
Member

@Subhasish-Behera now we can use the pkg/scheduler/uthelper package to refact the UTs and clean code. please refer the examples: #3341, #3364

@Subhasish-Behera
Copy link
Author

@lowang-bh thanks for informing. will make the necessary changes to get this merged

@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 7, 2024
@volcano-sh-bot
Copy link
Contributor

@Subhasish-Behera: PR needs rebase.

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.

@googs1025
Copy link
Member

@Subhasish-Behera Hi, thank you for your contribution! The related functions have been merged. refer to: #3452 (comment)

@lowang-bh
Copy link
Member

/close

@volcano-sh-bot
Copy link
Contributor

@lowang-bh: Closed this PR.

In response to this:

/close

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. 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.

[good first issue]enrich the unit-test for some package
5 participants