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

Fix and re-enable tests for legacy Webpack-built JS #35956

Open
kdmccormick opened this issue Dec 3, 2024 · 0 comments
Open

Fix and re-enable tests for legacy Webpack-built JS #35956

kdmccormick opened this issue Dec 3, 2024 · 0 comments

Comments

@kdmccormick
Copy link
Member

kdmccormick commented Dec 3, 2024

Background

We have 8 legacy Javascript unit test suites in edx-platform: 7 run by Karma, and 1 run by Jest. Each of the 7 run by Karma uses a different config file. The best way to understand them is probably to look at this package.json snippet, which will merge in part of #35159.

{
  "...": "...",
  "scripts": {
    "...": "...",
    "test": "npm run test-cms && npm run test-lms && npm run test-xmodule && npm run test-common && npm run test-jest",
    "test-kind-vanilla": "npm run test-cms-vanilla && npm run test-xmodule-vanilla && npm run test-common-vanilla",
    "test-kind-require": "npm run test-cms-require && npm run test-common-require",
    "test-kind-webpack": "npm run test-cms-webpack && npm run test-lms-webpack && npm run test-xmodule-webpack",
    "test-cms": "npm run test-cms-vanilla && npm run test-cms-require && npm run test-cms-webpack",
    "test-cms-vanilla": "npm run test-suite -- cms/static/karma_cms.conf.js",
    "test-cms-require": "npm run test-suite -- cms/static/karma_cms_squire.conf.js",
    "test-cms-webpack": "npm run test-suite -- cms/static/karma_cms_webpack.conf.js",
    "test-lms": "npm run test-lms-webpack",
    "test-lms-webpack": "npm run test-suite -- lms/static/karma_lms.conf.js",
    "test-xmodule": "npm run test-xmodule-vanilla && npm run test-xmodule-webpack",
    "test-xmodule-vanilla": "npm run test-suite -- xmodule/js/karma_xmodule.conf.js",
    "test-xmodule-webpack": "npm run test-suite -- xmodule/js/karma_xmodule_webpack.conf.js",
    "test-common": "npm run test-common-vanilla && npm run test-common-require",
    "test-common-vanilla": "npm run test-suite -- common/static/karma_common.conf.js",
    "test-common-require": "npm run test-suite -- common/static/karma_common_requirejs.conf.js",
    "test-suite": "${NODE_WRAPPER:-xvfb-run --auto-servernum} node --max_old_space_size=4096 node_modules/.bin/karma start --single-run=true --capture-timeout=60000 --browsers=FirefoxNoUpdates",
    "test-jest": "jest"
  }
  "...": "..."
}

Essentially, there are three "kinds" of Karma test suites: three that test "vanilla" javascript, two that test RequireJS-based javascript, and three that test Webpack-based javascript. The Webpack-based ones have been quietly failing to build for an indeterminate amount of time, as explained here: #35955

We have since updated our Webpack config so that build failures under Karma would correctly signal the CI check to fail, but in order to do so, we've had to temporarily disable the three Webpack-based test suites.

Tasks

  • Re-enable the three Webpack-based test suites
  • Fix the Webpack build for these suites
  • Fix or delete any unit tests that have regressed since the last time they were run in CI
    • Fix or delete? --> This is all deprecated code, so we do not want to spend too much time investing in its testing. If it is not obvious how to fix the unit test, then consider removing it.
kdmccormick added a commit to kdmccormick/edx-platform that referenced this issue Dec 3, 2024
kdmccormick added a commit that referenced this issue Dec 4, 2024
irtazaakram pushed a commit that referenced this issue Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant