Skip to content

Commit

Permalink
chore: refactor dev/ci test setup (openedx#361)
Browse files Browse the repository at this point in the history
  • Loading branch information
christopappas authored Dec 7, 2021
1 parent 0f6924c commit 5f9af64
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 111 deletions.
35 changes: 19 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,30 @@ on:
branches: [master]

jobs:
build:
name: Tests
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 4
matrix:
python-version: ['py38']
django-version: ['django32']

python-version: ["3.8"]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.8'
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Start container
run: |
docker-compose -f .github/docker-compose-github.yml up -d
- name: Install test dependencies and run validation
run: |
docker exec -e TOXENV=${{ matrix.python-version }}-${{ matrix.django-version }} -u root license_manager.app /edx/app/license_manager/validate.sh
- name: Code Coverage
uses: codecov/codecov-action@v1
- name: Install requirements
run: make requirements
- name: Upgrade packages
run: pip install -U pip wheel codecov
- name: Validate translations
run: make validate_translations
- name: Run tests
run: make test
- name: Run pycodestyle
run: make style
- name: Run isort
run: make isort_check
- name: Run pii check
run: make pii_check
- name: Codecov
run: codecov
7 changes: 2 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ django_shell: ## run Django shell
python manage.py shell

test: clean ## run tests and generate coverage report
tox -e $(TOXENV)
pytest

# To be run from CI context
coverage: clean
Expand All @@ -77,7 +77,7 @@ style: ## run Python style checker
pycodestyle license_manager *.py

lint: ## run Python code linting
pylint -j 0 --rcfile=pylintrc license_manager/ *.py
pylint -j 0 --django-settings-module=license_manager.settings.test --rcfile=pylintrc license_manager *.py

quality: style isort_check lint ## check code style and import sorting, then lint

Expand Down Expand Up @@ -130,10 +130,7 @@ upgrade: piptools $(COMMON_CONSTRAINTS_TXT) ## update the requirements/*.txt fil
pip-compile --upgrade -o requirements/quality.txt requirements/quality.in
pip-compile --upgrade -o requirements/validation.txt requirements/validation.in
pip-compile --upgrade -o requirements/dev.txt requirements/dev.in
pip-compile --upgrade -o requirements/travis.txt requirements/travis.in
pip-compile --upgrade -o requirements/production.txt requirements/production.in
# Let tox control the Django version for tests
sed -i.tmp '/^django==/d' requirements/test.txt
rm requirements/test.txt.tmp

extract_translations: ## extract strings to be translated, outputting .mo files
Expand Down
6 changes: 2 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
License Manager |Travis|_ |Codecov|_
License Manager |Codecov|_
===================================================
.. |Travis| image:: https://travis-ci.com/edx/license-manager.svg?branch=master
.. _Travis: https://travis-ci.com/edx/license-manager

.. |Codecov| image:: http://codecov.io/github/edx/license-manager/coverage.svg?branch=master
.. _Codecov: http://codecov.io/github/edx/license-manager?branch=master

Expand All @@ -28,6 +25,7 @@ Quick Setup
$ make dev.up
$ make app-shell
# make requirements
# make validate # to run full test suite

The server will run on ``localhost:18170``

Expand Down
6 changes: 6 additions & 0 deletions docs/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@ Code quality validation can be run independently with:
.. code-block:: bash
$ make quality
Python tests can be run independently with:

.. code-block:: bash
$ make test
5 changes: 0 additions & 5 deletions requirements/travis.in

This file was deleted.

48 changes: 0 additions & 48 deletions requirements/travis.txt

This file was deleted.

13 changes: 0 additions & 13 deletions tox.ini

This file was deleted.

20 changes: 0 additions & 20 deletions validate.sh

This file was deleted.

0 comments on commit 5f9af64

Please sign in to comment.