Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: enable stats test #7115

Merged
merged 4 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions tests/webpack-test/StatsTestCases.basictest.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const fs = require("graceful-fs");
const rimraf = require("rimraf");
const captureStdio = require("./helpers/captureStdio");
const webpack = require("@rspack/core");
const { normalizeFilteredTestName } = require('./lib/util/filterUtil')
const { normalizeFilteredTestName, FilteredStatus } = require('./lib/util/filterUtil')

/**
* Escapes regular expression metacharacters
Expand All @@ -32,7 +32,8 @@ const tests = fs
if (fs.existsSync(filterPath)) {
// CHANGE: added custom filter for tracking alignment status
let flag = require(filterPath)()
if (flag !== true) {
let shouldRun = flag === true || (Array.isArray(flag) && flag.includes(FilteredStatus.PARTIAL_PASS))
if (!shouldRun) {
let filteredName = normalizeFilteredTestName(flag, testName);
describe.skip(testName, () => it(filteredName, () => { }));
return false;
Expand Down
1,829 changes: 1,829 additions & 0 deletions tests/webpack-test/__snapshots__/StatsTestCases.basictest.js.snap

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
const { FilteredStatus } = require("../../../lib/util/filterUtil")

module.exports = () => {
return [
FilteredStatus.PARTIAL_PASS,
"https://github.com/web-infra-dev/rspack/issues/4923"
]
}
return "https://github.com/web-infra-dev/rspack/issues/4923";
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
const { FilteredStatus } = require("../../../lib/util/filterUtil")

module.exports = () => {return [FilteredStatus.PARTIAL_PASS, "https://github.com/web-infra-dev/rspack/issues/4304"]}

const { FilteredStatus } = require("../../../lib/util/filterUtil");

module.exports = () => "https://github.com/web-infra-dev/rspack/issues/4304";
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
const { FilteredStatus } = require("../../../lib/util/filterUtil")

module.exports = () => [FilteredStatus.PARTIAL_PASS, 'not have the same name for splitted chunk with webpack https://github.com/web-infra-dev/rspack/issues/4334']
module.exports = () =>
"not have the same name for splitted chunk with webpack https://github.com/web-infra-dev/rspack/issues/4334";
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

module.exports = () => {return false}
module.exports = () => {
return "support webpack.optimize.AggressiveSplittingPlugin";
};
6 changes: 3 additions & 3 deletions tests/webpack-test/statsCases/all-stats/test.filter.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

module.exports = () => {return false}
module.exports = () => {
return "support webpack.optimize.AggressiveSplittingPlugin";
};
6 changes: 4 additions & 2 deletions tests/webpack-test/statsCases/asset-concat/test.filter.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const { FilteredStatus } = require("../../lib/util/filterUtil");

module.exports = () => {return false}

module.exports = () => {
return [FilteredStatus.PARTIAL_PASS, "check the consistency with webpack "];
};
6 changes: 4 additions & 2 deletions tests/webpack-test/statsCases/asset/test.filter.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const { FilteredStatus } = require("../../lib/util/filterUtil");

module.exports = () => {return false}

module.exports = () => {
return [FilteredStatus.PARTIAL_PASS, "check the consistency with webpack "];
};

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

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

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

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

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

Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const { FilteredStatus } = require("../../lib/util/filterUtil");

module.exports = () => {return false}

module.exports = () => {
return [FilteredStatus.PARTIAL_PASS, "check the consistency with webpack "];
};
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

module.exports = () => {return false}
module.exports = () => {
return "support require.ensure()";
};
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const { FilteredStatus } = require("../../lib/util/filterUtil");

module.exports = () => {return false}

module.exports = () => {
return [FilteredStatus.PARTIAL_PASS, "check the consistency with webpack "];
};
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

module.exports = () => {return false}
module.exports = () => {
return "support ChunkModuleIdRangePlugin";
};
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

module.exports = () => {return false}
module.exports = () => {
return "support AMD require";
};
6 changes: 3 additions & 3 deletions tests/webpack-test/statsCases/chunks/test.filter.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

module.exports = () => {return false}
module.exports = () => {
return "support AMD require";
};
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const { FilteredStatus } = require("../../lib/util/filterUtil");

module.exports = () => {return false}

module.exports = () => {
return [FilteredStatus.PARTIAL_PASS, "check the consistency with webpack "];
};
6 changes: 4 additions & 2 deletions tests/webpack-test/statsCases/color-disabled/test.filter.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const { FilteredStatus } = require("../../lib/util/filterUtil");

module.exports = () => {return false}

module.exports = () => {
return [FilteredStatus.PARTIAL_PASS, "check the consistency with webpack "];
};
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

module.exports = () => {return false}
module.exports = () => {
return "support color object";
};
6 changes: 4 additions & 2 deletions tests/webpack-test/statsCases/color-enabled/test.filter.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const { FilteredStatus } = require("../../lib/util/filterUtil");

module.exports = () => {return false}

module.exports = () => {
return [FilteredStatus.PARTIAL_PASS, "check the consistency with webpack "];
};
6 changes: 4 additions & 2 deletions tests/webpack-test/statsCases/common-libs/test.filter.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const { FilteredStatus } = require("../../lib/util/filterUtil");

module.exports = () => {return false}

module.exports = () => {
return [FilteredStatus.PARTIAL_PASS, "check the consistency with webpack "];
};
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

module.exports = () => {return false}
module.exports = () => {
return "Method RegExp.prototype.test called on incompatible receiver undefined";
};
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const { FilteredStatus } = require("../../lib/util/filterUtil");

module.exports = () => {return false}

module.exports = () => {
return [FilteredStatus.PARTIAL_PASS, "check the consistency with webpack "];
};
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const { FilteredStatus } = require("../../lib/util/filterUtil");

module.exports = () => {return false}

module.exports = () => {
return [FilteredStatus.PARTIAL_PASS, "check the consistency with webpack "];
};

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

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

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

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

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

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

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

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

Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const { FilteredStatus } = require("../../lib/util/filterUtil");

module.exports = () => {return false}

module.exports = () => {
return [FilteredStatus.PARTIAL_PASS, "check the consistency with webpack "];
};
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

module.exports = () => {return false}
module.exports = () => {
return "hash changed";
};
6 changes: 4 additions & 2 deletions tests/webpack-test/statsCases/custom-terser/test.filter.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const { FilteredStatus } = require("../../lib/util/filterUtil");

module.exports = () => {return false}

module.exports = () => {
return [FilteredStatus.PARTIAL_PASS, "check the consistency with webpack "];
};
6 changes: 3 additions & 3 deletions tests/webpack-test/statsCases/define-plugin/test.filter.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

module.exports = () => {return false}
module.exports = () => {
return "webpack.DefinePlugin.runtimeValue is not a function";
};
6 changes: 3 additions & 3 deletions tests/webpack-test/statsCases/details-error/test.filter.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

module.exports = () => {return false}
module.exports = () => {
return "custom error details";
};
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

module.exports = () => {return false}
module.exports = () => {
return "webpack.DllReferencePlugin is not a constructor";
};
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

module.exports = () => {return false}
module.exports = () => {
return "webpack.DllReferencePlugin is not a constructor";
};
6 changes: 3 additions & 3 deletions tests/webpack-test/statsCases/entry-filename/test.filter.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

module.exports = () => {return false}
module.exports = () => {
return "unstable";
};
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const { FilteredStatus } = require("../../lib/util/filterUtil");

module.exports = () => {return false}

module.exports = () => {
return [FilteredStatus.PARTIAL_PASS, "check the consistency with webpack "];
};
6 changes: 4 additions & 2 deletions tests/webpack-test/statsCases/external/test.filter.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const { FilteredStatus } = require("../../lib/util/filterUtil");

module.exports = () => {return false}

module.exports = () => {
return [FilteredStatus.PARTIAL_PASS, "check the consistency with webpack "];
};
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const { FilteredStatus } = require("../../lib/util/filterUtil");

module.exports = () => {return false}

module.exports = () => {
return [FilteredStatus.PARTIAL_PASS, "check the consistency with webpack "];
};
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const { FilteredStatus } = require("../../lib/util/filterUtil");

module.exports = () => {return false}

module.exports = () => {
return [FilteredStatus.PARTIAL_PASS, "check the consistency with webpack "];
};
6 changes: 4 additions & 2 deletions tests/webpack-test/statsCases/graph-roots/test.filter.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const { FilteredStatus } = require("../../lib/util/filterUtil");

module.exports = () => {return false}

module.exports = () => {
return [FilteredStatus.PARTIAL_PASS, "check the consistency with webpack "];
};
6 changes: 4 additions & 2 deletions tests/webpack-test/statsCases/ignore-warnings/test.filter.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const { FilteredStatus } = require("../../lib/util/filterUtil");

module.exports = () => {return false}

module.exports = () => {
return [FilteredStatus.PARTIAL_PASS, "check the consistency with webpack "];
};
6 changes: 4 additions & 2 deletions tests/webpack-test/statsCases/immutable/test.filter.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const { FilteredStatus } = require("../../lib/util/filterUtil");

module.exports = () => {return false}

module.exports = () => {
return [FilteredStatus.PARTIAL_PASS, "check the consistency with webpack "];
};
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const { FilteredStatus } = require("../../lib/util/filterUtil");

module.exports = () => {return false}

module.exports = () => {
return [FilteredStatus.PARTIAL_PASS, "check the consistency with webpack "];
};
6 changes: 4 additions & 2 deletions tests/webpack-test/statsCases/import-weak/test.filter.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const { FilteredStatus } = require("../../lib/util/filterUtil");

module.exports = () => {return false}

module.exports = () => {
return [FilteredStatus.PARTIAL_PASS, "check the consistency with webpack "];
};
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const { FilteredStatus } = require("../../lib/util/filterUtil");

module.exports = () => {return false}

module.exports = () => {
return [FilteredStatus.PARTIAL_PASS, "check the consistency with webpack "];
};

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

Loading
Loading