Skip to content

Commit

Permalink
Revert "Revert "refactor: move xmodule folder to root""
Browse files Browse the repository at this point in the history
  • Loading branch information
mumarkhan999 authored Jun 20, 2022
1 parent 46d848b commit a389a9f
Show file tree
Hide file tree
Showing 487 changed files with 216 additions and 339 deletions.
2 changes: 1 addition & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ source =
cms
common/djangoapps
common/lib/capa
common/lib/xmodule
lms
openedx
pavelib
scripts
xmodule

omit =
cms/envs/*
Expand Down
1 change: 1 addition & 0 deletions .coveragerc-local
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ source =
openedx
pavelib
scripts
xmodule

omit =
cms/envs/*
Expand Down
14 changes: 7 additions & 7 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ test_root/staticfiles
common/static/xmodule


# Symlinks into common/lib/xmodule/xmodule/js
# Symlinks into xmodule/js
cms/static/xmodule_js
lms/static/xmodule_js

Expand Down Expand Up @@ -50,19 +50,19 @@ common/lib/capa/capa/tests/test_files/js/test_problem_display.js
common/lib/capa/capa/tests/test_files/js/test_problem_generator.js
common/lib/capa/capa/tests/test_files/js/test_problem_grader.js
common/lib/capa/capa/tests/test_files/js/xproblem.js
common/lib/xmodule/xmodule/js/spec/annotatable/display_spec.js
common/lib/xmodule/xmodule/js/spec/capa/display_spec.js
common/lib/xmodule/xmodule/js/spec/html/edit_spec.js
common/lib/xmodule/xmodule/js/spec/problem/edit_spec_hint.js
common/lib/xmodule/xmodule/js/spec/problem/edit_spec.js
common/lib/xmodule/xmodule/js/spec/tabs/edit.js
lms/static/js/spec/calculator_spec.js
lms/static/js/spec/courseware_spec.js
lms/static/js/spec/feedback_form_spec.js
lms/static/js/spec/helper.js
lms/static/js/spec/histogram_spec.js
lms/static/js/spec/modules/tab_spec.js
lms/static/js/spec/requirejs_spec.js
xmodule/js/spec/annotatable/display_spec.js
xmodule/js/spec/capa/display_spec.js
xmodule/js/spec/html/edit_spec.js
xmodule/js/spec/problem/edit_spec_hint.js
xmodule/js/spec/problem/edit_spec.js
xmodule/js/spec/tabs/edit.js


!**/.eslintrc.js
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# Core
common/djangoapps/student/
common/djangoapps/third_party_auth/
common/lib/xmodule/xmodule/
lms/djangoapps/course_api/blocks
lms/djangoapps/courseware/
lms/djangoapps/grades/
Expand All @@ -15,6 +14,7 @@ openedx/core/djangoapps/oauth_dispatch
openedx/core/djangoapps/user_api/
openedx/core/djangoapps/user_authn/
openedx/features/course_experience/
xmodule/

# Core Extensions
common/lib/xmodule/xmodule/capa_module.py
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/verify-tests-count/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ runs:
shell: bash
run: |
echo "root_cms_unit_tests_count=$(pytest --collect-only --ds=cms.envs.test cms/ -q | head -n -2 | wc -l)" >> $GITHUB_ENV
echo "root_lms_unit_tests_count=$(pytest --collect-only --ds=lms.envs.test lms/ openedx/ common/djangoapps/ common/lib/ -q | head -n -2 | wc -l)" >> $GITHUB_ENV
echo "root_lms_unit_tests_count=$(pytest --collect-only --ds=lms.envs.test lms/ openedx/ common/djangoapps/ common/lib/ xmodule/ -q | head -n -2 | wc -l)" >> $GITHUB_ENV
- name: get GHA unit test paths
shell: bash
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/pylint-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ jobs:
path: "common"
- module-name: cms
path: "cms"
- module-name: xmodule
path: "xmodule"


name: pylint ${{ matrix.module-name }}
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/unit-test-shards.json
Original file line number Diff line number Diff line change
Expand Up @@ -270,5 +270,11 @@
"paths": [
"common/djangoapps/"
]
},
"xmodule-1": {
"settings": "lms.envs.test",
"paths": [
"xmodule/"
]
}
}
1 change: 1 addition & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
"common-1",
"common-2",
"common-3",
"xmodule-1"
]


Expand Down
2 changes: 1 addition & 1 deletion .stylelintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
common/lib/xmodule/xmodule/css
xmodule/css
common/static/sass/bourbon
common/static/xmodule/modules/css
common/test/test-theme
Expand Down
2 changes: 1 addition & 1 deletion cms/static/cms/js/require-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
'backbone.paginator': 'common/js/vendor/backbone.paginator',
'tinymce': 'js/vendor/tinymce/js/tinymce/tinymce.full.min',
'jquery.tinymce': 'js/vendor/tinymce/js/tinymce/jquery.tinymce.min',
'xmodule': '/xmodule/xmodule',
'xmodule': '/xmodule',
'xblock/cms.runtime.v1': 'cms/js/xblock/cms.runtime.v1',
'xblock': 'common/js/xblock',
'utility': 'js/src/utility',
Expand Down
2 changes: 1 addition & 1 deletion cms/static/xmodule_js
69 changes: 0 additions & 69 deletions common/lib/xmodule/setup.py

