Skip to content

Commit

Permalink
Merge pull request #184 from eduNEXT/mgs/separate-js-quality-tests
Browse files Browse the repository at this point in the history
Run JS quality test on a different build.
  • Loading branch information
jfavellar90 committed Nov 9, 2021
2 parents 6cf882e + aa03f41 commit 4f0eb3c
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 57 deletions.
16 changes: 15 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ workflows:
debian_version: "stretch"
- python_version: "3.5"
debian_version: "buster"
- quality-js:
filters:
tags:
only: /v?[0-9]+(\.[0-9]+)*/
- pypi:
requires:
- test
Expand Down Expand Up @@ -66,7 +70,6 @@ jobs:
test -d venv || virtualenv venv
. venv/bin/activate
pip install -r requirements/tox.txt
npm install
# run tests!
# this example uses Django's built-in test-runner
Expand Down Expand Up @@ -95,6 +98,17 @@ jobs:
- PY_ENV: py<< parameters.python_version >>
- DJANGO_ENV: << parameters.django_version >>

quality-js:
docker:
- image: circleci/python:3.5-node
steps:
- checkout
- run:
name: Install node dependencies and run JS quality
command: |
npm install
make javascript-quality-test
pypi:
docker:
- image: circleci/python:3.5
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ python-quality-test:
javascript-quality-test:
./node_modules/.bin/eslint ./eox_core/**/*.js*

run-tests: python-test python-quality-test javascript-quality-test
run-tests: python-test python-quality-test

upgrade: export CUSTOM_COMPILE_COMMAND=make upgrade
upgrade: ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in
Expand Down
122 changes: 67 additions & 55 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,62 +12,71 @@ and pre-enrollment operations.
Usage
=====

**Open edX releases before juniper**
Open edX releases before juniper
--------------------------------

1) Create the oauth client at http://localhost:18000/admin/oauth2/client/add/, copy the client-id and client-secret.
#. Create the oauth client at http://localhost:18000/admin/oauth2/client/add/, copy the client-id and client-secret.

2) Generate an auth-token using that client-id and client-secret:
#. Generate an auth-token using that client-id and client-secret:

.. code-block:: bash
.. code-block:: bash
$ curl -X POST -d "client_id=<YOUR_CLIENT_ID>&client_secret=<YOUR_CLIENT_SECRET>
&grant_type=client_credentials" http://localhost:18000/oauth2/access_token/
$ curl -X POST -d "client_id=<YOUR_CLIENT_ID>&client_secret=<YOUR_CLIENT_SECRET> &grant_type=client_credentials" http://localhost:18000/oauth2/access_token/
3) Use the token to call the API as you need:
#. Use the token to call the API as you need:

.. code-block:: bash
* User creation API example

.. code-block:: bash
curl -X POST http://localhost:18000/eox-core/api/v1/user/ \
-H "Authorization: Bearer <YOUR_AUTH_TOKEN>" \
-H "Accept: application/json" \
-H "Content\-Type: application/json" \
--data '{"username": "jsmith", "email": "[email protected]", "password": "qwerty123", "fullname": "Jhon Smith"}'
* Enroll api example

# User creation API example
curl -X POST --header "Authorization: Bearer <YOUR_AUTH_TOKEN>" -H "Accept: application/json" \
http://localhost:18000/eox-core/api/v1/user/ --header "Content\-Type: application/json" \
--data '{"username": "jsmith", "email": "[email protected]", "password": "qwerty123",
"fullname": "Jhon Smith"}'
.. code-block:: bash
# Enroll api example
curl -X POST --header "Authorization: Bearer <YOUR_AUTH_TOKEN>" -H "Accept: application/json" \
http://localhost:18000/eox-core/api/v1/enrollment/ --header "Content-Type: application/json" \
--data '{"course_id": "course-v1:edX+DemoX+Demo_Course", "email": "[email protected]",
"mode": "audit", "force": 1}'
curl -X POST http://localhost:18000/eox-core/api/v1/enrollment/ \
-H "Authorization: Bearer <YOUR_AUTH_TOKEN>" \
-H "Accept: application/json" \
-H "Content\-Type: application/json" \
--data '{"course_id": "course-v1:edX+DemoX+Demo_Course", "email": "[email protected]", "mode": "audit", "force": 1}'
**Open edX releases after juniper**
Open edX releases after juniper
-------------------------------

Instead of step #1, follow:
Instead of step 1, follow:

#. Create a Django Oauth Toolkit Application at http://localhost:18000/admin/oauth2_provider/application/add/,
copy the client-id and client-secret. Then follow 2 and 3.

