Skip to content

Commit

Permalink
Update snapshot unit test, the stack is changed because we resolve th…
Browse files Browse the repository at this point in the history
…e Vc earlier
  • Loading branch information
bgw committed Jan 21, 2025
1 parent 0b5a836 commit a1d3b24
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
8 changes: 4 additions & 4 deletions turbopack/crates/turbopack-tests/tests/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ async fn run(resource: PathBuf, snapshot_mode: IssueSnapshotMode) -> Result<JsRe
tt.run_once(async move {
let emit_op =
run_inner_operation(resource.to_str().unwrap().into(), Value::new(snapshot_mode));
let result = emit_op.connect().strongly_consistent().await?;
let result = emit_op.read_strongly_consistent().await?;
apply_effects(emit_op).await?;

Ok(result.clone_value())
Expand Down Expand Up @@ -452,12 +452,12 @@ async fn run_test_operation(prepared_test: ResolvedVc<PreparedTest>) -> Result<V
#[turbo_tasks::function]
async fn snapshot_issues(
prepared_test: Vc<PreparedTest>,
run_result: OperationVc<RunTestResult>,
run_result_op: OperationVc<RunTestResult>,
) -> Result<Vc<()>> {
let PreparedTest { path, .. } = *prepared_test.await?;
let _ = run_result.connect().resolve_strongly_consistent().await;
let _ = run_result_op.resolve_strongly_consistent().await;

let captured_issues = run_result.peek_issues_with_path().await?;
let captured_issues = run_result_op.peek_issues_with_path().await?;

let plain_issues = captured_issues
.iter_with_shortest_path()
Expand Down
5 changes: 2 additions & 3 deletions turbopack/crates/turbopack-tests/tests/snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ async fn run(resource: PathBuf) -> Result<()> {
let tt = TurboTasks::new(MemoryBackend::default());
let task = tt.spawn_once_task(async move {
let emit_op = run_inner_operation(resource.to_str().unwrap().into());
emit_op.connect().strongly_consistent().await?;
emit_op.read_strongly_consistent().await?;
apply_effects(emit_op).await?;

Ok(Vc::<()>::default())
Expand All @@ -173,8 +173,7 @@ async fn run(resource: PathBuf) -> Result<()> {
#[turbo_tasks::function(operation)]
async fn run_inner_operation(resource: RcStr) -> Result<()> {
let out_op = run_test_operation(resource);
let out_vc = out_op.connect();
let _ = out_vc.resolve_strongly_consistent().await?;
let out_vc = out_op.resolve_strongly_consistent().await?;
let captured_issues = out_op.peek_issues_with_path().await?;

let plain_issues = captured_issues
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ error - [code gen] [project]/turbopack/crates/turbopack-tests/tests/snapshot/imp

Debug info:
- An error occurred while generating the chunk item [project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/json/input/invalid.json (json)
- Execution of *EcmascriptChunkItemContent::module_factory failed
- Execution of <JsonChunkItem as EcmascriptChunkItem>::content failed
- Unable to make a module from invalid JSON: expected `,` or `}` at line 3 column 26
at nested.?
Expand Down

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

0 comments on commit a1d3b24

Please sign in to comment.