integration-tests
Ivan Habunek 2023-03-08 14:17:06 +01:00
rodzic 9baa0823f9
commit cae231eddf
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: CDBD63C43A30BB95
3 zmienionych plików z 54 dodań i 17 usunięć

Wyświetl plik

@ -4,12 +4,21 @@ on: [push, pull_request]
jobs:
test:
# Older Ubuntu required for testing on Python 3.6 which is not available in
# later versions. Remove once support for 3.6 is dropped.
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.11"]
# https://docs.github.com/en/actions/using-containerized-services/creating-postgresql-service-containers
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
@ -17,17 +26,28 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
- name: Install Mastodon
run: |
python -m pip install --upgrade pip
pip install -e .
pip install -r requirements-test.txt
- name: Run tests
run: |
pytest
- name: Validate minimum required version
run: |
vermin --target=3.6 --no-tips .
- name: Check style
run: |
flake8
wget https://github.com/mastodon/mastodon/archive/refs/tags/v4.1.0.zip
unzip v4.1.0.zip
cd mastodon-4.1.0
ls -al
- name: Run integration tests
env:
TOOT_TEST_HOSTNAME: localhost:3000
TOOT_TEST_DATABASE_DSN: dbname=mastodon_development
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install -e .
# pip install -r requirements-test.txt
# - name: Run tests
# run: |
# pytest
# - name: Validate minimum required version
# run: |
# vermin --target=3.6 --no-tips .
# - name: Check style
# run: |
# flake8

Wyświetl plik

@ -9,6 +9,7 @@
- [Contributing](contributing.md)
- [Documentation](documentation.md)
- [Release procedure](release.md)
- [Running tests](testing.md)
- [Changelog](changelog.md)
[License](license.md)

16
docs/testing.md 100644
Wyświetl plik

@ -0,0 +1,16 @@
Running tests
=============
Run unit tests by just invoking:
```
pytest
```
However, many tests are implemented as integration tests which require a local
mastodon instance to be running.
## Setting up a test mastodon instance