Skip to content

Commit

Permalink
use new backend for turbopack-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Jan 22, 2025
1 parent ffb933b commit 0c7cbc2
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion turbopack/crates/turbopack-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ turbo-tasks = { workspace = true }
turbo-tasks-bytes = { workspace = true }
turbo-tasks-env = { workspace = true }
turbo-tasks-fs = { workspace = true }
turbo-tasks-memory = { workspace = true }
turbo-tasks-backend = { workspace = true }
turbopack-browser = { workspace = true, features = ["test"] }
turbopack-cli-utils = { workspace = true }
turbopack-core = { workspace = true, features = ["issue_path"] }
Expand Down
10 changes: 8 additions & 2 deletions turbopack/crates/turbopack-tests/tests/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ use turbo_tasks::{
apply_effects, debug::ValueDebugFormat, fxindexmap, trace::TraceRawVcs, Completion,
NonLocalValue, OperationVc, ResolvedVc, TryJoinIterExt, TurboTasks, Value, Vc,
};
use turbo_tasks_backend::{noop_backing_storage, BackendOptions, TurboTasksBackend};
use turbo_tasks_bytes::stream::SingleValue;
use turbo_tasks_env::CommandLineProcessEnv;
use turbo_tasks_fs::{
json::parse_json_with_source_context, util::sys_to_unix, DiskFileSystem, FileContent,
FileSystem, FileSystemEntryType, FileSystemPath,
};
use turbo_tasks_memory::MemoryBackend;
use turbopack::{
ecmascript::TreeShakingMode,
module_options::{EcmascriptOptionsContext, ModuleOptionsContext, TypescriptTransformOptions},
Expand Down Expand Up @@ -168,7 +168,13 @@ async fn run(resource: PathBuf, snapshot_mode: IssueSnapshotMode) -> Result<JsRe
std::fs::remove_dir_all(&output_path)?;
}

let tt = TurboTasks::new(MemoryBackend::default());
let tt = TurboTasks::new(TurboTasksBackend::new(
BackendOptions {
storage_mode: None,
..Default::default()
},
noop_backing_storage(),
));
tt.run_once(async move {
let emit_op =
run_inner_operation(resource.to_str().unwrap().into(), Value::new(snapshot_mode));
Expand Down
10 changes: 8 additions & 2 deletions turbopack/crates/turbopack-tests/tests/snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ use turbo_tasks::{
apply_effects, ReadConsistency, ReadRef, ResolvedVc, TryJoinIterExt, TurboTasks, Value,
ValueToString, Vc,
};
use turbo_tasks_backend::{noop_backing_storage, BackendOptions, TurboTasksBackend};
use turbo_tasks_env::DotenvProcessEnv;
use turbo_tasks_fs::{
json::parse_json_with_source_context, util::sys_to_unix, DiskFileSystem, FileSystem,
FileSystemPath,
};
use turbo_tasks_memory::MemoryBackend;
use turbopack::{
ecmascript::{EcmascriptInputTransform, TreeShakingMode},
module_options::{
Expand Down Expand Up @@ -156,7 +156,13 @@ fn test(resource: PathBuf) {
async fn run(resource: PathBuf) -> Result<()> {
register();

let tt = TurboTasks::new(MemoryBackend::default());
let tt = TurboTasks::new(TurboTasksBackend::new(
BackendOptions {
storage_mode: None,
..Default::default()
},
noop_backing_storage(),
));
let task = tt.spawn_once_task(async move {
let emit_op = run_inner_operation(resource.to_str().unwrap().into());
emit_op.read_strongly_consistent().await?;
Expand Down

0 comments on commit 0c7cbc2

Please sign in to comment.