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

Add exact comparison for events #6296

Merged

Conversation

l-qing
Copy link
Contributor

@l-qing l-qing commented Mar 5, 2023

fix #6306

For those who are writing unit tests for the first time, they may instinctively copy the event information from the error message.
However, if the error message contains special characters that are not properly escaped, the unit test will fail.
This requires the user to examine the source code to understand the reason for the failure.
With this optimization, it could be more beginner-friendly.

Changes

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • Has Docs included if any changes are user facing
  • Has Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including
    functionality, content, code)
  • Has a kind label. You can add one by adding a comment on this PR that contains /kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tep
  • Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings)
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

NONE

@tekton-robot tekton-robot added the release-note-none Denotes a PR that doesnt merit a release note. label Mar 5, 2023
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Mar 5, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

@tekton-robot tekton-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 5, 2023
@tekton-robot
Copy link
Collaborator

Hi @l-qing. Thanks for your PR.

I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@l-qing l-qing force-pushed the feat/check-events-support-literal-wildcard branch from 10943ad to ce6926b Compare March 5, 2023 08:43
@l-qing l-qing changed the title feat: Add support for literal wildcard comparisons when checking events Add literal event comparison support Mar 5, 2023
@l-qing
Copy link
Contributor Author

l-qing commented Mar 5, 2023

/kind flake

@tekton-robot tekton-robot added the kind/flake Categorizes issue or PR as related to a flakey test label Mar 5, 2023
@l-qing
Copy link
Contributor Author

l-qing commented Mar 5, 2023

/test check-pr-has-kind-label

@tekton-robot
Copy link
Collaborator

@l-qing: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/test check-pr-has-kind-label

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.

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/events/k8sevent/events.go 76.2% 78.3% 2.1

@l-qing l-qing force-pushed the feat/check-events-support-literal-wildcard branch from ce6926b to eb29c6d Compare March 5, 2023 08:54
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/events/k8sevent/events.go 76.2% 78.3% 2.1

@l-qing l-qing force-pushed the feat/check-events-support-literal-wildcard branch 2 times, most recently from f9ef5a4 to 91e769c Compare March 7, 2023 01:16
@l-qing l-qing changed the title Add literal event comparison support Add exact comparison for events Mar 7, 2023
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/events/k8sevent/events.go 76.2% 78.3% 2.1

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/events/k8sevent/events.go 76.2% 78.3% 2.1

@l-qing l-qing force-pushed the feat/check-events-support-literal-wildcard branch from 91e769c to 92b2adf Compare March 7, 2023 01:39
@tekton-robot tekton-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 7, 2023
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/events/k8sevent/events.go 76.2% 78.3% 2.1

@tekton-robot
Copy link
Collaborator

@l-qing: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/ok-to-test

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.

@afrittoli
Copy link
Member

/ok-to-test

@tekton-robot tekton-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 7, 2023
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/events/k8sevent/events.go 76.2% 78.3% 2.1

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vdemeester

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

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 8, 2023
@l-qing l-qing force-pushed the feat/check-events-support-literal-wildcard branch from 92b2adf to ba0e954 Compare March 9, 2023 15:44
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/events/k8sevent/events.go 76.2% 78.3% 2.1

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/events/k8sevent/events.go 76.2% 78.3% 2.1

@l-qing l-qing force-pushed the feat/check-events-support-literal-wildcard branch from ba0e954 to 5c154af Compare March 10, 2023 13:25
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/events/k8sevent/events.go 76.2% 78.3% 2.1

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/events/k8sevent/events.go 76.2% 78.3% 2.1

@l-qing l-qing force-pushed the feat/check-events-support-literal-wildcard branch from 5c154af to 88d5bbc Compare March 11, 2023 03:12
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/events/k8sevent/events.go 76.2% 78.3% 2.1

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/events/k8sevent/events.go 76.2% 78.3% 2.1

For those who are writing unit tests for the first time, they may
instinctively copy the event information from the error message.
However, if the error message contains special characters that are
not properly escaped, the unit test will fail.
This requires the user to examine the source code to understand they
reason For the failure.
With this optimization, it could be more beginner-friendly.
@l-qing l-qing force-pushed the feat/check-events-support-literal-wildcard branch from 88d5bbc to 108b9c6 Compare March 14, 2023 01:27
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/events/k8sevent/events.go 76.2% 78.3% 2.1

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/events/k8sevent/events.go 76.2% 78.3% 2.1

Copy link
Member

@jerop jerop left a comment

Choose a reason for hiding this comment

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

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 14, 2023
@tekton-robot tekton-robot merged commit e8c14bd into tektoncd:main Mar 14, 2023
@l-qing l-qing deleted the feat/check-events-support-literal-wildcard branch March 19, 2023 15:59
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/flake Categorizes issue or PR as related to a flakey test lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesnt merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Event comparison during unit testing does not match the expected result
5 participants