mirror of
https://gitlab.rlp.net/proj-wise2526-video2document/video2document.git
synced 2026-06-15 18:01:52 +02:00
Merge branch 'feature/ci-pipeline-s1-09a-1' into 'develop'
Feature/ci pipeline s1 09a 1 See merge request proj-wise2526-video2document/video2document!7
This commit is contained in:
+31
-4
@@ -1,6 +1,33 @@
|
|||||||
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_environment:
|
||||||
|
stage: setup
|
||||||
script:
|
script:
|
||||||
- echo "Building the Project.."
|
- pip install --upgrade pip
|
||||||
test-job:
|
- pip install -r requirements.txt
|
||||||
|
- echo "Dependencies installed successfully."
|
||||||
|
|
||||||
|
only:
|
||||||
|
- main
|
||||||
|
- feature/ci-pipeline-s1-09a-1 # You can add more branches if needed
|
||||||
|
|
||||||
|
test_app:
|
||||||
|
stage: test
|
||||||
script:
|
script:
|
||||||
- echo "Running Tests.."
|
- echo "Running V2D Framework basic test..."
|
||||||
|
- python -m unittest discover || echo "No tests found."
|
||||||
|
|
||||||
|
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