Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: GitHub Actions Workflow for Scheduled Morango Integration Tests #11931

Merged
merged 5 commits into from
Mar 6, 2024
Merged
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
90 changes: 90 additions & 0 deletions .github/workflows/morongo_integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Morango Integration Tests

on:
schedule:
- cron: '0 0 * * 0'

jobs:
morango_integration_tests_sqlite:
name: Morango Integration Tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9, '3.10', '3.11']

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Cache SQLite3
id: cache
uses: actions/cache@v3
with:
path: |
~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/test.txt', 'requirements/base.txt', 'requirements/cext.txt') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
pip install -r requirements/test.txt --upgrade
pip install -r requirements/base.txt --upgrade
pip install -r requirements/cext.txt --upgrade

- name: Run pre-test script
run: python test/patch_pytest.py

- name: Run tests with SQLite
run: python -O -m pytest kolibri/core/auth/test/test_morango_integration.py


morango_integration_tests_postgres:
name: Morango Integration Tests with PostgreSQL
runs-on: ubuntu-latest

services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: test
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
GarvitSinghal47 marked this conversation as resolved.
Show resolved Hide resolved

- name: Install dependencies
run: |
pip install -r requirements/test.txt --upgrade
pip install -r requirements/base.txt --upgrade
pip install -r requirements/cext.txt --upgrade
pip install -r requirements/postgres.txt --upgrade

- name: Run pre-test script
run: python test/patch_pytest.py

- name: Run tests with PostgreSQL
GarvitSinghal47 marked this conversation as resolved.
Show resolved Hide resolved
GarvitSinghal47 marked this conversation as resolved.
Show resolved Hide resolved
env:
KOLIBRI_DATABASE_ENGINE: postgres
KOLIBRI_DATABASE_NAME: test
KOLIBRI_DATABASE_USER: postgres
KOLIBRI_DATABASE_PASSWORD: postgres
KOLIBRI_DATABASE_HOST: localhost
KOLIBRI_DATABASE_PORT: 5432
run: python -O -m pytest kolibri/core/auth/test/test_morango_integration.py