mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
Robot tests wip
This commit is contained in:
parent
8b1cf61209
commit
662457d0f1
21
.github/workflows/robot.yml
vendored
21
.github/workflows/robot.yml
vendored
@ -14,11 +14,14 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Pull images
|
||||
run: |
|
||||
cp .env.example .env
|
||||
docker compose version
|
||||
docker compose pull
|
||||
- name: Robot cache
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.9'
|
||||
cache: 'pip'
|
||||
|
||||
- name: Install robot
|
||||
run: pip install -r requirements.txt
|
||||
|
||||
- name: Docker cache
|
||||
uses: satackey/action-docker-layer-caching@v0.0.11
|
||||
@ -26,18 +29,18 @@ jobs:
|
||||
|
||||
- name: Start the service
|
||||
run: |
|
||||
docker compose up -d back postgres traefik meilisearch --wait
|
||||
cp .env.example .env
|
||||
docker compose -f docker-compose.build.yml up -d auth postgres traefik --wait
|
||||
|
||||
- name: Perform healthchecks
|
||||
run: |
|
||||
docker compose ps -a
|
||||
docker compose logs
|
||||
wget --retry-connrefused --retry-on-http-error=502 http://localhost:8901/api/health || (docker compose logs && exit 1)
|
||||
# wget --retry-connrefused --retry-on-http-error=502 http://localhost:8901/api/health || (docker compose logs && exit 1)
|
||||
|
||||
- name: Run robot tests
|
||||
run: |
|
||||
pip install -r back/tests/robot/requirements.txt
|
||||
robot -d out back/tests/robot/
|
||||
robot -d out $(find -type d -name robot)
|
||||
|
||||
- name: Show logs
|
||||
if: failure()
|
||||
|
@ -7,7 +7,8 @@ RUN go install github.com/swaggo/swag/cmd/swag@latest
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
COPY sqlc.yaml sql ./
|
||||
COPY sqlc.yaml ./
|
||||
COPY sql ./sql
|
||||
RUN sqlc generate
|
||||
|
||||
COPY . .
|
||||
|
@ -79,6 +79,7 @@ func OpenDatabase() (*pgxpool.Pool, error) {
|
||||
config.ConnConfig.RuntimeParams["search_path"] = schema
|
||||
}
|
||||
|
||||
fmt.Printf("Connecting to database with %v\n", config)
|
||||
db, err := pgxpool.NewWithConfig(ctx, config)
|
||||
if err != nil {
|
||||
fmt.Printf("Could not connect to database, check your env variables!")
|
||||
@ -143,7 +144,7 @@ func main() {
|
||||
|
||||
db, err := OpenDatabase()
|
||||
if err != nil {
|
||||
e.Logger.Fatal("Could not open databse: %v", err)
|
||||
e.Logger.Fatal("Could not open databse: ", err)
|
||||
return
|
||||
}
|
||||
|
||||
@ -152,7 +153,7 @@ func main() {
|
||||
}
|
||||
conf, err := LoadConfiguration(h.db)
|
||||
if err != nil {
|
||||
e.Logger.Fatal("Could not load configuration: %v", err)
|
||||
e.Logger.Fatal("Could not load configuration: ", err)
|
||||
return
|
||||
}
|
||||
h.config = conf
|
||||
|
@ -1,7 +1,7 @@
|
||||
*** Settings ***
|
||||
Documentation Common things to handle rest requests
|
||||
|
||||
Library REST http://localhost:8901/api
|
||||
Library REST http://localhost:8901/auth
|
||||
|
||||
|
||||
*** Keywords ***
|
||||
|
@ -1,7 +1,7 @@
|
||||
*** Settings ***
|
||||
Documentation Tests of the /sessions route.
|
||||
|
||||
Resource ../auth.resource
|
||||
Resource ./auth.resource
|
||||
|
||||
|
||||
*** Test Cases ***
|
||||
|
@ -2,7 +2,7 @@
|
||||
Documentation Tests of the /users route.
|
||||
... Ensures that the user can authenticate on kyoo.
|
||||
|
||||
Resource ../auth.resource
|
||||
Resource ./auth.resource
|
||||
|
||||
|
||||
*** Test Cases ***
|
||||
|
@ -60,6 +60,23 @@ services:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.front.rule=PathPrefix(`/`)"
|
||||
|
||||
auth:
|
||||
build: ./auth
|
||||
restart: on-failure
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
env_file:
|
||||
- ./.env
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.auth.rule=PathPrefix(`/auth/`)"
|
||||
- "traefik.http.routers.auth.middlewares=auth-sp"
|
||||
- "traefik.http.middlewares.auth-sp.stripprefix.prefixes=/auth"
|
||||
- "traefik.http.middlewares.auth-sp.stripprefix.forceSlash=false"
|
||||
profiles:
|
||||
- "v5"
|
||||
|
||||
scanner:
|
||||
build: ./scanner
|
||||
restart: on-failure
|
||||
|
Loading…
x
Reference in New Issue
Block a user