Skip to content

Commit

Permalink
test: keep test case stable with different version length (#8287)
Browse files Browse the repository at this point in the history
  • Loading branch information
LingyuCoder authored Oct 31, 2024
1 parent a20a672 commit 2182dc1
Showing 1 changed file with 3 additions and 90 deletions.
93 changes: 3 additions & 90 deletions packages/rspack-test-tools/tests/statsAPICases/bundler-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,95 +20,8 @@ module.exports = {
};
expect(typeof stats?.hash).toBe("string");
const statsJson = stats?.toJson(statsOptions);
expect(
statsJson.modules.filter(m => m.identifier.startsWith("webpack/runtime/"))
).toMatchInlineSnapshot(`
Array [
Object {
assets: Array [],
buildTimeExecuted: false,
built: false,
cacheable: true,
cached: false,
chunks: Array [
909,
],
codeGenerated: true,
dependent: false,
depth: undefined,
errors: 0,
failed: false,
filteredReasons: undefined,
id: ,
identifier: webpack/runtime/rspack_unique_id,
index: undefined,
index2: undefined,
issuer: undefined,
issuerId: undefined,
issuerName: undefined,
issuerPath: undefined,
layer: undefined,
moduleType: runtime,
name: webpack/runtime/rspack_unique_id,
nameForCondition: undefined,
optimizationBailout: Array [],
optional: false,
orphan: false,
postOrderIndex: undefined,
preOrderIndex: undefined,
providedExports: Array [],
reasons: Array [],
size: 52,
sizes: Object {
runtime: 52,
},
type: module,
usedExports: null,
warnings: 0,
},
Object {
assets: Array [],
buildTimeExecuted: false,
built: false,
cacheable: true,
cached: false,
chunks: Array [
909,
],
codeGenerated: true,
dependent: false,
depth: undefined,
errors: 0,
failed: false,
filteredReasons: undefined,
id: ,
identifier: webpack/runtime/rspack_version,
index: undefined,
index2: undefined,
issuer: undefined,
issuerId: undefined,
issuerName: undefined,
issuerPath: undefined,
layer: undefined,
moduleType: runtime,
name: webpack/runtime/rspack_version,
nameForCondition: undefined,
optimizationBailout: Array [],
optional: false,
orphan: false,
postOrderIndex: undefined,
preOrderIndex: undefined,
providedExports: Array [],
reasons: Array [],
size: 60,
sizes: Object {
runtime: 60,
},
type: module,
usedExports: null,
warnings: 0,
},
]
`);
const runtimeModules = statsJson.modules.filter(m => m.identifier.startsWith("webpack/runtime/")).map(i => i.identifier).filter(Boolean);
expect(runtimeModules).toContain("webpack/runtime/rspack_unique_id");
expect(runtimeModules).toContain("webpack/runtime/rspack_version");
}
};

2 comments on commit 2182dc1

@rspack-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 Ran ecosystem CI: Open

suite result
modernjs ✅ success
_selftest ✅ success
rspress ✅ success
rslib ✅ success
rsbuild ✅ success
examples ✅ success
devserver ✅ success

@rspack-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 Benchmark detail: Open

Name Base (2024-10-31 02f0c85) Current Change
10000_big_production-mode + exec 49.3 s ± 1.56 s 48.4 s ± 1.46 s -1.89 %
10000_development-mode + exec 2.12 s ± 33 ms 2.09 s ± 20 ms -1.45 %
10000_development-mode_hmr + exec 638 ms ± 4.3 ms 644 ms ± 5.6 ms +0.86 %
10000_production-mode + exec 2.69 s ± 41 ms 2.63 s ± 35 ms -2.34 %
arco-pro_development-mode + exec 1.79 s ± 73 ms 1.78 s ± 63 ms -0.31 %
arco-pro_development-mode_hmr + exec 428 ms ± 1.1 ms 428 ms ± 1.6 ms -0.03 %
arco-pro_production-mode + exec 3.21 s ± 130 ms 3.21 s ± 81 ms -0.21 %
arco-pro_production-mode_generate-package-json-webpack-plugin + exec 3.25 s ± 68 ms 3.24 s ± 119 ms -0.35 %
threejs_development-mode_10x + exec 1.62 s ± 20 ms 1.62 s ± 26 ms -0.26 %
threejs_development-mode_10x_hmr + exec 770 ms ± 13 ms 778 ms ± 15 ms +1.06 %
threejs_production-mode_10x + exec 5.01 s ± 27 ms 4.99 s ± 21 ms -0.41 %

Please sign in to comment.