Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

...

  1. Clone edx-ora2 repo into ../src/ directory (relative to your 'devstack' repo location). If https://github.com/edx/devstack/pull/202 has been merged (or you're using my in flight branch), this will mount the directory in a way that is accessible to the lms container.
  2. From inside the lms, uninstall ora2 and reinstall your local copy. You can just copy the following line:
    1. pip uninstall ora2 -y; pip install -e /edx/src/edx-ora2/

  3. Now, get your edx-ora2 development environment set up: (the virtual environment MUST be named edx-ora2)

    1. cd /edx/src/edx-ora2
    2. virtualenv edx-ora2
    3. source edx-ora2/bin/activate
    4. make install
    5. ensure that your virtual environment is named edx-ora2. Using a different name will cause errors when trying to generate translations.
  4. Now, in the devstack directory on your host, run:
    1. make lms-restart lms-logs
  5. That's it, you're good to go! See Makefile for all the available commands, most are fairly self-explanatory
    1. In order to simulate a given tox environment (django18, django111, quality, js), run tox -e <env> for the env in question (after re-activating your edx-ora2 virtual environment).
    2. Usually, you can just run the underlying make commands for quicker tests, as requirements aren't re-installed.

...

Expand
titleDeprecated - Vagrant Instructions

DEPRECATED - Using ORA with vagrant devstack

(Note that some of this is outdated, I'm working on updating it to match the 2.0.0 release)

Initial Setup 

 These are the steps to install ORA2 into your pre-existing devstack image:

  • Clone edx-ora2 into the src directory next to edx-platform folder 

    No Format
    cd src
    git clone https://github.com/edx/edx-ora2
    git clone https://github.com/edx/edx-submissions


  • Install the edx-submissions and ORA2 packages into edx-platform. From devstack do the following (note ORA2 goes first so that we can uninstall its copy of edx-submissions):

    No Format
    sudo su edxapp
    pip uninstall ora2
    pip install -e /edx/src/edx-ora2
    pip uninstall edx-submissions
    pip install -e /edx/src/edx-submissions


To run the ORA scripts for packaging, testing etc, you should do the following:

  • As edxapp user, run the following. 

    No Format
    sudo su edxapp
    cd /edx/src/edx-ora2
    # create a new virtualenv
    virtualenv edx-ora2
    # activate this new virtualenv
    source edx-ora2/bin/activate
    make install


  • You can run the ORA tests as the edxapp user: 

    No Format
    cd /edx/src/edx-ora2
    # activate the ORA2 virtualenv
    source edx-ora2/bin/activate
    make test
    # run just the Python tests
    make test-python
    # debug the Jasmine tests in a browser
    make test-js-debug


  • When you run the lms do not use the full paver devstack lms or studio commands as they will cause pip to install ORA2 and submissions again.

    Code Block
    lms runserver --settings=devstack 0.0.0.0:8000


After you have run all the setup commands above, when you restart your devstack do the following to execute ORA scripts:

No Format
vagrant ssh
sudo su edxapp
cd /edx/src/edx-ora2
source edx-ora2/bin/activate	

# now you can use make commands, such as:
make sass


Debugging JavaScript tests

  • Before starting your devstack, add the following line to the Vagrantfile (next to the other port forwarding lines): 

    No Format
    config.vm.network :forwarded_port, guest: 9876, host: 9876  # ORA2 Karma tests


  • This allows you to open the Karma debug page in your local browser
  • Run: make test-js-debug
  • Open your browser of choice onto this URL:
http://localhost:9876/debug.html
  • The tests will be enumerated as they are run, and failures will be shown with stack traces
  • You can now use the debug tools in the browser to diagnose the failures
  • Note that you can re-run just an individual failing test by clicking on its name

...