Skip to content

CM-261: utilize ginkgo label filter to differentiate cloud platforms#194

Merged
openshift-merge-bot[bot] merged 2 commits intoopenshift:masterfrom
lunarwhite:label-filter
Oct 25, 2024
Merged

CM-261: utilize ginkgo label filter to differentiate cloud platforms#194
openshift-merge-bot[bot] merged 2 commits intoopenshift:masterfrom
lunarwhite:label-filter

Conversation

@lunarwhite
Copy link
Member

Main changes:

  • Bump onsi/gingko/v2 to v2.19.
    • To make use of the newly introduced Label Sets feature. Benefits:
      • It is more expressive and human-readable than regexp combining --focus and --skip.
      • It extends the current --label-filter to support filtering by key-value pairs, with the contains and not contains operations for the labels that have values. (more example usages can be found in the doc)
      • It gives more flexibility in filtering and sorting tests based on labels. As the test suite grows, we might apply more label types to identify Serial/Disruptive, Alpha/Beta, Conformance/MinVersion:xxx, etc.
  • Add an env variable E2E_GINKGO_LABEL_FILTER in the Makefile. Append -ginkgo.label-filter=$(E2E_GINKGO_LABEL_FILTER) to the go test command.
  • Apply labels "Platform:AWS", "Platform:GCP" and "Platform:IBM" to cases description accordingly.
  • Set the default value of E2E_GINKGO_LABEL_FILTER in the Makefile to "Platform: isSubsetOf {AWS}".
    • It would then select and run both non-platform-specific and AWS-only cases.

Other changes:

  • Remove some hardcoded skipping logic.
  • Regroup ACME dns-01 cases by their provider platform. Each dns-01 provider now will have a dedicated Context().

I've tested on the GCP cluster. It shows: (skipped 3 cases labeled "Platform:AWS", 1 labeled "Platform:IBM")

go test \
-timeout 1h \
-count 1 \
-v \
-p 1 \
-tags e2e \
-run "" \
./test/e2e \
-ginkgo.label-filter="Platform: isSubsetOf {GCP}"

...

Ran 17 of 21 Specs in 524.481 seconds
SUCCESS! -- 17 Passed | 0 Failed | 0 Pending | 4 Skipped
--- PASS: TestAll (524.49s)
PASS
ok  	github.com/openshift/cert-manager-operator/test/e2e	846.604s

@openshift-ci-robot
Copy link

openshift-ci-robot commented Jul 24, 2024

@lunarwhite: This pull request references CM-261 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.17.0" version, but no target version was set.

Details

In response to this:

Main changes:

  • Bump onsi/gingko/v2 to v2.19.
  • To make use of the newly introduced Label Sets feature. Benefits:
    • It is more expressive and human-readable than regexp combining --focus and --skip.
    • It extends the current --label-filter to support filtering by key-value pairs, with the contains and not contains operations for the labels that have values. (more example usages can be found in the doc)
    • It gives more flexibility in filtering and sorting tests based on labels. As the test suite grows, we might apply more label types to identify Serial/Disruptive, Alpha/Beta, Conformance/MinVersion:xxx, etc.
  • Add an env variable E2E_GINKGO_LABEL_FILTER in the Makefile. Append -ginkgo.label-filter=$(E2E_GINKGO_LABEL_FILTER) to the go test command.
  • Apply labels "Platform:AWS", "Platform:GCP" and "Platform:IBM" to cases description accordingly.
  • Set the default value of E2E_GINKGO_LABEL_FILTER in the Makefile to "Platform: isSubsetOf {AWS}".
  • It would then select and run both non-platform-specific and AWS-only cases.

Other changes:

  • Remove some hardcoded skipping logic.
  • Regroup ACME dns-01 cases by their provider platform. Each dns-01 provider now will have a dedicated Context().

I've tested on the GCP cluster. It shows: (skipped 3 cases labeled "Platform:AWS", 1 labeled "Platform:IBM")

go test \
-timeout 1h \
-count 1 \
-v \
-p 1 \
-tags e2e \
-run "" \
./test/e2e \
-ginkgo.label-filter="Platform: isSubsetOf {GCP}"

...

Ran 17 of 21 Specs in 524.481 seconds
SUCCESS! -- 17 Passed | 0 Failed | 0 Pending | 4 Skipped
--- PASS: TestAll (524.49s)
PASS
ok  	github.com/openshift/cert-manager-operator/test/e2e	846.604s

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 24, 2024
@openshift-ci openshift-ci bot requested review from deads2k and swghosh July 24, 2024 06:14
@lunarwhite
Copy link
Member Author

lunarwhite commented Jul 24, 2024

/uncc deads2k
/cc @swghosh @TrilokGeer

CI is green. Mark it as ready for review now.

To keep it simple and easy for review and updates, I created this separate PR for CM-261. I didn't touch the main logic of the existing cases, so your comments in #181 are not fully addressed. After this is done, we can rebase and update #181.

@openshift-ci openshift-ci bot requested review from TrilokGeer and removed request for deads2k July 24, 2024 08:22
Copy link
Member

@swghosh swghosh left a comment

Choose a reason for hiding this comment

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

Generally, LGTM
great work @lunarwhite thanks for this!
I'll take another closer look into the test/e2e/certificates_test.go later during the week.

