General Testing configurations: https://github.com/edx/edx-platform/blob/master/docs/guides/testing/testing.rst
We start by creating a base configuration which corresponds for the edX common unit tests. Most other test configurations will be copied and adapted from the base configuration.
/edx/app/edxapp/venvs/edxapp/bin/nosetests
common/lib/xmodule/xmodule/tests/test_resource_templates.py
DISABLE_MIGRATIONS
and the value is true
.lms --settings test test lms/djangoapps/courseware/tests/test_views.py
cms --settings test test cms/djangoapps/contentstore/views/tests/test_helpers.py
cms --settings acceptance harvest --traceback --debug-mode --verbosity 2 --with-xunit --xunit-file /edx/app/edxapp/edx-platform/reports/acceptance/cms.xml cms/djangoapps/contentstore/features/problem-editor.feature
/edx/app/edxapp/venvs/edxapp/bin/paver
.test_bokchoy
or test_bokchoy --fasttest
(if you have already compiled the assets)./edx/app/edxapp/edx-platform
/Users/[username]/devstack/edx-platform=/edx/app/edxapp/edx-platform
See also Working with Vagrant devstack and PyCharm, where there are screenshots of example configurations.
The idea is to start up the LMS and CMS servers with a special configuration (see bleow) and then run tests individually while those services are up.
Note: You may need to set FEATURES['MILESTONES_APP'] and FEATURES['ORGANIZATIONS_APP'] to False in cms/envs/bok_choy.py and lms/envs/bok_choy.py.
1. In Preferences/ Project Structure mark ./common/djangoapps/terrain/stubs as a source.
echo $DISPLAY
and make sure that is non-null)./manage.py
.cms --settings bok_choy runserver 0.0.0.0:8031 --traceback --noreload
(if you have already compiled the assets)../manage.py
.lms --settings bok_choy runserver 0.0.0.0:8003 --traceback --noreload
(if you have already compiled the assets)./edx/app/edxapp/venvs/edxapp/bin/nosetests
./edx/app/edxapp/edx-platform/common/test/acceptance/tests/discussion/test_cohort_management.py:CohortConfigurationTest --with-xunit --xunit-file=/edx/app/edxapp/edx-platform/reports/bok_choy/xunit.xml --verbosity=2
DISPLAY=localhost:11.0
If you see the following error, either:
See Integrating XQuartz into PyCharm to review instructions on any of the above.
NOTE: You may need to log out and log in to the terminal you opened in the XQuartz integration a second time if PyCharm can't find your display.
BrokenPromise: Promise not satisfied: Browser is instantiated successfully. -------------------- >> begin captured logging << -------------------- bok_choy.browser: INFO: Using local browser: firefox [Default is firefox] bok_choy.browser: INFO: Using default firefox profile bok_choy.browser: DEBUG: Failed to instantiate browser: Message: The browser appears to have exited before we could connect. If you specified a log_file in the FirefoxBinary constructor, check it for details. |
If you see the following error, you may need to set FEATURES['MILESTONES_APP'] and FEATURES['ORGANIZATIONS_APP'] to False in cms/envs/bok_choy.py and lms/envs/bok_choy.py.
Response content was: { "error": "You must link this course to an organization in order to continue. Organization you selected does not exist in the system, you will need to add it to the system" } |