karmada-io / karmada

Open, Multi-Cloud, Multi-Cluster Kubernetes Orchestration
https://karmada.io
Apache License 2.0
4.37k stars 865 forks source link

test/e2e: unify access to cluster members utilizing `framework.ClusterMembers()[i]` #5226

Closed mohamedawnallah closed 1 month ago

mohamedawnallah commented 1 month ago

Description

Unify access to cluster members utilizing framework.ClusterMembers()[i].

What type of PR is this?

/kind cleanup [not sure if this is the correct kind of PR!]

Which issue(s) this PR fixes:

Motivated by @XiShanYongYe-Chang's comment: https://github.com/karmada-io/karmada/pull/5195#discussion_r1680354650

Does this PR introduce a user-facing change?:

NONE
karmada-bot commented 1 month ago

@mohamedawnallah: The label(s) kind/[not, kind/sure, kind/if, kind/this, kind/is, kind/the, kind/correct, kind/kind, kind/of, kind/pr!] cannot be applied, because the repository doesn't have them.

In response to [this](https://github.com/karmada-io/karmada/pull/5226): >**Description** > >Unify access to cluster members utilizing `framework.ClusterMembers()[i]`. > >**What type of PR is this?** > >/kind cleanup [not sure if this is the correct kind of PR!] > > > >**Which issue(s) this PR fixes**: > >Motivated by @XiShanYongYe-Chang's comment: >https://github.com/karmada-io/karmada/pull/5195#discussion_r1680354650 > > >**Does this PR introduce a user-facing change?**: > >```release-note >NONE >``` > > Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
codecov-commenter commented 1 month ago

:warning: Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 28.26%. Comparing base (871e2bf) to head (2a55c98). Report is 2 commits behind head on master.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #5226 +/- ## ======================================= Coverage 28.25% 28.26% ======================================= Files 632 632 Lines 43739 43739 ======================================= + Hits 12359 12361 +2 + Misses 30479 30478 -1 + Partials 901 900 -1 ``` | [Flag](https://app.codecov.io/gh/karmada-io/karmada/pull/5226/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=karmada-io) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/karmada-io/karmada/pull/5226/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=karmada-io) | `28.26% <ø> (+<0.01%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=karmada-io#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

XiShanYongYe-Chang commented 1 month ago

@mohamedawnallah Thanks~ Good Job. /cc @Vacant2333 @zhzhuang-zju

zhzhuang-zju commented 1 month ago

thanks~ cc @Vacant2333 @XiShanYongYe-Chang /lgtm

karmada-bot commented 1 month ago

[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: - ~~[test/OWNERS](https://github.com/karmada-io/karmada/blob/master/test/OWNERS)~~ [XiShanYongYe-Chang] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
mohamedawnallah commented 1 month ago

Thanks @XiShanYongYe-Chang! For full context, There was one place where we hard-code cluster names in test package: https://github.com/karmada-io/karmada/blob/61a3d1f815859630d9bda0160f1082dd69802714/test/helper/policy.go#L175-L190

I tried to use framework.ClusterNames() but it causes import cycle since it is used in framework package. Should we do anything about it?

XiShanYongYe-Chang commented 1 month ago

You can try to use the input parameter to transfer the cluster information.

mohamedawnallah commented 1 month ago

@XiShanYongYe-Chang Okay gonna submit a follow-up patch for this 👍