mirror of
https://gitlab.rlp.net/proj-wise2526-video2document/video2document.git
synced 2026-06-15 18:01:52 +02:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5e5be60982 | |||
| bd7942f9ce | |||
| d1daad1146 | |||
| 978a1ab7de | |||
| fb173a4041 | |||
| b70680e950 | |||
| a069452f87 | |||
| fd4d342eeb | |||
| 70221683c3 | |||
| a92e33fa59 | |||
| 0dc2ebe99c | |||
| a0fe1a80e3 |
+48
-4
@@ -1,6 +1,50 @@
|
||||
build-job:
|
||||
workflow:
|
||||
rules:
|
||||
# Run the pipeline for merge requests or when committing to a branch
|
||||
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
||||
- if: $CI_COMMIT_BRANCH
|
||||
|
||||
image: python:3.14.0
|
||||
|
||||
stages:
|
||||
- setup
|
||||
- test
|
||||
|
||||
# -------- SETUP STAGE --------
|
||||
setup_environment:
|
||||
stage: setup
|
||||
script:
|
||||
- echo "Building the Project.."
|
||||
test-job:
|
||||
- echo "🔧 Setting up environment..."
|
||||
- pip install --upgrade pip
|
||||
- pip install -r requirements.txt
|
||||
- echo "✅ Dependencies installed successfully."
|
||||
|
||||
only:
|
||||
- main
|
||||
- feature/ci-pipeline-s1-09a-1 # Add more branches if needed
|
||||
|
||||
# -------- TEST APP FOLDER --------
|
||||
test_app:
|
||||
stage: test
|
||||
script:
|
||||
- echo "Running Tests.."
|
||||
- echo "🧪 Running tests in app folder..."
|
||||
- python -m unittest discover app || echo "⚠️ No tests found in app folder."
|
||||
- echo "✅ App folder test completed successfully."
|
||||
|
||||
only:
|
||||
- main
|
||||
- feature/ci-pipeline-s1-09a-1
|
||||
|
||||
# -------- TEST TEST FOLDER --------
|
||||
test_test_folder:
|
||||
stage: test
|
||||
script:
|
||||
- echo "🧪 Running tests in test folder..."
|
||||
- python -m unittest discover test || echo "⚠️ No tests found in test folder."
|
||||
- echo "✅ Test folder test completed successfully."
|
||||
|
||||
only:
|
||||
- main
|
||||
- feature/ci-pipeline-s1-09a-1
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
from fastapi import FastAPI
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
@app.get("/health")
|
||||
def health_check():
|
||||
return {"status": "ok"}
|
||||
@@ -0,0 +1,3 @@
|
||||
fastapi
|
||||
uvicorn
|
||||
pytest
|
||||
@@ -0,0 +1,8 @@
|
||||
from fastapi.testclient import TestClient
|
||||
from app.main import app
|
||||
|
||||
client = TestClient(app)
|
||||
|
||||
def test_health():
|
||||
response = client.get("/health")
|
||||
assert response.status_code == 200
|
||||
Reference in New Issue
Block a user