mirror of
https://github.com/astral-sh/ruff.git
synced 2025-07-24 13:33:50 +00:00
[ty] Use more parallelism when running corpus tests (#18711)
This commit is contained in:
parent
2b15f1d240
commit
5e57e4680f
1 changed files with 17 additions and 14 deletions
|
@ -12,6 +12,8 @@ use ty_python_semantic::{
|
|||
SearchPathSettings, default_lint_registry,
|
||||
};
|
||||
|
||||
use test_case::test_case;
|
||||
|
||||
fn get_cargo_workspace_root() -> anyhow::Result<SystemPathBuf> {
|
||||
Ok(SystemPathBuf::from(String::from_utf8(
|
||||
std::process::Command::new("cargo")
|
||||
|
@ -39,19 +41,16 @@ fn parser_no_panic() -> anyhow::Result<()> {
|
|||
))
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn linter_af_no_panic() -> anyhow::Result<()> {
|
||||
#[test_case("a-e")]
|
||||
#[test_case("f")]
|
||||
#[test_case("g-o")]
|
||||
#[test_case("p")]
|
||||
#[test_case("q-z")]
|
||||
#[test_case("!a-z")]
|
||||
fn linter_no_panic(range: &str) -> anyhow::Result<()> {
|
||||
let workspace_root = get_cargo_workspace_root()?;
|
||||
run_corpus_tests(&format!(
|
||||
"{workspace_root}/crates/ruff_linter/resources/test/fixtures/[a-f]*/**/*.py"
|
||||
))
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn linter_gz_no_panic() -> anyhow::Result<()> {
|
||||
let workspace_root = get_cargo_workspace_root()?;
|
||||
run_corpus_tests(&format!(
|
||||
"{workspace_root}/crates/ruff_linter/resources/test/fixtures/[g-z]*/**/*.py"
|
||||
"{workspace_root}/crates/ruff_linter/resources/test/fixtures/[{range}]*/**/*.py"
|
||||
))
|
||||
}
|
||||
|
||||
|
@ -63,11 +62,15 @@ fn linter_stubs_no_panic() -> anyhow::Result<()> {
|
|||
))
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn typeshed_no_panic() -> anyhow::Result<()> {
|
||||
#[test_case("a-e")]
|
||||
#[test_case("f-k")]
|
||||
#[test_case("l-p")]
|
||||
#[test_case("q-z")]
|
||||
#[test_case("!a-z")]
|
||||
fn typeshed_no_panic(range: &str) -> anyhow::Result<()> {
|
||||
let workspace_root = get_cargo_workspace_root()?;
|
||||
run_corpus_tests(&format!(
|
||||
"{workspace_root}/crates/ty_vendored/vendor/typeshed/**/*.pyi"
|
||||
"{workspace_root}/crates/ty_vendored/vendor/typeshed/stdlib/[{range}]*.pyi"
|
||||
))
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue