Skip to content

Commit

Permalink
test: add the action
Browse files Browse the repository at this point in the history
  • Loading branch information
MaferMazu committed May 21, 2024
1 parent 0a85154 commit dba27f1
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 2 deletions.
38 changes: 38 additions & 0 deletions .github/actions/integration-test/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Integration Test in Tutor
description: 'A Github action to test your plugin in Tutor (Open edX distribution)'
inputs:
app_name:
description: 'Application name to test. E.g., eox-tenant.'
required: true
tutor_version:
description: 'The tutor version matrix to use.'
required: false
shell_file_to_run:
description: 'The path of the shell file to run the integration tests.'
required: false

runs:
using: 'composite'
steps:
- name: Run integration test in Tutor
run: |
echo "##[group]Prepare Tutor and Launch"
pip install "tutor$INPUT_TUTOR_VERSION"
TUTOR_ROOT="$(pwd)" tutor --version
TUTOR_ROOT="$(pwd)" tutor config save
TUTOR_ROOT="$(pwd)" tutor mounts add lms,cms,lms-worker,cms-worker:$(pwd)/$INPUT_PATH:/openedx/$INPUT_PATH
chmod 777 . -R
TUTOR_ROOT="$(pwd)" tutor local launch -I
echo "##[endgroup]"
# Check if shell file is set and not empty
if [ -n $INPUT_SHELL_FILE ]; then
echo "##[group]Run integration tests in lms"
TUTOR_ROOT="$(pwd)" tutor local run lms bash $INPUT_SHELL_FILE
echo "##[endgroup]"
fi
shell: bash
env:
INPUT_PATH: ${{ inputs.app_name }}
INPUT_TUTOR_VERSION: ${{ inputs.tutor_version }}
INPUT_SHELL_FILE: /openedx/${{ inputs.app_name }}/${{ inputs.shell_file_to_run }}
8 changes: 6 additions & 2 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@ on: [pull_request]
jobs:
integration-test:
runs-on: ubuntu-latest
strategy:
matrix:
tutor_version: ["<17.0.0", "<18.0.0"]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: eduNEXT/integration-test-in-tutor@mfmz/github-action
- uses: ./.github/actions/integration-test
with:
path: "eox-hooks"
tutor_version: ${{ matrix.tutor_version }}
app_name: "eox-hooks"
shell_file_to_run: "eox_hooks/tests/integration.sh"

0 comments on commit dba27f1

Please sign in to comment.