Skip to content

Commit

Permalink
Merge branch 'master' into MJG/return-empty-course-list
Browse files Browse the repository at this point in the history
  • Loading branch information
mariajgrimaldi authored Dec 5, 2024
2 parents 4c6c4ab + 202d31b commit ea5880d
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 17 deletions.
20 changes: 12 additions & 8 deletions pavelib/utils/envs.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,26 +88,30 @@ class Env:
KARMA_BROWSER = 'FirefoxNoUpdates'

# Files used to run each of the js test suites
# TODO: Store this as a dict. Order seems to matter for some
# reason. See issue TE-415.
# TODO: We have [temporarily disabled] the three Webpack-based tests suites. They have been silently
# broken for a long time; after noticing they were broken, we added the DieHardPlugin to
# webpack.common.config.js to prevent future silent breakage, but have not yet been able to
# fix and re-enable the suites. Note that the LMS suite is all Webpack-based even though it's
# not in the name.
# Issue: https://github.com/openedx/edx-platform/issues/35956
KARMA_CONFIG_FILES = [
REPO_ROOT / 'cms/static/karma_cms.conf.js',
REPO_ROOT / 'cms/static/karma_cms_squire.conf.js',
REPO_ROOT / 'cms/static/karma_cms_webpack.conf.js',
REPO_ROOT / 'lms/static/karma_lms.conf.js',
## [temporarily disabled] REPO_ROOT / 'cms/static/karma_cms_webpack.conf.js',
## [temporarily disabled] REPO_ROOT / 'lms/static/karma_lms.conf.js',
REPO_ROOT / 'xmodule/js/karma_xmodule.conf.js',
REPO_ROOT / 'xmodule/js/karma_xmodule_webpack.conf.js',
## [temporarily disabled] REPO_ROOT / 'xmodule/js/karma_xmodule_webpack.conf.js',
REPO_ROOT / 'common/static/karma_common.conf.js',
REPO_ROOT / 'common/static/karma_common_requirejs.conf.js',
]

JS_TEST_ID_KEYS = [
'cms',
'cms-squire',
'cms-webpack',
'lms',
## [temporarily-disabled] 'cms-webpack',
## [temporarily-disabled] 'lms',
'xmodule',
'xmodule-webpack',
## [temporarily-disabled] 'xmodule-webpack',
'common',
'common-requirejs',
'jest-snapshot'
Expand Down
2 changes: 1 addition & 1 deletion requirements/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ django-storages<1.14.4
# The team that owns this package will manually bump this package rather than having it pulled in automatically.
# This is to allow them to better control its deployment and to do it in a process that works better
# for them.
edx-enterprise==5.2.0
edx-enterprise==5.3.1

# Date: 2024-05-09
# This has to be constrained as well because newer versions of edx-i18n-tools need the
Expand Down
4 changes: 2 additions & 2 deletions requirements/edx/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ edx-drf-extensions==10.5.0
# edx-when
# edxval
# openedx-learning
edx-enterprise==5.2.0
edx-enterprise==5.3.1
# via
# -c requirements/edx/../constraints.txt
# -r requirements/edx/kernel.in
Expand Down Expand Up @@ -841,7 +841,7 @@ openedx-filters==1.11.0
# -r requirements/edx/kernel.in
# lti-consumer-xblock
# ora2
openedx-forum==0.1.2
openedx-forum==0.1.3
# via -r requirements/edx/kernel.in
openedx-learning==0.18.1
# via
Expand Down
4 changes: 2 additions & 2 deletions requirements/edx/development.txt
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ edx-drf-extensions==10.5.0
# edx-when
# edxval
# openedx-learning
edx-enterprise==5.2.0
edx-enterprise==5.3.1
# via
# -c requirements/edx/../constraints.txt
# -r requirements/edx/doc.txt
Expand Down Expand Up @@ -1396,7 +1396,7 @@ openedx-filters==1.11.0
# -r requirements/edx/testing.txt
# lti-consumer-xblock
# ora2
openedx-forum==0.1.2
openedx-forum==0.1.3
# via
# -r requirements/edx/doc.txt
# -r requirements/edx/testing.txt
Expand Down
4 changes: 2 additions & 2 deletions requirements/edx/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ edx-drf-extensions==10.5.0
# edx-when
# edxval
# openedx-learning
edx-enterprise==5.2.0
edx-enterprise==5.3.1
# via
# -c requirements/edx/../constraints.txt
# -r requirements/edx/base.txt
Expand Down Expand Up @@ -1010,7 +1010,7 @@ openedx-filters==1.11.0
# -r requirements/edx/base.txt
# lti-consumer-xblock
# ora2
openedx-forum==0.1.2
openedx-forum==0.1.3
# via -r requirements/edx/base.txt
openedx-learning==0.18.1
# via
Expand Down
4 changes: 2 additions & 2 deletions requirements/edx/testing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ edx-drf-extensions==10.5.0
# edx-when
# edxval
# openedx-learning
edx-enterprise==5.2.0
edx-enterprise==5.3.1
# via
# -c requirements/edx/../constraints.txt
# -r requirements/edx/base.txt
Expand Down Expand Up @@ -1055,7 +1055,7 @@ openedx-filters==1.11.0
# -r requirements/edx/base.txt
# lti-consumer-xblock
# ora2
openedx-forum==0.1.2
openedx-forum==0.1.3
# via -r requirements/edx/base.txt
openedx-learning==0.18.1
# via
Expand Down
22 changes: 22 additions & 0 deletions webpack.common.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,27 @@ var defineFooter = new RegExp('(' + defineCallFooter.source + ')|('
var staticRootLms = process.env.STATIC_ROOT_LMS || './test_root/staticfiles';
var staticRootCms = process.env.STATIC_ROOT_CMS || (staticRootLms + '/studio');

class DieHardPlugin {
/* A small plugin which ensures that if Webpack fails, it causes the surrounding process to fail
* as well. This helps us prevent JavaScript CI from "false passing" upon build failures--that is,
* we want to avoid having another situation where the Webpack build breaks under Karma (our
* test runner) but Karma just lets it slide and moves on to the next test suite.
*
* One would imagine that this would be Webpack's default behavior (and maybe it is?) but,
* regardless, karma-webpack does not seem to consider Webpack build failures to be fatal errors
* without this plugin. We don't fully understand it, but this is good enough given that we plan
* to remove all JS in this repo soon (https://github.com/openedx/edx-platform/issues/31620).
*
* Inpsired by: https://github.com/codymikol/karma-webpack/issues/49#issuecomment-842682050
*/
apply(compiler) {
compiler.hooks.failed.tap('DieHardPlugin', (error) => {
console.error(error);
process.exit(1);
});
}
}

var workerConfig = function() {
try {
return {
Expand Down Expand Up @@ -153,6 +174,7 @@ module.exports = Merge.smart({
// any other way to declare that dependency.
$script: 'scriptjs'
}),
new DieHardPlugin(),
],

module: {
Expand Down

0 comments on commit ea5880d

Please sign in to comment.