Unverified Commit 3c3c4dbe authored by Luke Sandberg's avatar Luke Sandberg Committed by GitHub

[turbopack] Change execution and snapshot tests to check for the existence of…

[turbopack] Change execution and snapshot tests to check for the existence of files rather than directories (#83189)

This fixes an annoying devex issue when switching branches
parent 6b83df95
...@@ -102,8 +102,12 @@ fn register() { ...@@ -102,8 +102,12 @@ fn register() {
// //
// "Skip" directories named `__skipped__`, which include test directories to // "Skip" directories named `__skipped__`, which include test directories to
// skip. // skip.
#[testing::fixture("tests/execution/*/*/*", exclude("node_modules|__skipped__"))] #[testing::fixture(
"tests/execution/*/*/*/input/index.js",
exclude("node_modules|__skipped__")
)]
fn test(resource: PathBuf) { fn test(resource: PathBuf) {
let resource = resource.parent().unwrap().parent().unwrap().to_path_buf();
let messages = get_messages(run(resource, IssueSnapshotMode::Snapshots).unwrap()); let messages = get_messages(run(resource, IssueSnapshotMode::Snapshots).unwrap());
if !messages.is_empty() { if !messages.is_empty() {
panic!( panic!(
...@@ -113,10 +117,10 @@ fn test(resource: PathBuf) { ...@@ -113,10 +117,10 @@ fn test(resource: PathBuf) {
} }
} }
#[testing::fixture("tests/execution/*/*/__skipped__/*/input")] #[testing::fixture("tests/execution/*/*/__skipped__/*/input/index.js")]
#[should_panic] #[should_panic]
fn test_skipped_fails(resource: PathBuf) { fn test_skipped_fails(resource: PathBuf) {
let resource = resource.parent().unwrap().to_path_buf(); let resource = resource.parent().unwrap().parent().unwrap().to_path_buf();
let JsResult { let JsResult {
// Ignore uncaught exceptions for skipped tests. // Ignore uncaught exceptions for skipped tests.
......
...@@ -168,8 +168,9 @@ fn is_empty_dir_tree(dir_entries: impl IntoIterator<Item = io::Result<fs::DirEnt ...@@ -168,8 +168,9 @@ fn is_empty_dir_tree(dir_entries: impl IntoIterator<Item = io::Result<fs::DirEnt
true true
} }
#[testing::fixture("tests/snapshot/*/*/", exclude("node_modules"))] #[testing::fixture("tests/snapshot/*/*/input/index.js", exclude("node_modules"))]
fn test(resource: PathBuf) { fn test(resource: PathBuf) {
let resource = resource.parent().unwrap().parent().unwrap().to_path_buf();
let resource = canonicalize(resource).unwrap(); let resource = canonicalize(resource).unwrap();
let mut has_output_dir = false; let mut has_output_dir = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment