Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
2b26ea2
setting up the branch
GioeleB00 Jul 3, 2025
9e48446
minor correction
GioeleB00 Jul 3, 2025
7a0f860
minor changes
GioeleB00 Jul 3, 2025
1ab21d5
improved script for linux
GioeleB00 Jul 3, 2025
2a4675f
minor change
GioeleB00 Jul 3, 2025
91c0a7e
Delete docker_fs/.env.dev
GioeleB00 Jul 4, 2025
ab6c48a
Delete docker_fs/.env.test
GioeleB00 Jul 4, 2025
c06166b
Features/event generator (#1)
GioeleB00 Jul 6, 2025
86501f9
minor changes
GioeleB00 Jul 6, 2025
4a7081e
Merge branch 'develop' of github.com:GioeleB00/FastSim-backend into d…
GioeleB00 Jul 6, 2025
5c6f5db
Features/event generator documentation test improvements (#2)
GioeleB00 Jul 10, 2025
d43c915
README update
GioeleB00 Jul 10, 2025
02b4756
Improved constants management
GioeleB00 Jul 10, 2025
6f06bb7
Clean and refactor
GioeleB00 Jul 11, 2025
ee5d202
Features/request handler endpoint input (#3)
GioeleB00 Jul 13, 2025
953e318
Features/definition full payload simulation (#4)
GioeleB00 Jul 15, 2025
35d507e
Features/rqs generator runtime (#5)
GioeleB00 Jul 18, 2025
13d31d6
Features/client server runtime (#6)
GioeleB00 Jul 24, 2025
2686845
Features/metric sampler and collection (#7)
GioeleB00 Jul 29, 2025
7f1f7de
Features/metrics elaboration (#8)
GioeleB00 Aug 1, 2025
84f9897
Features/load balancer node (#9)
GioeleB00 Aug 3, 2025
7649866
Features/simulation runner (#10)
GioeleB00 Aug 6, 2025
d6ff9f6
Features/integration tests unit tests (#11)
GioeleB00 Aug 8, 2025
90df33d
new readme and guide to build yaml
GioeleB00 Aug 8, 2025
43eb8c5
Update README.md
GioeleB00 Aug 8, 2025
2a306ac
Added pybuilder and unit tests (#12)
GioeleB00 Aug 13, 2025
0098453
Refactor/change project name plus docs improvement (#13)
GioeleB00 Aug 13, 2025
c900708
minor changes
GioeleB00 Aug 13, 2025
adcb9eb
Refactor/pypi preparation (#14)
GioeleB00 Aug 14, 2025
111cf7b
minor changes
GioeleB00 Aug 14, 2025
59b54b6
minor changes
GioeleB00 Aug 14, 2025
02951e6
Features/lb example and docs tutorial (#15)
GioeleB00 Aug 15, 2025
d77415e
sanity ci check
GioeleB00 Aug 15, 2025
de52d04
Ci for main (#16)
GioeleB00 Aug 17, 2025
fb08027
fixing a bug
GioeleB00 Aug 17, 2025
09d99dc
bug fixed
GioeleB00 Aug 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
*.sh text eol=lf
*.py text eol=lf
*.env text eol=lf
*.yml text eol=lf
# Unix-style line endings (LF)
*.sh text eol=lf
*.py text eol=lf
*.yml text eol=lf
*.yaml text eol=lf
*.toml text eol=lf
*.cfg text eol=lf
*.ini text eol=lf
Makefile text eol=lf

# PowerShell
*.ps1 text eol=crlf
56 changes: 4 additions & 52 deletions .github/workflows/ci-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,38 +55,19 @@ jobs:

# Unit-tests only (exclude integration markers)
- name: Run unit tests
env:
ENVIRONMENT: test
run: poetry run pytest -m "not integration" --disable-warnings



# Job 2 ─ Full validation (executed only on push events)
# --------------------------------------------------------------------------- #
# Includes everything from the quick job plus:
# • PostgreSQL service container
# • Alembic migrations
# • Integration tests
# • Multi-stage Docker build and health-check

full:
if: |
github.event_name == 'push' &&
github.ref == 'refs/heads/develop'
runs-on: ubuntu-latest

services:
postgres:
image: postgres:17
env:
POSTGRES_USER: ${{ secrets.DB_USER }}
POSTGRES_PASSWORD: ${{ secrets.DB_PASSWORD }}
POSTGRES_DB: ${{ secrets.DB_NAME }}
ports: ["5432:5432"]
options: >-
--health-cmd "pg_isready -U $POSTGRES_USER -d $POSTGRES_DB"
--health-interval 10s
--health-timeout 5s
--health-retries 5

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
Expand All @@ -108,41 +89,12 @@ jobs:
- name: Run mypy
run: poetry run mypy src

- name: Apply Alembic migrations
env:
ENVIRONMENT: test
DB_URL: postgresql+psycopg://${{ secrets.DB_USER }}:${{ secrets.DB_PASSWORD }}@localhost:5432/${{ secrets.DB_NAME }}
run: poetry run alembic upgrade head

- name: Run all tests
env:
ENVIRONMENT: test
DB_URL: postgresql+asyncpg://${{ secrets.DB_USER }}:${{ secrets.DB_PASSWORD }}@localhost:5432/${{ secrets.DB_NAME }}
run: |
poetry run pytest \
--cov=src --cov-report=term \
--disable-warnings

- name: Build Docker image
run: docker build --progress=plain -t backend:ci .


- name: Smoke test container
run: |
# partiamo con --network host così il container condivide la rete del runner
docker run -d \
--name backend_ci \
--network host \
-e ENVIRONMENT=test \
-e DB_URL=postgresql+asyncpg://${{ secrets.DB_USER }}:${{ secrets.DB_PASSWORD }}@localhost:5432/${{ secrets.DB_NAME }} \
backend:ci \
uvicorn app.main:app --host 0.0.0.0 --port 8000

for i in {1..10}; do
if curl --silent --fail http://localhost:8000/health; then
echo "✔ Health OK"; break
else
echo "Waiting…"; sleep 3
fi
done

docker stop backend_ci

51 changes: 51 additions & 0 deletions .github/workflows/ci-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: CI – Main Branch

on:
pull_request:
branches: [main]
workflow_dispatch:

concurrency:
group: ci-main-${{ github.ref }}
cancel-in-progress: true

env:
PYTHON_VERSION: "3.12"
MPLBACKEND: Agg
ASYNCFLOW_RUN_SYSTEM_TESTS: "1"

jobs:
all-checks:
runs-on: ubuntu-latest
timeout-minutes: 25

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pip'

- uses: actions/cache@v3
with:
path: ~/.cache/pypoetry
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}

- name: Install Poetry & deps
run: |
curl -sSL https://install.python-poetry.org | python3 -
export PATH="$HOME/.local/bin:$PATH"
poetry config virtualenvs.create false
poetry install --with dev --no-interaction

- name: Ruff (lint)
run: poetry run ruff check src tests

- name: MyPy (type-check)
run: poetry run mypy src tests

- name: All tests (unit + integration + system)
run: |
poetry run pytest \
--disable-warnings
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ pip-wheel-metadata/
venv/
ENV/
env/
docker_fs/.env
docker_fs/.env.*

# Poetry-specific
.cache/pypoetry/
Expand Down
50 changes: 0 additions & 50 deletions Dockerfile

This file was deleted.

Loading