Skip to content

Commit 27ca3ac

Browse files
authored
move tests into common folder (#68569)
### What? move tests into common folder allow to change backend on turbo tasks tests ### Why? Preparation for a new backend for persistent caching
1 parent 93ad2f2 commit 27ca3ac

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

35 files changed

+1637
-1602
lines changed

Cargo.lock

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

turbopack/crates/turbo-tasks-build/src/lib.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ pub fn generate_register() {
5555
if examples_dir.exists() {
5656
for item in read_dir(examples_dir).unwrap() {
5757
let item = item.unwrap();
58-
if item.file_type().unwrap().is_file() {
58+
let file_type = &item.file_type().unwrap();
59+
if file_type.is_file() || file_type.is_symlink() {
5960
let name = item.file_name();
6061
let name = name.to_string_lossy();
6162
if name.ends_with(".rs") {
@@ -68,7 +69,8 @@ pub fn generate_register() {
6869
if tests_dir.exists() {
6970
for item in read_dir(tests_dir).unwrap() {
7071
let item = item.unwrap();
71-
if item.file_type().unwrap().is_file() {
72+
let file_type = &item.file_type().unwrap();
73+
if file_type.is_file() || file_type.is_symlink() {
7274
let name = item.file_name();
7375
let name = name.to_string_lossy();
7476
if name.ends_with(".rs") {
@@ -80,7 +82,7 @@ pub fn generate_register() {
8082

8183
if benches_dir.exists() {
8284
let bench_mod = benches_dir.join("mod.rs");
83-
if bench_mod.is_file() {
85+
if bench_mod.is_file() || bench_mod.is_symlink() {
8486
let name = bench_mod.file_name().unwrap();
8587
let name = name.to_string_lossy();
8688
if name.ends_with(".rs") {

turbopack/crates/turbo-tasks-fetch/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ turbopack-core = { workspace = true }
3131
httpmock = { workspace = true }
3232
tokio = { workspace = true, features = ["full"] }
3333
turbo-tasks-testing = { workspace = true }
34+
turbo-tasks-memory = { workspace = true }
3435

3536
[build-dependencies]
3637
turbo-tasks-build = { workspace = true }
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
turbo_tasks::TurboTasks::new(turbo_tasks_memory::MemoryBackend::new(usize::MAX))

turbopack/crates/turbo-tasks-macros-tests/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ tokio = { workspace = true }
1212
trybuild = { version = "1.0.97" }
1313
turbo-tasks = { workspace = true }
1414
turbo-tasks-testing = { workspace = true }
15+
turbo-tasks-memory = { workspace = true }
1516

1617
[build-dependencies]
1718
turbo-tasks-build = { workspace = true }
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
turbo_tasks::TurboTasks::new(turbo_tasks_memory::MemoryBackend::new(usize::MAX))

turbopack/crates/turbo-tasks-memory/tests/all_in_one.rs

Lines changed: 0 additions & 201 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../turbo-tasks-testing/tests/all_in_one.rs

0 commit comments

Comments
 (0)