Skip to content

db.model schema - string column without size to default to length 255 #234

db.model schema - string column without size to default to length 255

db.model schema - string column without size to default to length 255 #234

name: Run Python Tests
on:
pull_request
jobs:
build:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.0
ports:
- 3306:3306
env:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: testdb
MYSQL_USER: testuser
MYSQL_PASSWORD: testpassword
steps:
- uses: actions/checkout@v2
- name: Install Python 3
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install poetry
pip --version
poetry --version
# Check if poetry lock file is current with pyproject.toml
poetry check --lock
poetry install --with=dev
- name: Run arxiv-base tests with coverage
run: poetry run pytest --cov=arxiv.base fourohfour --cov-fail-under=67 arxiv/base fourohfour
# - name: Check Types
# TODO The types are in bad shape and need to be fixed
# run: poetry run mypy --exclude "test*" -p arxiv
- name: Install Firefox ESR, test driver, mysqladmin
run: |
sudo add-apt-repository -y ppa:mozillateam/ppa
sudo apt update
sudo apt install -y firefox-esr mysql-client-core-8.0
wget https://github.com/mozilla/geckodriver/releases/latest/download/geckodriver-v0.35.0-linux64.tar.gz
tar -xvzf geckodriver-v0.35.0-linux64.tar.gz
sudo mv geckodriver /usr/local/bin/
sudo chmod +x /usr/local/bin/geckodriver
- name: Wait for MySQL to be ready
run: |
until mysqladmin ping --host=127.0.0.1 --user=testuser --password=testpassword --silent; do
echo "Waiting for MySQL to be ready..."
sleep 2
done
- name: Run other tests
# These tests are split out because their coverage is low
env:
TEST_ARXIV_DB_URI: mysql://testuser:testpassword@127.0.0.1/testdb
run: poetry run pytest --cov=arxiv --cov-fail-under=25 arxiv
#- name: Check Doc Style
# run: poetry run pydocstyle --convention=numpy --add-ignore=D401 arxiv
- name: Run App Tests
run: poetry run python tests/run_app_tests.py