[red-knot] Expand test corpus (#14360)

## Summary

- Add 383 files from `crates/ruff_python_parser/resources` to the test
corpus
- Add 1296 files from `crates/ruff_linter/resources` to the test corpus
- Use in-memory file system for tests
- Improve test isolation by cleaning the test environment between checks
- Add a mechanism for "known failures". Mark ~80 files as known
failures.
- The corpus test is now a lot slower (6 seconds).

Note:
While `red_knot` as a command line tool can run over all of these
files without panicking, we still have a lot of test failures caused by
explicitly "pulling" all types.

## Test Plan

Run `cargo test -p red_knot_workspace` while making sure that
- Introducing code that is known to lead to a panic fails the test
- Removing code that is known to lead to a panic from
`KNOWN_FAILURES`-files also fails the test
This commit is contained in:
David Peter 2024-11-15 17:09:15 +01:00 committed by GitHub
parent 62d650226b
commit 9f3235a37f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 201 additions and 30 deletions

View file

@ -491,6 +491,12 @@ impl From<&str> for SystemPathBuf {
}
}
impl From<String> for SystemPathBuf {
fn from(value: String) -> Self {
SystemPathBuf::from_utf8_path_buf(Utf8PathBuf::from(value))
}
}
impl Default for SystemPathBuf {
fn default() -> Self {
Self::new()