1) Create a Django Oauth Toolkit Application at http://localhost:18000/admin/oauth2_provider/application/add/,
copy the client-id and client-secret. Then follow 2 and 3.

Installation on Open edX Devstack
=================================
- Install either the Ironwood or Juniper version of the `Open edX devstack`_

- Clone the git repo:
* Install either the Ironwood or Juniper version of the `Open edX devstack`_

.. code-block:: bash
* Clone the git repo:

cd ~/Documents/eoxstack/src/ # Assuming that devstack is in ~/Documents/eoxstack/devstack/
sudo mkdir edxapp
cd edxapp
git clone [email protected]:eduNEXT/eox-core.git
.. code-block:: bash
cd ~/Documents/eoxstack/src/ # Assuming that devstack is in ~/Documents/eoxstack/devstack/
sudo mkdir edxapp
cd edxapp
git clone [email protected]:eduNEXT/eox-core.git
- Install plugin from your server (in this case the devstack docker lms shell):

.. code-block:: bash
cd ~/Documents/eoxstack/devstack # Change for your devstack path (if you are using devstack)
make lms-shell # Enter the devstack machine (or server where lms process lives)
cd /edx/src/edxapp/eox-core
pip install -e .
.. code-block:: bash
cd ~/Documents/eoxstack/devstack # Change for your devstack path (if you are using devstack)
make lms-shell # Enter the devstack machine (or server where lms process lives)
cd /edx/src/edxapp/eox-core
pip install -e .
Compatibility Notes
--------------------
Expand Down Expand Up @@ -135,31 +144,30 @@ Integrations with third party services
The plugin offers some integrations listed below:

#. **Sentry**: This service allows to track the errors generated on edx-platform. Check more details in https://sentry.io/welcome/.
To enable the integration, follow the steps below:

- Install the plugin with Sentry support (extras_require [sentry]).
To enable the integration, follow the steps below:

- Sign up/in to your sentry account and create a new Django application integration.
* Install the plugin with Sentry support (extras_require [sentry]).

- Get the DSN for your integration. This is an unique identifier for your application.
* Sign up/in to your sentry account and create a new Django application integration.

- Setup the following configuration values for edx-platform:
* Get the DSN for your integration. This is an unique identifier for your application.

.. code-block:: yaml
* Setup the following configuration values for edx-platform:

EOX_CORE_SENTRY_INTEGRATION_DSN: <your DSN value>
EOX_CORE_SENTRY_IGNORED_ERRORS: [] # optional
.. code-block:: yaml
EOX_CORE_SENTRY_INTEGRATION_DSN: <your DSN value>
EOX_CORE_SENTRY_IGNORED_ERRORS: [] # optional
By default, **EOX_CORE_SENTRY_INTEGRATION_DSN** setting is None, which disables the sentry integration.
**EOX_CORE_SENTRY_IGNORED_ERRORS** is optional. It is a list of the exceptions you want to ignore. For instance, it can be defined as:
By default, **EOX_CORE_SENTRY_INTEGRATION_DSN** setting is None, which disables the sentry integration.
**EOX_CORE_SENTRY_IGNORED_ERRORS** is optional. It is a list of the exceptions you want to ignore. For instance, it can be defined as:

.. code-block:: yaml
.. code-block:: yaml
EOX_CORE_SENTRY_IGNORED_ERRORS: [
'xmodule.exceptions.NotFoundError',
'openedx.core.djangoapps.user_authn.exceptions.AuthFailedError',
]
EOX_CORE_SENTRY_IGNORED_ERRORS: [
'xmodule.exceptions.NotFoundError',
'openedx.core.djangoapps.user_authn.exceptions.AuthFailedError',
]
Course Management automation
============================
Expand All @@ -171,16 +179,20 @@ This component allows Studio users to make changes in multiple courses, such as:
* Re-run a course across multiple organizations.

Compilation
###########
-----------

We use webpack to bundle the React js application and its dependencies.
To compile in a development environment, run this command on the root folder:

npm run build-dev
.. code-block:: bash
npm run build-dev
Otherwise, if you want to compile for use in production environment, run this command instead:

npm run build-prod
.. code-block:: bash
npm run build-prod
These commands are defined in the package.json file and each one exports two bundle files (build.js and
course-management.bundle.css) inside of eox_core/static folder.
Expand Down Expand Up @@ -223,7 +235,7 @@ For more information, check the eox-audit-model documentation.
.. _eox-audit-model: https://github.com/eduNEXT/eox-audit-model/

How to Contribute
#################
-----------------

Contributions are welcome! See our `CONTRIBUTING`_ file for more
information – it also contains guidelines for how to maintain high code
Expand Down

0 comments on commit 4f0eb3c

Please sign in to comment.