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

New integration test approach #537

Merged
merged 20 commits into from
Aug 2, 2024

Conversation

max-sixty
Copy link
Collaborator

@max-sixty max-sixty commented Jul 28, 2024

Very draft — but shows a reasonably scalable way to add integration tests. There are some TODOs at the top.

This would help with issues such as #531

Replaced the existing integration tests with a new approach, which:

  • Copies a set of files defined inline into a temp dir, executes tests, and then shows the diff
  • Allows adding integration tests much more easily — including whole repo tests — so problems we've had with cargo-insta are very tractable to solve
  • Adds the repro of @regexident as a test for Fix snapshots within a nested crate #531 (which currently will fail; requires merging this first and then we'll un-skip the test)
  • ...while it might be overkill for the existing tests, it already allows us to remove some complicated code which was handling tests-running-tests. And it lets us do much more.

This is stacked on #540, that should merge first merged

Very draft — but shows a reasonably scalable way to add integration tests. There are some TODOs at the top.

This would help with issues such as mitsuhiko#531
@max-sixty max-sixty force-pushed the integration-test-framework branch from 24bffc9 to 4d4f731 Compare July 28, 2024 22:30
@max-sixty max-sixty changed the title Add an example of an integration test Add example of a new type of internal integration test Jul 28, 2024
@max-sixty max-sixty changed the title Add example of a new type of internal integration test New integration test framework Jul 29, 2024
@max-sixty max-sixty changed the title New integration test framework New integration test approach Jul 29, 2024
CHANGELOG.md Outdated Show resolved Hide resolved
@max-sixty max-sixty requested a review from mitsuhiko July 29, 2024 17:05
max-sixty added a commit to max-sixty/insta that referenced this pull request Jul 31, 2024
This allows a project to default to `nextest` in its insta config, while falling back to `cargo test` when that isn't available.

Stacks on mitsuhiko#544

Needs an integration test, will add when mitsuhiko#537 merges
@mitsuhiko mitsuhiko merged commit 204b8be into mitsuhiko:master Aug 2, 2024
15 checks passed
@max-sixty max-sixty deleted the integration-test-framework branch August 2, 2024 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants