There are a lot of great ORA resources:
ORA is broken into two separate repositories:
There is a useful test course which contains a variety of configurations of ORA problems:
Note - anytime I say "from inside the lms", that means you've run 'make lms-shell' from the devstack directory and are on a command prompt inside the lms container.
pip uninstall ora2 -y; pip install -e /edx/src/edx-ora2/
Now, get your edx-ora2 development environment set up: (the virtual environment MUST be named edx-ora2)
cd /edx/src/edx-ora2
virtualenv edx-ora2
source edx-ora2/bin/activate
make install
ensure that your virtual environment is named edx-ora2. Using a different name will cause errors when trying to generate translations.
make lms-restart lms-logs
tox -e <env>
for the env in question (after re-activating your edx-ora2 virtual environment).If you keep your containers running, you can return to your configured env very quickly - just cd /edx/src/edx-ora2; source edx-ora2/bin/activate from inside the lms and you're good to go. As of right this second, you need to repeat all these steps after restarting your container (because solving that problem is still in progress).
Special testing note: If your python tests fail with UnicodeEncodeErrors that look like this: UnicodeEncodeError: 'ascii' codec can't encode character u'\xeb' in position 42: ordinal not in range(128)
, there's an easy fix. What's happening is that there are python tests (for the filesystem-based file upload backend) which will attempt to locate paths on the current box. One of these paths contains a weird unicode value that can cause problems. The fix is to ensure that your local system (the lms container) is using unicode. First, try export LC_ALL='en_US.UTF-8'
. If that failed with /bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
, that just means your system doesn't have the required locale generated. Run sudo locale-gen en_US.UTF-8
, then retry the initial command.
make javascript
- makes the bundled JavaScript files for LMS and Studio
make quality
- run the JSHint quality tests
make sass
- recompiles sass, can be done while edx-platform is running, then refresh the browser to see the changesmake test
- run all the testsmake test-acceptance
- run the acceptance testsmake test-a11y
- run the accessibility testsmake test-js
- run the JavaScript testsmake test-js-debug
- run the JavaScript tests in debug mode in Chromemake test-python
- run the Python testsmake test-sandbox
- run all the sandbox tests (currently acceptance and a11y)Before committing any changes, remember to regenerate the CSS and the bundled JavaScript files. Your changes may work locally because Studio, LMS and the tests access the raw files directly, but on a sandbox or production-like environment only the bundled files are used. You should do the following:
make javascript sass |
The ORA acceptance and accessibility tests are written as Bok Choy tests that run against a sandbox.
First create a sandbox following the steps at Creating an ORA2 Sandbox
Now you can run the acceptance tests:
On your devstack, do the following:
(as edxapp user) cd /edx/src/edx-ora2 source edx-ora2/bin/activate export ORA_SANDBOX_URL=https://staff:edx@andy-armstrong.sandbox.edx.org (replace with name of your sandbox) |
The first step is to be able to debug into ORA2 source code when running Studio or LMS:
/edx/src/edx-ora2
The next step is to add a new remote interpreter which uses the ORA2 virtual env:
/edx/src/edx-ora2/edx-ora2/bin/python
The final step is to add a debug configuration for running ORA2 tests:
/edx/src/edx-ora2