Unverified Commit ff6431f0 authored by vercel-fleet-prod[bot]'s avatar vercel-fleet-prod[bot] Committed by GitHub

test(turbopack): keep webpack parity check manual

Co-authored-by: 's avatarJimmy Miller <6071338+jimmyhmiller@users.noreply.github.com>
parent 7c8bec41
// Manual/local differential check only — do not invoke from Cargo tests or CI.
//
// First generate the focused Turbopack output:
// UPDATE=1 cargo nextest run -p turbopack-tests -E 'test(webpack_parity)'
// Then, from the repository root, compare it with root-pinned webpack:
// node turbopack/crates/turbopack-tests/js/cjs-webpack-parity.mjs \
// turbopack/crates/turbopack-tests/tests/snapshot/cjs-remove-unused-exports/webpack-parity .
import assert from 'node:assert/strict' import assert from 'node:assert/strict'
import fs from 'node:fs' import fs from 'node:fs'
import os from 'node:os' import os from 'node:os'
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
mod util; mod util;
use std::{collections::VecDeque, fs, fs::canonicalize, io, path::PathBuf, process::Command}; use std::{collections::VecDeque, fs, fs::canonicalize, io, path::PathBuf};
use anyhow::{Context, Result}; use anyhow::{Context, Result};
use rustc_hash::FxHashSet; use rustc_hash::FxHashSet;
...@@ -232,20 +232,7 @@ fn test(resource: PathBuf) { ...@@ -232,20 +232,7 @@ fn test(resource: PathBuf) {
// Separating this into a different function fixes my IDE's types for some // Separating this into a different function fixes my IDE's types for some
// reason... // reason...
run(resource.clone()).unwrap(); run(resource).unwrap();
if resource.join("differential.json").is_file() {
let script = PathBuf::from(REPO_ROOT.as_str())
.join("turbopack/crates/turbopack-tests/js/cjs-webpack-parity.mjs");
let status = Command::new("node")
.arg(script)
.arg(&resource)
.arg(REPO_ROOT.as_str())
.status()
.context("failed to run CommonJS webpack parity helper")
.unwrap();
assert!(status.success(), "CommonJS webpack parity helper failed");
}
} }
#[tokio::main(flavor = "multi_thread", worker_threads = 2)] #[tokio::main(flavor = "multi_thread", worker_threads = 2)]
......
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