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:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Pull images
|
- name: Robot cache
|
||||||
run: |
|
uses: actions/setup-python@v4
|
||||||
cp .env.example .env
|
with:
|
||||||
docker compose version
|
python-version: '3.9'
|
||||||
docker compose pull
|
cache: 'pip'
|
||||||
|
|
||||||
|
- name: Install robot
|
||||||
|
run: pip install -r requirements.txt
|
||||||
|
|
||||||
- name: Docker cache
|
- name: Docker cache
|
||||||
uses: satackey/action-docker-layer-caching@v0.0.11
|
uses: satackey/action-docker-layer-caching@v0.0.11
|
||||||
@ -26,18 +29,18 @@ jobs:
|
|||||||
|
|
||||||
- name: Start the service
|
- name: Start the service
|
||||||
run: |
|
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
|
- name: Perform healthchecks
|
||||||
run: |
|
run: |
|
||||||
docker compose ps -a
|
docker compose ps -a
|
||||||
docker compose logs
|
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
|
- name: Run robot tests
|
||||||
run: |
|
run: |
|
||||||
pip install -r back/tests/robot/requirements.txt
|
robot -d out $(find -type d -name robot)
|
||||||
robot -d out back/tests/robot/
|
|
||||||
|
|
||||||
- name: Show logs
|
- name: Show logs
|
||||||
if: failure()
|
if: failure()
|
||||||
|
@ -7,7 +7,8 @@ RUN go install github.com/swaggo/swag/cmd/swag@latest
|
|||||||
COPY go.mod go.sum ./
|
COPY go.mod go.sum ./
|
||||||
RUN go mod download
|
RUN go mod download
|
||||||
|
|
||||||
COPY sqlc.yaml sql ./
|
COPY sqlc.yaml ./
|
||||||
|
COPY sql ./sql
|
||||||
RUN sqlc generate
|
RUN sqlc generate
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
@ -79,6 +79,7 @@ func OpenDatabase() (*pgxpool.Pool, error) {
|
|||||||
config.ConnConfig.RuntimeParams["search_path"] = schema
|
config.ConnConfig.RuntimeParams["search_path"] = schema
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fmt.Printf("Connecting to database with %v\n", config)
|
||||||
db, err := pgxpool.NewWithConfig(ctx, config)
|
db, err := pgxpool.NewWithConfig(ctx, config)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf("Could not connect to database, check your env variables!")
|
fmt.Printf("Could not connect to database, check your env variables!")
|
||||||
@ -143,7 +144,7 @@ func main() {
|
|||||||
|
|
||||||
db, err := OpenDatabase()
|
db, err := OpenDatabase()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
e.Logger.Fatal("Could not open databse: %v", err)
|
e.Logger.Fatal("Could not open databse: ", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -152,7 +153,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
conf, err := LoadConfiguration(h.db)
|
conf, err := LoadConfiguration(h.db)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
e.Logger.Fatal("Could not load configuration: %v", err)
|
e.Logger.Fatal("Could not load configuration: ", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
h.config = conf
|
h.config = conf
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
*** Settings ***
|
*** Settings ***
|
||||||
Documentation Common things to handle rest requests
|
Documentation Common things to handle rest requests
|
||||||
|
|
||||||
Library REST http://localhost:8901/api
|
Library REST http://localhost:8901/auth
|
||||||
|
|
||||||
|
|
||||||
*** Keywords ***
|
*** Keywords ***
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
*** Settings ***
|
*** Settings ***
|
||||||
Documentation Tests of the /sessions route.
|
Documentation Tests of the /sessions route.
|
||||||
|
|
||||||
Resource ../auth.resource
|
Resource ./auth.resource
|
||||||
|
|
||||||
|
|
||||||
*** Test Cases ***
|
*** Test Cases ***
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
Documentation Tests of the /users route.
|
Documentation Tests of the /users route.
|
||||||
... Ensures that the user can authenticate on kyoo.
|
... Ensures that the user can authenticate on kyoo.
|
||||||
|
|
||||||
Resource ../auth.resource
|
Resource ./auth.resource
|
||||||
|
|
||||||
|
|
||||||
*** Test Cases ***
|
*** Test Cases ***
|
||||||
|
@ -60,6 +60,23 @@ services:
|
|||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
- "traefik.http.routers.front.rule=PathPrefix(`/`)"
|
- "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:
|
scanner:
|
||||||
build: ./scanner
|
build: ./scanner
|
||||||
restart: on-failure
|
restart: on-failure
|
||||||
|
Loading…
x
Reference in New Issue
Block a user