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

test: Skip change detection for tests that assert panic #883

Conversation

shahzadlone
Copy link
Member

Relevant issue(s)

Resolves #882

Description

  • Skip change detector for tests that assert for panics.
  • Clean up assertion of panic and skipping of change detector into a utility function.

Tasks

  • I made sure the code is well commented, particularly hard-to-understand areas.
  • I made sure the repository-held documentation is changed accordingly.
  • I made sure the pull request title adheres to the conventional commit style (the subset used in the project can be found in tools/configs/chglog/config.yml).
  • I made sure to discuss its limitations such as threats to validity, vulnerability to mistake and misuse, robustness to invalidation of assumptions, resource requirements, ...

How has this been tested?

CI & Locally

Specify the platform(s) on which this was tested:

  • Manjaro Wsl2

@shahzadlone shahzadlone added area/testing Related to any test or testing suite action/no-benchmark Skips the action that runs the benchmark. labels Oct 7, 2022
@shahzadlone shahzadlone added this to the DefraDB v0.4 milestone Oct 7, 2022
@shahzadlone shahzadlone requested a review from a team October 7, 2022 18:10
@shahzadlone shahzadlone self-assigned this Oct 7, 2022
assert.Panics(t, func() {
executeTestCase(t, test)
})
testUtils.AssertPanicAndSkipChangeDetection(t, func() { executeTestCase(t, test) })
Copy link
Contributor

@AndrewSisley AndrewSisley Oct 7, 2022

Choose a reason for hiding this comment

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

thought: I was thinking more of adding a bool prop to the QueryTestCase struct and handling the skip within testUtils.executeTestCase - but this works too. Cheers for sorting it out

Copy link
Member Author

Choose a reason for hiding this comment

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

I thought about that too, but IMO this gives us slightly more control (can assert a function other than executeTestCase if one desires) also wanted to avoid crowding QueryTestCase with another bool.

Copy link
Member Author

Choose a reason for hiding this comment

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

Can revisit this in the future and is an easy change if we do prefer that route.

Copy link
Contributor

@AndrewSisley AndrewSisley left a comment

Choose a reason for hiding this comment

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

LGTM, added a quick thought, but happy as-is

@shahzadlone shahzadlone force-pushed the lone/test/omit-panic-asserted-tests-from-change-detection branch from 8713134 to 067ff04 Compare October 7, 2022 18:15
@shahzadlone shahzadlone merged commit be7541c into develop Oct 7, 2022
@shahzadlone shahzadlone deleted the lone/test/omit-panic-asserted-tests-from-change-detection branch October 7, 2022 18:30
shahzadlone added a commit to shahzadlone/defradb that referenced this pull request Feb 23, 2024
…k#883)

- Resolves sourcenetwork#882 
- Skip change detector for tests that assert for panics.
- Clean up the assertion of panic and skipping of the change detector into a utility function.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action/no-benchmark Skips the action that runs the benchmark. area/testing Related to any test or testing suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Skip change detection for all documented panic tests
2 participants