Skip to content

Commit

Permalink
Merge branch 'release-v0.8.13'
Browse files Browse the repository at this point in the history
  • Loading branch information
SamR1 committed Dec 29, 2024
2 parents 1d13bdf + d4c827f commit dbcc99a
Show file tree
Hide file tree
Showing 160 changed files with 9,431 additions and 7,598 deletions.
6 changes: 5 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
.coverage
.eslintcache
docker-compose-dev.yml
docker-compose.yml
Makefile.custom.config
*.log
data
data

**/__pycache__/
**/*.py[cod]
4 changes: 2 additions & 2 deletions .env.docker → .env.docker.dev
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ export FLASK_SKIP_DOTENV=1
export APP_SETTINGS=fittrackee.config.DevelopmentConfig
export APP_SECRET_KEY='just for test'
# export APP_WORKERS=
export APP_LOG=fittrackee.log
export UPLOAD_FOLDER=/usr/src/app/uploads
export APP_LOG=/usr/src/app/data/logs/fittrackee.log
export UPLOAD_FOLDER=/usr/src/app/data/uploads

# PostgreSQL
export DATABASE_URL=postgresql://fittrackee:fittrackee@fittrackee-db:5432/fittrackee
Expand Down
44 changes: 44 additions & 0 deletions .env.docker.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Custom variables initialisation

# Docker volumes
# export UPLOAD_DIR=
# export LOG_DIR=
# export DATABASE_DIR=
# export REDIS_DIR=

# Application
export FLASK_APP=fittrackee
export FLASK_SKIP_DOTENV=1
# export APP_PORT=5000
export APP_SECRET_KEY='PLEASE CHANGE ME'
export APP_LOG=/usr/src/app/logs/fittrackee.log
export UPLOAD_FOLDER=/usr/src/app/uploads

# PostgreSQL
export POSTGRES_USER=fittrackee
export POSTGRES_PASSWORD=
export POSTGRES_DB=fittrackee
export DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@fittrackee-db:5432/${POSTGRES_DB}
# export DATABASE_DISABLE_POOLING=

# Redis (required for API rate limits and email sending)
export REDIS_URL=redis://redis:6379

# API rate limits
# export API_RATE_LIMITS="300 per 5 minutes"

# Emails
export UI_URL=
export EMAIL_URL=
export SENDER_EMAIL=

# Workouts
# export TILE_SERVER_URL=
# export STATICMAP_SUBDOMAINS=
# export MAP_ATTRIBUTION=
# export DEFAULT_STATICMAP=False

# Weather
# available weather API providers: visualcrossing
# export WEATHER_API_PROVIDER=
# export WEATHER_API_KEY=
85 changes: 85 additions & 0 deletions .github/workflows/.e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
on:
workflow_call:
inputs:
python-version:
type: string
default: 3.13
postgres-version:
type: string
default: 17
previous-version:
type: boolean
default: false

jobs:
test_package:
runs-on: ubuntu-latest
container: python:${{ inputs.python-version }}
services:
postgres:
image: postgres:${{ inputs.postgres-version }}
env:
POSTGRES_DB: fittrackee_test
POSTGRES_USER: fittrackee
POSTGRES_PASSWORD: fittrackee
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
selenium:
image: selenium/standalone-firefox
mailhog:
image: mailhog/mailhog:latest
redis:
image: redis:latest
env:
APP_SETTINGS: fittrackee.config.End2EndTestingConfig
DATABASE_TEST_URL: "postgresql://fittrackee:fittrackee@postgres:5432/fittrackee_test"
FLASK_APP: fittrackee
EMAIL_URL: "smtp://mailhog:1025"
REDIS_URL: "redis://redis:6379"
HOST: "0.0.0.0"
PORT: 5000
SENDER_EMAIL: fittrackee@example.com
steps:

- uses: actions/checkout@v4
with:
persist-credentials: false

- name: Install previous version of FitTrackee from PyPI
if: inputs.python-version.previous-version
run: python3 -m pip install fittrackee

- name: Run migrations
if: inputs.python-version.previous-version
run: ftcli db upgrade

- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/

- name: Create and source virtual environment
run: |
python3 -m venv .venv
. .venv/bin/activate
- name: Install fittrackee package
run: python3 -m pip install dist/fittrackee-$(cat VERSION).tar.gz

- name: Run migrations
run: ftcli db upgrade

- name: Install pytest and selenium
run: python3 -m pip install pytest==8.2.0 pytest-selenium==4.1.0 selenium==4.20.0 pytest-html==4.1.1

- name: Start application and run tests with Selenium
run: |
setsid nohup fittrackee >> nohup.out 2>&1 &
export TEST_APP_URL=http://$(hostname --ip-address):5000
sleep 5
nohup flask worker --processes=1 >> nohup.out 2>&1 &
pytest e2e --driver Remote --capability browserName firefox --selenium-host selenium --selenium-port 4444 --maxfail=1
Loading

0 comments on commit dbcc99a

Please sign in to comment.