-run "$(TEST)" \
./test/e2e
./test/e2e \
-ginkgo.label-filter=$(E2E_GINKGO_LABEL_FILTER)
Copy link
Member

Choose a reason for hiding this comment

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

Does addition of this skip the non-ginkgo tests present in test/e2e/cert_manager_deployment_test.go?
It seems fine to me if it does, because those tests are essentially repetition of what's also in the ginkgo suite so we can skip them during e2e runs moving forward (we have had this behaviour tested for long and it isn't a problem).

Copy link
Member Author

Choose a reason for hiding this comment

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

This filter only applies to tests in the Ginkgo framework. The test/e2e/cert_manager_deployment_test.go go tests would not be affected.

Makefile Outdated
.PHONY: lint
lint:
$(GOLANGCI_LINT) run --config .golangci.yaml
lint:
Copy link
Member

Choose a reason for hiding this comment

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

Not sure why these whitespace changes? (maybe your local linter is mis-behaving)

Copy link
Member Author

Choose a reason for hiding this comment

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

Will undo these changes as they are not related to this PR. (Yeah. I've set the "files.trimTrailingWhitespace": true in my vscode editor)

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 21, 2024
@swghosh
Copy link
Member

swghosh commented Aug 21, 2024

/test all

Signed-off-by: Yuedong Wu <yuewu@redhat.com>
Signed-off-by: Yuedong Wu <yuewu@redhat.com>
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 21, 2024
@swghosh
Copy link
Member

swghosh commented Aug 30, 2024

/lgtm
/label docs-approved
/label px-approved
(non-user facing, only e2e test related changes)

@openshift-ci openshift-ci bot added docs-approved Signifies that Docs has signed off on this PR px-approved Signifies that Product Support has signed off on this PR labels Aug 30, 2024
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 30, 2024
@swghosh
Copy link
Member

swghosh commented Oct 17, 2024

/assign @TrilokGeer

@swghosh swghosh removed their assignment Oct 17, 2024
@swghosh
Copy link
Member

swghosh commented Oct 22, 2024

/approve
/hold
/test all

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 22, 2024
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 22, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lunarwhite, swghosh

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

The pull request process is described here

Details 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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 22, 2024
@swghosh
Copy link
Member

swghosh commented Oct 23, 2024

/remove-hold
/retest-required

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 23, 2024
@lunarwhite
Copy link
Member Author

/retest-required

@lunarwhite
Copy link
Member Author

self-adding
/label qe-approved

@openshift-ci openshift-ci bot added the qe-approved Signifies that QE has signed off on this PR label Oct 25, 2024
@openshift-ci-robot
Copy link

openshift-ci-robot commented Oct 25, 2024

@lunarwhite: This pull request references CM-261 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.18.0" version, but no target version was set.

Details

In response to this:

Main changes:

  • Bump onsi/gingko/v2 to v2.19.
  • To make use of the newly introduced Label Sets feature. Benefits:
    • It is more expressive and human-readable than regexp combining --focus and --skip.
    • It extends the current --label-filter to support filtering by key-value pairs, with the contains and not contains operations for the labels that have values. (more example usages can be found in the doc)
    • It gives more flexibility in filtering and sorting tests based on labels. As the test suite grows, we might apply more label types to identify Serial/Disruptive, Alpha/Beta, Conformance/MinVersion:xxx, etc.
  • Add an env variable E2E_GINKGO_LABEL_FILTER in the Makefile. Append -ginkgo.label-filter=$(E2E_GINKGO_LABEL_FILTER) to the go test command.
  • Apply labels "Platform:AWS", "Platform:GCP" and "Platform:IBM" to cases description accordingly.
  • Set the default value of E2E_GINKGO_LABEL_FILTER in the Makefile to "Platform: isSubsetOf {AWS}".
  • It would then select and run both non-platform-specific and AWS-only cases.

Other changes:

  • Remove some hardcoded skipping logic.
  • Regroup ACME dns-01 cases by their provider platform. Each dns-01 provider now will have a dedicated Context().

I've tested on the GCP cluster. It shows: (skipped 3 cases labeled "Platform:AWS", 1 labeled "Platform:IBM")

go test \
-timeout 1h \
-count 1 \
-v \
-p 1 \
-tags e2e \
-run "" \
./test/e2e \
-ginkgo.label-filter="Platform: isSubsetOf {GCP}"

...

Ran 17 of 21 Specs in 524.481 seconds
SUCCESS! -- 17 Passed | 0 Failed | 0 Pending | 4 Skipped
--- PASS: TestAll (524.49s)
PASS
ok  	github.com/openshift/cert-manager-operator/test/e2e	846.604s

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 25, 2024

@lunarwhite: all tests passed!

Full PR test history. Your PR dashboard.

Details

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-sigs/prow repository. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot bot merged commit 9902ec3 into openshift:master Oct 25, 2024
@lunarwhite lunarwhite deleted the label-filter branch October 25, 2024 05:12
@lunarwhite
Copy link
Member Author

/cherry-pick cert-manager-1.15

@openshift-cherrypick-robot

@lunarwhite: new pull request created: #251

Details

In response to this:

/cherry-pick cert-manager-1.15

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-sigs/prow repository.

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. docs-approved Signifies that Docs has signed off on this PR jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. px-approved Signifies that Product Support has signed off on this PR qe-approved Signifies that QE has signed off on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants