Currently, ./xmodule/ unit tests are only run with LMS settings. However, ./common/ and ./xmodule/ are run twice: once with LMS settings and once with CMS settings. Just like ./common/ and ./openedx/, the unit tests in ./xmodule/ validate behavior in both LMS and CMS. So, order to fully test ./xmodule/, we should to run its tests with CMS settings too. This will enable us to better validate certain LibraryContentBlocks behaviors being touched by https://github.com/openedx/edx-platform/pull/33263 which can't be expressed under LMS settings. Also in this commit: * refactor: rename the shards to be clear whether they're running under LMS or CMS * docs: correct comments regarding conditions under which codejail's test_cant_do_something_forbidden is skipped. * test: update a unit test which was using the now-deleted library_sourced block to use library_content block instead.
124 lines
3.9 KiB
YAML
124 lines
3.9 KiB
YAML
name: unit-tests-gh-hosted
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- master
|
|
- open-release/lilac.master
|
|
|
|
jobs:
|
|
run-test:
|
|
if: (github.repository != 'openedx/edx-platform' && github.repository != 'edx/edx-platform-private') || (github.repository == 'openedx/edx-platform' && (startsWith(github.base_ref, 'open-release') == true))
|
|
runs-on: ubuntu-20.04
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
python-version: [ '3.8' ]
|
|
django-version:
|
|
- "pinned"
|
|
# When updating the shards, remember to make the same changes in
|
|
# .github/workflows/unit-tests.yml
|
|
shard_name:
|
|
- "lms-1"
|
|
- "lms-2"
|
|
- "lms-3"
|
|
- "lms-4"
|
|
- "lms-5"
|
|
- "lms-6"
|
|
- "openedx-1-with-lms"
|
|
- "openedx-2-with-lms"
|
|
- "openedx-1-with-cms"
|
|
- "openedx-2-with-cms"
|
|
- "cms-1"
|
|
- "cms-2"
|
|
- "common-with-lms"
|
|
- "common-with-cms"
|
|
- "xmodule-with-lms"
|
|
- "xmodule-with-cms"
|
|
name: gh-hosted-python-${{ matrix.python-version }},django-${{ matrix.django-version }},${{ matrix.shard_name }}
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Install Required System 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: ${{ matrix.python-version }}
|
|
|
|
- name: Get pip cache dir
|
|
id: pip-cache-dir
|
|
run: |
|
|
echo "::set-output name=dir::$(pip cache dir)"
|
|
|
|
- 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 Required Python Dependencies
|
|
env:
|
|
PIP_SRC: ${{ runner.temp }}
|
|
run: |
|
|
make test-requirements
|
|
if [[ "${{ matrix.django-version }}" != "pinned" ]]; then
|
|
pip install "django~=${{ matrix.django-version }}.0"
|
|
pip check # fail if this test-reqs/Django combination is broken
|
|
fi
|
|
|
|
- name: Setup and run tests
|
|
uses: ./.github/actions/unit-tests
|
|
|
|
collect-and-verify:
|
|
if: (github.repository != 'openedx/edx-platform' && github.repository != 'edx/edx-platform-private') || (github.repository == 'openedx/edx-platform' && (startsWith(github.base_ref, 'open-release') == true))
|
|
runs-on: ubuntu-20.04
|
|
strategy:
|
|
matrix:
|
|
python-version: [ '3.8' ]
|
|
django-version:
|
|
- "pinned"
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Install Required System Packages
|
|
run: sudo apt-get update && sudo apt-get install libxmlsec1-dev
|
|
|
|
- name: Setup Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Get pip cache dir
|
|
id: pip-cache-dir
|
|
run: |
|
|
echo "::set-output name=dir::$(pip cache dir)"
|
|
|
|
- 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 Required Python Dependencies
|
|
run: |
|
|
make test-requirements
|
|
if [[ "${{ matrix.django-version }}" != "pinned" ]]; then
|
|
pip install "django~=${{ matrix.django-version }}.0"
|
|
pip check # fail if this test-reqs/Django combination is broken
|
|
fi
|
|
|
|
- name: verify unit tests count
|
|
uses: ./.github/actions/verify-tests-count
|