This file was deleted.

45 changes: 0 additions & 45 deletions common/lib/xmodule/test_files/formularesponse_with_hint.xml

This file was deleted.

25 changes: 0 additions & 25 deletions common/lib/xmodule/test_files/stringresponse_with_hint.xml

This file was deleted.

26 changes: 0 additions & 26 deletions common/lib/xmodule/test_files/symbolicresponse.xml

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion common/lib/xmodule/xmodule/js/common_static

This file was deleted.

1 change: 0 additions & 1 deletion common/lib/xmodule/xmodule/tests/data/xml-course-root

This file was deleted.

2 changes: 1 addition & 1 deletion common/static/css/tinymce-studio-content.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
padding: 10px;
background-color: #fff;
/* keep font-family in sync with CUSTOM_FONTS constant in Html editor XModule
* (edx-platform/common/lib/xmodule/xmodule/js/src/html/edit.js)
* (edx-platform/xmodule/js/src/html/edit.js)
* and with acceptance tests in cms/djangoapps/contentstore/features/html-editor.feature
*/
font-family: 'Open Sans', Verdana, Arial, Helvetica, sans-serif;
Expand Down
4 changes: 2 additions & 2 deletions docs/guides/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
sys.path.insert(0, root)
sys.path.append(root / "docs/guides")
sys.path.append(root / "common/lib/capa")
sys.path.append(root / "common/lib/xmodule")


# Use a settings module that allows all LMS and Studio code to be imported
# without errors. If running sphinx-apidoc, we already set a different
Expand Down Expand Up @@ -222,9 +222,9 @@
modules = {
'cms': 'cms',
'common/lib/capa/capa': 'common/lib/capa',
'common/lib/xmodule/xmodule': 'common/lib/xmodule',
'lms': 'lms',
'openedx': 'openedx',
'xmodule': 'xmodule',
}


Expand Down
1 change: 0 additions & 1 deletion docs/guides/docstrings/common_lib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ out from edx-platform into separate packages at some point.
:maxdepth: 2

common/lib/capa/modules
common/lib/xmodule/modules
1 change: 1 addition & 0 deletions docs/guides/docstrings/docstrings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ Python Docstrings
common_index
lms_index
openedx/modules
xmodule/modules
10 changes: 5 additions & 5 deletions docs/guides/testing/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Test Locations
located in ``common/lib/capa/capa/tests``.

- Javascript unit tests: Located in ``spec`` folders. For example,
``common/lib/xmodule/xmodule/js/spec`` and
``xmodule/js/spec`` and
``{cms,lms}/static/js/spec`` For consistency, you should use the
same directory structure for implementation and test. For example,
the test for ``src/views/module.js`` should be written in
Expand Down Expand Up @@ -122,7 +122,7 @@ Various ways to run tests using pytest::

For example, this command runs a single python unit test file::

pytest common/lib/xmodule/xmodule/tests/test_stringify.py
pytest xmodule/tests/test_stringify.py

Note -
edx-platorm has multiple services (lms, cms) in it. The environment for each service is different enough that we run some tests in both environments in jenkins. To make sure tests will pass in each of these environments (especially for tests in "common" directory), you will need to test in each seperately. Add --rootdir flag at end of your pytest call and specify the env you are testing in::
Expand All @@ -133,15 +133,15 @@ Various tools like ddt create tests with very complex names, rather than figurin

1. Select tests to run based on their name, provide an expression to the `pytest -k option`_ which performs a substring match on test names::

pytest common/lib/xmodule/xmodule/tests/test_stringify.py -k test_stringify
pytest xmodule/tests/test_stringify.py -k test_stringify

.. _pytest -k option: https://docs.pytest.org/en/latest/example/markers.html#using-k-expr-to-select-tests-based-on-their-name
.. _node ID: https://docs.pytest.org/en/latest/example/markers.html#node-id


2. Alternatively, you can the get the name of all test methods in a class, file, or project, including all ddt.data variations, by running pytest with `--collectonly`::

pytest common/lib/xmodule/xmodule/tests/test_stringify.py --collectonly
pytest xmodule/tests/test_stringify.py --collectonly

Testing with migrations
***********************
Expand Down Expand Up @@ -215,7 +215,7 @@ Use this command to generate an HTML report::

coverage html

The report is then saved in reports/common/lib/xmodule/cover/index.html
The report is then saved in reports/xmodule/cover/index.html

To run tests for stub servers, for example for `YouTube stub server`_, you can
run one of these commands::
Expand Down
Loading

0 comments on commit a389a9f

Please sign in to comment.