Skip to content

feat: add integration tests #12

feat: add integration tests

feat: add integration tests #12

name: Integration Test
on: [pull_request]
jobs:
edx-platform-integration-test:
name: Integration with Tutor
strategy:
matrix:
# Open edX Version: Sumac
tutor_version: ["<20.0.0"]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: mitx-grading-library
- name: Adjust permissions to execute Tutor commands
run: |
chmod 777 . -R
shell: bash
- name: Set Tutor environment variables
run: |
cat <<EOF >> "$GITHUB_ENV"
LMS_HOST=local.edly.io
CMS_HOST=studio.local.edly.io
TUTOR_ROOT=$(pwd)
COURSE_KEY=course-v1:MITx+grading-library+course
EOF
shell: bash
- name: Install Tutor
run: pip install "tutor${{ matrix.tutor_version }}"
shell: bash
- name: Mount Integration Test
run: tutor mounts add cms:mitx-grading-library/integration_tests/integration_test.py:/openedx/edx-platform/integration_test.py
shell: bash
- name: Launch Tutor
run: tutor local launch -I
shell: bash
- name: Import MITx Demo Course
run: |
tutor local do importdemocourse -r ${{ github.event.pull_request.head.repo.clone_url }} -d course -v ${{ github.event.pull_request.head.ref }}
shell: bash
- name: Run integration tests
run: |
tutor local run cms python integration_test.py "$COURSE_KEY"
shell: bash