Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Introduce test(no_rows) hint #2130

Open
Assignees
Labels
enhancementNew feature or request
Milestone

Description

Currently /*+test */ creates a snapshot for the results returned by the table the hint is annotating. This works great for tests where users want to assert a certain result set.

However, we are increasingly seeing users writing tests to assert that certain invariants are true and the way those are written is that they return empty tables if they are green (i.e. no records violate the invariant/condition) or the violating records if there are test failures.

That works great for testing conditions on lots of test data, but its a bit awkward with the current snapshot testing because it creates empty snapshots for all these tests and those need to be checked into the repository.

It would be cleaner to add a /*+test(no_rows) */ hint which extends the current hint with a parameter: no_rows. When that is set, the assertion is that the table returns no records. Hence, we don't need to create a snapshot: the test runner validates that the result set is empty and if it is not, it prints out all records as test failures.

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

Status
Backlog

Relationships

None yet

Development

No branches or pull requests

Issue actions

    AltStyle によって変換されたページ (->オリジナル) /