Skip to content

EventType Test Logical Error #7158

@Leo6Leo

Description

@Leo6Leo

Describe the bug

I am trying to running the rekt test TestPingSourceWithEventTypes, in the eventing/test/rekt/pingsource_test.go
And the test config can be found in test/rekt/features/pingsource/feature.go

In the test config, it says

Must("PingSource test eventtypes match", eventtype.WaitForEventType(
			eventtype.AssertPresent(expectedCeTypes)))

I added a logger within AssertPresent, as you can see here test/rekt/resources/eventtype/eventtype.go

After running the test, I noticed an issue with the logic. The test checks whether eventtypesCount equals len(etl.Items) to verify if an eventType object is created. However, it currently allows for a scenario where both are at 0. This means that even when no eventType object is created, the test will still return as successful. This is a problem from my perspective because the primary purpose of the test is to validate the existence of an eventType object.

Expected behavior
The test should be logically correct.

To Reproduce

  • Set the break point at the line I suggested above
  • Start debugger
  • Read the value of the variable

Additional context
CNCF Slack Channel discussion thread can be found here

Metadata

Metadata

Assignees

Labels

area/test-and-releaseTest infrastructure, tests or releasekind/bugCategorizes issue or PR as related to a bug.triage/acceptedIssues which should be fixed (post-triage)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions