Skip to content

Commit

Permalink
test: delete test.filter.js if test is pass in tests/webpack-test (#8409
Browse files Browse the repository at this point in the history
)

* test: delete test.filter.js if test is pass in tests/webpack-test

* test: add test.filter.js for watchCases/parsing/switching-harmony
  • Loading branch information
GiveMe-A-Name authored and JSerFeng committed Nov 12, 2024
1 parent 8f75992 commit 52a1a7e
Show file tree
Hide file tree
Showing 271 changed files with 418 additions and 342 deletions.
30 changes: 29 additions & 1 deletion crates/rspack_core/src/old_cache/local/code_splitting_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use tracing::instrument;

use crate::{
build_chunk_graph::code_splitter::CodeSplitter, incremental::IncrementalPasses, Chunk,
ChunkGraph, ChunkGroup, ChunkGroupUkey, ChunkUkey, Compilation,
ChunkGraph, ChunkGroup, ChunkGroupUkey, ChunkUkey, Compilation, ModuleIdentifier,
};

#[derive(Debug, Default)]
Expand All @@ -20,6 +20,7 @@ pub struct CodeSplittingCache {
named_chunk_groups: HashMap<String, ChunkGroupUkey>,
named_chunks: HashMap<String, ChunkUkey>,
pub(crate) code_splitter: CodeSplitter,
pub(crate) module_idx: HashMap<ModuleIdentifier, (u32, u32)>,
}

#[instrument(skip_all)]
Expand Down Expand Up @@ -56,6 +57,17 @@ where
s.spawn(|_| compilation.named_chunks = cache.named_chunks.clone());
});

let module_idx = cache.module_idx.clone();
let mut module_graph = compilation.get_module_graph_mut();
for (m, (pre, post)) in module_idx {
let Some(mgm) = module_graph.module_graph_module_by_identifier_mut(&m) else {
continue;
};

mgm.pre_order_index = Some(pre);
mgm.post_order_index = Some(post);
}

if !has_change {
return Ok(());
}
Expand All @@ -72,5 +84,21 @@ where
s.spawn(|_| cache.named_chunk_groups = compilation.named_chunk_groups.clone());
s.spawn(|_| cache.named_chunks = compilation.named_chunks.clone());
});

