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 expected_msg_substring arg. to wgpu_test::fail #5290

Merged
merged 3 commits into from
May 21, 2024

Conversation

ErichDonGubler
Copy link
Member

@ErichDonGubler ErichDonGubler commented Feb 22, 2024

Connections
Link to the issues addressed by this PR, or dependent PRs in other repositories

Motivated by discussion in (and based on code from) another PR: #5282 (comment)

Description
Describe what problem this is solving, and how it's solved.

Until now, we accept any validation failure inside a callback passed to wgpu_test::fail. This is a very broad error condition, and may allow errors for the wrong reason. Now, we'd like to tighten up the failures that we actually expect from these tests. Also, this would let us factor out some error scope boilerplate introduced for the tests in #5282.

Testing
Explain how this change is tested.

This is a refactor of tests to make them more narrow, and they still pass. ✅

Checklist

  • Run cargo fmt.
  • Run cargo clippy. If applicable, add:
    • --target wasm32-unknown-unknown
    • --target wasm32-unknown-emscripten
  • Run cargo xtask test to run tests.
  • Add change to CHANGELOG.md. See simple instructions inside file. Seems like none should be necessary here?

@ErichDonGubler ErichDonGubler added area: tests Improvements or issues with our test suite kind: refactor Making existing function faster or nicer labels Feb 22, 2024
@ErichDonGubler ErichDonGubler self-assigned this Feb 22, 2024
tests/src/lib.rs Outdated Show resolved Hide resolved
@ErichDonGubler ErichDonGubler force-pushed the fail-test-msg-arg branch 2 times, most recently from 7ff3ce0 to 73fc369 Compare February 26, 2024 17:36
@ErichDonGubler ErichDonGubler force-pushed the fail-test-msg-arg branch 2 times, most recently from 2d21499 to d538fd2 Compare April 2, 2024 01:05
@ErichDonGubler ErichDonGubler force-pushed the fail-test-msg-arg branch 3 times, most recently from e88b183 to e3eaa43 Compare May 17, 2024 18:17
@ErichDonGubler ErichDonGubler marked this pull request as ready for review May 17, 2024 18:19
@ErichDonGubler ErichDonGubler requested a review from a team as a code owner May 17, 2024 18:19
Copy link
Member

@Wumpf Wumpf left a comment

Choose a reason for hiding this comment

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

nice! I did something similar here, but in a less intrusive way (because the pr shouldn't also drag in such a large refactor)

https://github.com/gfx-rs/wgpu/pull/5671/files#diff-aeefe6b3d3f8b1b5248d6bb4c2888cf2d6802dbf82515f7b02b6a89a1400228fR35

(will happily move my stuff to this new variant once we get the stuff that comes before it merged :/)

@ErichDonGubler
Copy link
Member Author

Rebasing required migrating new tests from #5715, resulting in 7d40e5b and 7bccffb.

@ErichDonGubler ErichDonGubler enabled auto-merge (rebase) May 21, 2024 20:53
@ErichDonGubler ErichDonGubler merged commit ccccffd into gfx-rs:trunk May 21, 2024
25 checks passed
@ErichDonGubler ErichDonGubler deleted the fail-test-msg-arg branch May 22, 2024 03:08
@ErichDonGubler ErichDonGubler restored the fail-test-msg-arg branch May 30, 2024 21:02
@ErichDonGubler ErichDonGubler deleted the fail-test-msg-arg branch May 30, 2024 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: tests Improvements or issues with our test suite kind: refactor Making existing function faster or nicer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants