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

[E2E] add test case for resource interpreter customization #2839

Merged
merged 1 commit into from
Nov 22, 2022

Conversation

jameszhangyukun
Copy link
Contributor

Signed-off-by: zhangyukun 38148677+jameszhangyukun@users.noreply.github.com

What type of PR is this?
/kind feature

What this PR does / why we need it:
add test case for resource interpreter customization:

  • AggregateStatus
  • Retain
  • InterpretStatus
  • InterpretHealth

Which issue(s) this PR fixes:
part of #2371

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

@karmada-bot karmada-bot added the kind/feature Categorizes issue or PR as related to a new feature. label Nov 20, 2022
@karmada-bot karmada-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 20, 2022
@codecov-commenter
Copy link

codecov-commenter commented Nov 20, 2022

Codecov Report

Merging #2839 (1a4829e) into master (8aa58ec) will increase coverage by 0.05%.
The diff coverage is 80.00%.

@@            Coverage Diff             @@
##           master    #2839      +/-   ##
==========================================
+ Coverage   37.89%   37.94%   +0.05%     
==========================================
  Files         190      190              
  Lines       17681    17706      +25     
==========================================
+ Hits         6700     6719      +19     
- Misses      10574    10578       +4     
- Partials      407      409       +2     
Flag Coverage Δ
unittests 37.94% <80.00%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ceinterpreter/configurableinterpreter/luavm/lua.go 59.40% <80.00%> (+1.35%) ⬆️
pkg/search/proxy/store/util.go 93.36% <0.00%> (-0.48%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@RainbowMango
Copy link
Member

/assign @XiShanYongYe-Chang

Copy link
Member

@XiShanYongYe-Chang XiShanYongYe-Chang left a comment

Choose a reason for hiding this comment

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

Thanks for your hard work~

test/e2e/framework/deployment.go Show resolved Hide resolved
test/e2e/framework/deployment.go Outdated Show resolved Hide resolved
test/e2e/resourceinterpreter_test.go Outdated Show resolved Hide resolved
test/e2e/resourceinterpreter_test.go Outdated Show resolved Hide resolved
test/e2e/resourceinterpreter_test.go Show resolved Hide resolved
@jameszhangyukun jameszhangyukun force-pushed the e2e-custom branch 2 times, most recently from bd7f006 to 10388e6 Compare November 21, 2022 11:53
test/e2e/framework/deployment.go Outdated Show resolved Hide resolved
test/e2e/resourceinterpreter_test.go Outdated Show resolved Hide resolved
test/e2e/resourceinterpreter_test.go Show resolved Hide resolved
test/e2e/resourceinterpreter_test.go Show resolved Hide resolved
test/e2e/resourceinterpreter_test.go Show resolved Hide resolved
test/e2e/resourceinterpreter_test.go Outdated Show resolved Hide resolved
test/e2e/resourceinterpreter_test.go Outdated Show resolved Hide resolved
test/e2e/framework/deployment.go Outdated Show resolved Hide resolved
test/e2e/resourceinterpreter_test.go Outdated Show resolved Hide resolved
test/e2e/resourceinterpreter_test.go Show resolved Hide resolved
test/e2e/resourceinterpreter_test.go Show resolved Hide resolved
test/e2e/resourceinterpreter_test.go Outdated Show resolved Hide resolved
test/e2e/resourceinterpreter_test.go Show resolved Hide resolved
@jameszhangyukun
Copy link
Contributor Author

cc @ikaven1024 @XiShanYongYe-Chang

@jameszhangyukun jameszhangyukun force-pushed the e2e-custom branch 2 times, most recently from 46ca87d to 06b7f84 Compare November 22, 2022 08:01
@XiShanYongYe-Chang
Copy link
Member

LGTM
/assign @ikaven1024

test/e2e/framework/deployment.go Show resolved Hide resolved
})

// Wait executeController to reconcile then check if it is retained
time.Sleep(waitTime)
Copy link
Member

Choose a reason for hiding this comment

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

I don't think Sleep is a good way. Could we design the test as follower:

  1. Create retention like
desiredObj.FooField = observedObj.FooField
  1. Then update object in controller panel from
FooField: foo
BarFiled: bar

to

FooField: foo1
BarFiled: bar1
  1. Wait object in member cluster to be:
FooField: foo
BarFiled: bar1
```

That says our update is going into effect, and our interpreter works.

Copy link
Member

Choose a reason for hiding this comment

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

It looks great. Because this modification also involves other cases:

https://github.com/karmada-io/karmada/blob/master/test/e2e/resourceinterpreter_test.go#L106-L118

So I will send a pr later,

Signed-off-by: zhangyukun <38148677+jameszhangyukun@users.noreply.github.com>
@XiShanYongYe-Chang
Copy link
Member

/lgtm
/approve

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Nov 22, 2022
@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: XiShanYongYe-Chang

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

@karmada-bot karmada-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 22, 2022
@karmada-bot karmada-bot merged commit 4870c30 into karmada-io:master Nov 22, 2022
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.

6 participants