let mg = compilation.get_module_graph();
let mut map = HashMap::default();
for m in mg.modules().keys() {
let Some(mgm) = mg.module_graph_module_by_identifier(m) else {
continue;
};

let (Some(pre), Some(post)) = (mgm.pre_order_index, mgm.post_order_index) else {
continue;
};

map.insert(*m, (pre, post));
}
let cache = &mut compilation.code_splitting_cache;
cache.module_idx = map;
Ok(())
}
4 changes: 1 addition & 3 deletions crates/rspack_ids/src/deterministic_module_ids_plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ fn module_ids(&self, compilation: &mut Compilation) -> Result<()> {
|m| get_full_module_name(m, context),
|a, b| compare_modules_by_pre_order_index_or_identifier(&module_graph, a, b),
|module, id| {
let size = used_ids.len();
used_ids.insert(id.to_string());
if used_ids.len() == size {
if !used_ids.insert(id.to_string()) {
conflicts += 1;
return false;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import v from './lib'

it('should compile', async () => {
expect(v).toBe(1)
})
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default 1;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// change
export default 1;
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/** @type {import("@rspack/core").Configuration} */
module.exports = {
optimization: {
splitChunks: false,
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
checkStats(_stepName, stats) {
// should keep module preOrderIndex and postOrderIndex during build
return [...stats.modules].filter(m => {
return m.moduleType !== 'runtime'
}).every((m) => {
return m.preOrderIndex !== undefined && m.postOrderIndex !== undefined
})
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
// return !process.env.CI;
// };

// TODO: Should create a issue for this test
module.exports = () => false // passed it, but it's too slow
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@

const supportsOptionalCatchBinding = require("../../../helpers/supportsOptionalCatchBinding");

module.exports = function(config) {
module.exports = function (config) {
// XXX: Disable this test if Terser is used because it does not support ES 2019
if (config.mode === "production") {
return false;
}
return supportsOptionalCatchBinding();
};

1 change: 1 addition & 0 deletions tests/webpack-test/cases/wasm/v128/test.filter.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const supportsWebAssembly = require("../../../helpers/supportsWebAssembly");
const supportsFeature = require("webassembly-feature");

// TODO: Should create a issue for this test
module.exports = function (config) {
// CompileError: WebAssembly.instantiate(): Compiling function #0 failed: memory instruction with no memory @+27
return false
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
module.exports = () => {return false}
// TODO: Should create a issue for this test
module.exports = () => { return false }
1 change: 0 additions & 1 deletion tests/webpack-test/configCases/amd/disabled/test.filter.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
module.exports = () => {return false}
// TODO: Should create a issue for this test
module.exports = () => { return false }

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
module.exports = () => {return false}
// TODO: Should create a issue for this test
module.exports = () => { return false }

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
module.exports = () => {return false}
// TODO: Should create a issue for this test
module.exports = () => { return false }
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
module.exports = () => {return false}
// TODO: Should create a issue for this test
module.exports = () => { return false }
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
module.exports = () => {return false}
// TODO: Should create a issue for this test
module.exports = () => { return false }
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
module.exports = () => {return false}
// TODO: Should create a issue for this test
module.exports = () => { return false }
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
module.exports = () => {return false}
// TODO: Should create a issue for this test
module.exports = () => { return false }

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
module.exports = () => {return false}
// TODO: Should create a issue for this test
module.exports = () => { return false }
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
module.exports = () => {return false}
// TODO: Should create a issue for this test
module.exports = () => { return false }
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
module.exports = () => {return false}
// TODO: Should create a issue for this test
module.exports = () => { return false }
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
module.exports = () => {return false}
// TODO: Should create a issue for this test
module.exports = () => { return false }

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
module.exports = () => {return false}
// TODO: Should create a issue for this test
module.exports = () => { return false }
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
module.exports = () => {return false}
// TODO: Should create a issue for this test
module.exports = () => { return false }
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
module.exports = () => {return false}
// TODO: Should create a issue for this test
module.exports = () => { return false }

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// enable when support compilation.moduleGraph(unimplemented).getPreOrderIndex(unimplemented)
// TODO: Should create a issue for this test
module.exports = () => {
return false;
};
3 changes: 2 additions & 1 deletion tests/webpack-test/configCases/clean/dry/test.filter.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
module.exports = () => {return false}
// TODO: Should create a issue for this test
module.exports = () => { return false }
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
module.exports = () => {return false}
// TODO: Should create a issue for this test
module.exports = () => { return false }
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
module.exports = () => {return false}
// TODO: Should create a issue for this test
module.exports = () => { return false }
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
module.exports = () => {return false}
// TODO: Should create a issue for this test
module.exports = () => { return false }
3 changes: 2 additions & 1 deletion tests/webpack-test/configCases/clean/link/test.filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@
// }
// };

module.exports = () => {return false}
// TODO: Should create a issue for this test
module.exports = () => { return false }
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
module.exports = () => {return false}
// TODO: Should create a issue for this test
module.exports = () => { return false }
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
module.exports = () => {return false}
// TODO: Should create a issue for this test
module.exports = () => { return false }

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// TODO: Should create a issue for this test
// TODO: This test would painic, we should not painic when build
module.exports = () => {
return false;
};

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
module.exports = () => {return false}
// TODO: Should create a issue for this test
module.exports = () => { return false }
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
// blocked by https://github.com/web-infra-dev/rspack/issues/3465
module.exports = () => {return false}
// TODO: Should create a issue for this test
module.exports = () => { return false }
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
// blocked by chunkIds
module.exports = () => {return false}
// TODO: Should create a issue for this test
module.exports = () => { return false }
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
module.exports = () => {return false}
// TODO: Should create a issue for this test
module.exports = () => { return false }
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
module.exports = () => { return false }
// TODO: Should create a issue for this test
module.exports = () => { return false }

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
module.exports = () => {return false}
// TODO: Should create a issue for this test
module.exports = () => { return false }
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
module.exports = () => {return false}
// TODO: Should create a issue for this test
module.exports = () => { return false }
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
module.exports = () => {return false}
// TODO: Should create a issue for this test
module.exports = () => { return false }
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
// do not support webpack.ids.DeterministicModuleIdsPlugin
// TODO: Should create a issue for this test
module.exports = () => false;
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
// do not support webpack.ids.DeterministicModuleIdsPlugin
// TODO: Should create a issue for this test
module.exports = () => false;

This file was deleted.

1 change: 1 addition & 0 deletions tests/webpack-test/configCases/css/urls/test.filter.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
// TODO: Should create a issue for this test
module.exports = () => false;
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
module.exports = () => {return false}
// TODO: Should create a issue for this test
module.exports = () => { return false }
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
module.exports = () => {return false}
// TODO: Should create a issue for this test
module.exports = () => { return false }
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
module.exports = () => {return false}
// TODO: Should create a issue for this test
module.exports = () => { return false }
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
module.exports = () => {return false}
// TODO: Should create a issue for this test
module.exports = () => { return false }
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
module.exports = () => {return false}
// TODO: Should create a issue for this test
module.exports = () => { return false }
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
module.exports = () => {return false}
// TODO: Should create a issue for this test
module.exports = () => { return false }
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
module.exports = () => {return false}
// TODO: Should create a issue for this test
module.exports = () => { return false }
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
module.exports = () => {return false}
// TODO: Should create a issue for this test
module.exports = () => { return false }
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
module.exports = () => {return false}
// TODO: Should create a issue for this test
module.exports = () => { return false }
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
module.exports = () => {return false}
// TODO: Should create a issue for this test
module.exports = () => { return false }
Loading

0 comments on commit 52a1a7e

Please sign in to comment.