1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/runner.git synced 2025-08-26 18:20:59 +00:00

add a negative health check test case

This commit is contained in:
Mathieu Fenniak 2025-08-05 20:32:52 -06:00
parent 018ae8ad3d
commit 12347b019d
2 changed files with 18 additions and 0 deletions

View file

@ -323,6 +323,7 @@ func TestRunner_RunEvent(t *testing.T) {
{workdir, "services", "push", "", platforms, secrets},
{workdir, "services-with-container", "push", "", platforms, secrets},
{workdir, "mysql-service-container-with-health-check", "push", "", platforms, secrets},
{workdir, "mysql-service-container-failed-health-check", "push", "service container NAME failed health check", platforms, secrets},
}
for _, table := range tables {

View file

@ -0,0 +1,17 @@
name: service-container
on: push
jobs:
service-container-test:
runs-on: ubuntu-latest
container: code.forgejo.org/oci/mysql:8.4
services:
maindb:
image: code.forgejo.org/oci/mysql:8.4
env:
MYSQL_DATABASE: dbname
MYSQL_USER: dbuser
MYSQL_PASSWORD: dbpass
MYSQL_RANDOM_ROOT_PASSWORD: yes
options: --health-cmd="exit 1" --health-interval=1s --health-timeout=5s --health-retries=3
steps:
- run: exit 100 # should never be hit since service will never be healthy