kopia lustrzana https://github.com/ihabunek/toot
integration-tests
rodzic
9baa0823f9
commit
cae231eddf
|
@ -4,12 +4,21 @@ on: [push, pull_request]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
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:
|
strategy:
|
||||||
matrix:
|
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:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
@ -17,17 +26,28 @@ jobs:
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
- name: Install dependencies
|
- name: Install Mastodon
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
wget https://github.com/mastodon/mastodon/archive/refs/tags/v4.1.0.zip
|
||||||
pip install -e .
|
unzip v4.1.0.zip
|
||||||
pip install -r requirements-test.txt
|
cd mastodon-4.1.0
|
||||||
- name: Run tests
|
ls -al
|
||||||
run: |
|
- name: Run integration tests
|
||||||
pytest
|
env:
|
||||||
- name: Validate minimum required version
|
TOOT_TEST_HOSTNAME: localhost:3000
|
||||||
run: |
|
TOOT_TEST_DATABASE_DSN: dbname=mastodon_development
|
||||||
vermin --target=3.6 --no-tips .
|
|
||||||
- name: Check style
|
# - name: Install dependencies
|
||||||
run: |
|
# run: |
|
||||||
flake8
|
# 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
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
- [Contributing](contributing.md)
|
- [Contributing](contributing.md)
|
||||||
- [Documentation](documentation.md)
|
- [Documentation](documentation.md)
|
||||||
- [Release procedure](release.md)
|
- [Release procedure](release.md)
|
||||||
|
- [Running tests](testing.md)
|
||||||
- [Changelog](changelog.md)
|
- [Changelog](changelog.md)
|
||||||
|
|
||||||
[License](license.md)
|
[License](license.md)
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue