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

[Bug]: Some tests are not executed because the findBundle option is not overriden #9056

Open
haocheng6 opened this issue Jan 20, 2025 · 0 comments · May be fixed by #9057
Open

[Bug]: Some tests are not executed because the findBundle option is not overriden #9056

haocheng6 opened this issue Jan 20, 2025 · 0 comments · May be fixed by #9057
Assignees
Labels
bug Something isn't working

Comments

@haocheng6
Copy link
Contributor

haocheng6 commented Jan 20, 2025

System Info

  System:
    OS: Linux 5.15 Ubuntu 24.04.1 LTS 24.04.1 LTS (Noble Numbat)
    CPU: (16) x64 AMD Ryzen 7 8845H w/ Radeon 780M Graphics
    Memory: 9.16 GB / 13.53 GB
    Container: Yes
    Shell: 5.2.21 - /bin/bash
  Binaries:
    Node: 20.18.1 - ~/.nvm/versions/node/v20.18.1/bin/node
    npm: 10.8.2 - ~/.nvm/versions/node/v20.18.1/bin/npm
    pnpm: 9.15.3 - ~/.nvm/versions/node/v20.18.1/bin/pnpm
  npmPackages:
    @rspack/cli: workspace:* => 1.2.0-beta.0

Details

It seems that some test cases in packages/rspack-test-tools/tests/configCases/**/index.js are not executed because the findBundle option is not overriden in the test.config.js file.

A few of them can be easily fixed (#9057). Some may need further investigation because they will fail if the findBundle option is added.

Examples of tests that are not executed and cannot be trivially fixed by simply adding a test.config.js file:

  1. configCases/css/rspack-issue-4844
  2. configCases/output-module/rspack-issue-6572
  3. configCases/plugins/eval-source-map-dev-tool-plugin
  4. configCases/split-chunks/used-exports
  5. configCases/container-1-5/chunk-matcher (This one seems flaky. It passes or fails randomly.)

Reproduce link

No response

Reproduce Steps

  1. Add expect(1).toBe(2); to the test case in packages/rspack-test-tools/tests/configCases/plugins/source-map-dev-tool-plugin-file-context/index.js.
  2. cd packages/rspack-test-tools/
  3. Run pnpm run test:base -t config/plugins/source-map-dev-tool-plugin-file-context -u and notice that two tests pass.
  4. Create a new file packages/rspack-test-tools/tests/configCases/plugins/source-map-dev-tool-plugin-file-context/test.config.js with the following content:
/** @type {import("../../../..").TConfigCaseConfig} */
module.exports = {
    findBundle: (i, options) => {
        return ["main.js"];
    }
};
  1. Run pnpm run test:base -t config/plugins/source-map-dev-tool-plugin-file-context -u again and notice that this time two tests pass but one fails due to the added line expect(1).toBe(2);.
@haocheng6 haocheng6 added bug Something isn't working pending triage The issue/PR is currently untouched. labels Jan 20, 2025
@chenjiahan chenjiahan removed the pending triage The issue/PR is currently untouched. label Jan 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants