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 pkg cloud custom-pricing #22

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jxs1211
Copy link

@jxs1211 jxs1211 commented Sep 18, 2022

Signed-off-by: jxs1211 [email protected]

Description
ut

Related Issues
N/A

New Behavior (screenshots if needed)
PS D:\shen\go\open_source\fadvisor\pkg\cloud> go test -v -cover
=== RUN TestPriceConfig_UpdateConfigFromConfigMap
=== RUN TestPriceConfig_UpdateConfigFromConfigMap/base
=== RUN TestPriceConfig_UpdateConfigFromConfigMap/SetCustomPricing_raise_an_error
=== RUN TestPriceConfig_UpdateConfigFromConfigMap/SetCustomPricing_ok
--- PASS: TestPriceConfig_UpdateConfigFromConfigMap (0.00s)
--- PASS: TestPriceConfig_UpdateConfigFromConfigMap/base (0.00s)
--- PASS: TestPriceConfig_UpdateConfigFromConfigMap/SetCustomPricing_raise_an_error (0.00s)
--- PASS: TestPriceConfig_UpdateConfigFromConfigMap/SetCustomPricing_ok (0.00s)
=== RUN TestSetCustomPricing
=== RUN TestSetCustomPricing/base
=== RUN TestSetCustomPricing/value_is_not_float_type
=== RUN TestSetCustomPricing/value_is_float_type
--- PASS: TestSetCustomPricing (0.00s)
--- PASS: TestSetCustomPricing/base (0.00s)
--- PASS: TestSetCustomPricing/value_is_not_float_type (0.00s)
--- PASS: TestSetCustomPricing/value_is_float_type (0.00s)
PASS
coverage: 32.8% of statements
ok github.com/gocrane/fadvisor/pkg/cloud 1.279s

Signed-off-by: jxs1211 <[email protected]>
@jxs1211 jxs1211 changed the title Test pkg cloud Test pkg cloud custom-pricing Sep 18, 2022
@@ -125,11 +125,11 @@ func SetCustomPricing(obj *CustomPricing, name string, value string) error {
return fmt.Errorf("cannot set %s field value", name)
}

structFieldType := structFieldValue.Type()
// structFieldType := structFieldValue.Type()
Copy link
Member

Choose a reason for hiding this comment

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

why change this?

Copy link
Author

@jxs1211 jxs1211 Sep 23, 2022

Choose a reason for hiding this comment

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

why change this?
@qmhu @mfanjie
It seems there is a bug in the logic, modify the logic of the validation to make it reasonable

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.

2 participants