Skip to content
This repository was archived by the owner on Aug 5, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ omit =
*admin.py
*static*
*templates*
*tests*
98 changes: 98 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: Integration Tests

on:
pull_request:
push:
branches: [main]

concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

jobs:
tests:
name: ${{ matrix.edx-platform.branch }} (${{ matrix.edx-platform.release }})
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
edx-platform:
- branch: opencraft-release/nutmeg.2
remote: open-craft
release: nutmeg
- branch: fox/bb-7295-direct-copying
remote: open-craft
release: master
env:
EDX_PLATFORM_PATH: ./edx/app/edxapp/edx-platform
SECTION_TO_COURSE_PATH: ./edx/src/section-to-course

steps:
- name: Create directory structure
run: mkdir -p ${{ env.EDX_PLATFORM_PATH }} ${{ env.SECTION_TO_COURSE_PATH }}

- name: Checkout edx-platform repository
uses: actions/checkout@v3
with:
repository: ${{ matrix.edx-platform.remote }}/edx-platform
ref: ${{ matrix.edx-platform.branch }}
path: ${{ env.EDX_PLATFORM_PATH }}

- name: install edx-platform required packages
run: sudo apt-get update && sudo apt-get install libxmlsec1-dev lynx

- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.7.0
with:
mongodb-version: 4.4

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.8

- name: Get pip cache dir
id: pip-cache-dir
run: echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT

- name: Cache pip dependencies
id: cache-dependencies
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache-dir.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/edx/testing.txt') }}
restore-keys: ${{ runner.os }}-pip-

- name: Install edx-platform required Python dependencies
env:
PIP_SRC: ${{ runner.temp }}
working-directory: ${{ env.EDX_PLATFORM_PATH }}
run: |
if [[ "${{ matrix.edx-platform.release }}" == "nutmeg" ]]; then
pip install -r requirements/pip.txt
pip install -r requirements/edx/development.txt --src ${{ runner.temp }}
else
make test-requirements
fi

- name: Checkout section-to-course repo
uses: actions/checkout@v3
with:
path: ${{ env.SECTION_TO_COURSE_PATH }}
Comment thread
sathiscode marked this conversation as resolved.

- name: Install section-to-course
working-directory: ${{ env.SECTION_TO_COURSE_PATH }}
run: pip install -e .

- name: Run section-to-course integration tests
working-directory: ${{ env.SECTION_TO_COURSE_PATH }}
run: make test_integration

- name: Run coverage
if: matrix.edx-platform.branch == 'opencraft-release/nutmeg.2'
uses: codecov/codecov-action@v3
with:
working-directory: ${{ env.SECTION_TO_COURSE_PATH }}
token: ${{ secrets.CODECOV_TOKEN }}
flags: integration
fail_ci_if_error: true
2 changes: 1 addition & 1 deletion .github/workflows/upgrade-python-requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
jobs:
call-upgrade-python-requirements-workflow:
with:
branch: ${{ github.event.inputs.branch }}
branch: ${{ github.event.inputs.branch || 'main' }}
# team_reviewers: ""
# email_address: email@edx.org
send_success_notification: false
Expand Down
7 changes: 5 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Change Log

..
All enhancements and patches to section_to_course will be documented
in this file. It adheres to the structure of https://keepachangelog.com/ ,
in this file. It adheres to the structure of https://keepachangelog.com/ ,
but in reStructuredText instead of Markdown (for ease of incorporation into
Sphinx documentation and the PyPI description).

Expand All @@ -14,7 +14,10 @@ Change Log
Unreleased
**********

*
Added
=====

* Github integration-tests action.

[0.3.0] - 2023-05-12
********************
Expand Down
19 changes: 9 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: clean compile_translations coverage diff_cover dummy_translations \
extract_translations fake_translations help pii_check pull_translations push_translations \
quality requirements selfcheck test test-all upgrade validate install_transifex_client
quality requirements selfcheck test_integration test_package upgrade validate install_transifex_client

.DEFAULT_GOAL := help

Expand Down Expand Up @@ -51,25 +51,24 @@ quality: ## check coding style with pycodestyle and pylint
pii_check: ## check for PII annotations on all Django models
tox -e pii_check

test_package: ## check if the Python package is formatted correctly
tox -e package

piptools: ## install pinned version of pip-compile and pip-sync
pip install -r requirements/pip.txt
pip install -r requirements/pip-tools.txt

requirements: piptools ## install development environment requirements
pip-sync -q requirements/dev.txt requirements/private.*

test: export DJANGO_SETTINGS_MODULE=cms.envs.test
test:
cd ../../app/edxapp/edx-platform/ && pytest --pyargs section_to_course --rootdir cms
test_integration: export DJANGO_SETTINGS_MODULE=cms.envs.test
test_integration:
cd ../../app/edxapp/edx-platform/ && pytest --pyargs section_to_course --rootdir cms --cov section_to_course --cov-config=$(CURDIR)/.coveragerc --cov-report term-missing --cov-report=xml:$(CURDIR)/coverage.xml

diff_cover: test ## find diff lines that need test coverage
diff_cover: test_integration ## find diff lines that need test coverage
diff-cover coverage.xml

test-all: quality pii_check ## run tests on every supported Python/Django combination
tox
tox -e docs

validate: quality pii_check test ## run tests and quality checks
validate: quality pii_check test_package ## run tests and quality checks

selfcheck: ## check that the Makefile is well-formed
@echo "The Makefile is well-formed."
Expand Down