1
0
mirror of https://github.com/ihabunek/toot.git synced 2024-11-03 04:17:21 -05:00
This commit is contained in:
Ivan Habunek 2023-03-08 14:17:06 +01:00
parent 9baa0823f9
commit cae231eddf
No known key found for this signature in database
GPG Key ID: CDBD63C43A30BB95
3 changed files with 54 additions and 17 deletions

View File

@ -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

View File

@ -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 Normal file
View File

@ -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