The scheme tests run in the Gitlab-CI currently fail.
The tests are run after building the scheme. They use the schemathesis docker image to run the schemathesis tests against the running tank service.
For the tank service to run, we need a running postgres instance:
services:
- name: postgres:13
alias: postgres
The CI reports problems when starting the postgres container:
*** WARNING: Service runner-969a08f8-project-19-concurrent-0-54d87982bbee8fa0-postgres-0 probably didn't start properly.
Health check error:
service "runner-969a08f8-project-19-concurrent-0-54d87982bbee8fa0-postgres-0-wait-for-service" timeout
Health check container logs:
Service container logs:
2022-05-02T15:39:05.046461878Z The files belonging to this database system will be owned by user "postgres".
2022-05-02T15:39:05.046530488Z This user must also own the server process.
2022-05-02T15:39:05.046543940Z
2022-05-02T15:39:05.046673029Z The database cluster will be initialized with locale "en_US.utf8".
2022-05-02T15:39:05.046690669Z The default database encoding has accordingly been set to "UTF8".
2022-05-02T15:39:05.046701801Z The default text search configuration will be set to "english".
2022-05-02T15:39:05.046727574Z
2022-05-02T15:39:05.046739846Z Data page checksums are disabled.
2022-05-02T15:39:05.046750848Z
2022-05-02T15:39:05.046864779Z fixing permissions on existing directory /var/lib/postgresql/data ... ok
2022-05-02T15:39:05.048343143Z creating subdirectories ... ok
2022-05-02T15:39:05.048633531Z selecting dynamic shared memory implementation ... posix
2022-05-02T15:39:05.075908099Z selecting default max_connections ... 100
2022-05-02T15:39:05.109516191Z selecting default shared_buffers ... 128MB
2022-05-02T15:39:05.151665860Z selecting default time zone ... Etc/UTC
2022-05-02T15:39:05.154356413Z creating configuration files ... ok
2022-05-02T15:39:05.479483267Z running bootstrap script ... ok
2022-05-02T15:39:06.313641053Z performing post-bootstrap initialization ... ok
2022-05-02T15:39:44.207169257Z syncing data to disk ... ok
2022-05-02T15:39:44.207829110Z
2022-05-02T15:39:44.208628934Z initdb: warning: enabling "trust" authentication for local connections
2022-05-02T15:39:44.208661170Z You can change this by editing pg_hba.conf or using the option -A, or
2022-05-02T15:39:44.208673456Z --auth-local and --auth-host, the next time you run initdb.
2022-05-02T15:39:44.208766508Z
2022-05-02T15:39:44.208818037Z Success. You can now start the database server using:
2022-05-02T15:39:44.208836522Z
2022-05-02T15:39:44.208847837Z pg_ctl -D /var/lib/postgresql/data -l logfile start
2022-05-02T15:39:44.208859105Z
2022-05-02T15:39:44.840990485Z waiting for server to start....2022-05-02 15:39:44.840 UTC [47] LOG: starting PostgreSQL 13.6 (Debian 13.6-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
2022-05-02T15:39:45.167425091Z 2022-05-02 15:39:45.167 UTC [47] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2022-05-02T15:39:45.810071418Z .2022-05-02 15:39:45.809 UTC [48] LOG: database system was shut down at 2022-05-02 15:39:06 UTC
2022-05-02T15:39:45.992033326Z 2022-05-02 15:39:45.991 UTC [47] LOG: database system is ready to accept connections
2022-05-02T15:39:46.066304984Z done
2022-05-02T15:39:46.066523593Z server started
2022-05-02T15:39:55.467931943Z CREATE DATABASE
2022-05-02T15:39:55.469944949Z
2022-05-02T15:39:55.470146924Z
2022-05-02T15:39:55.470308064Z /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
2022-05-02T15:39:55.470327862Z
2022-05-02T15:39:55.473695319Z waiting for server to shut down....2022-05-02 15:39:55.473 UTC [47] LOG: received fast shutdown request
2022-05-02T15:39:55.657591708Z 2022-05-02 15:39:55.657 UTC [47] LOG: aborting any active transactions
2022-05-02T15:39:55.660578109Z 2022-05-02 15:39:55.660 UTC [47] LOG: background worker "logical replication launcher" (PID 54) exited with exit code 1
2022-05-02T15:39:55.662639890Z 2022-05-02 15:39:55.662 UTC [49] LOG: shutting down
2022-05-02T15:40:02.175118187Z ......2022-05-02 15:40:02.174 UTC [47] LOG: database system is shut down
2022-05-02T15:40:02.193409974Z done
2022-05-02T15:40:02.193443085Z server stopped
2022-05-02T15:40:02.193975863Z
2022-05-02T15:40:02.194043860Z PostgreSQL init process complete; ready for start up.
2022-05-02T15:40:02.194057106Z
2022-05-02T15:40:02.940635505Z 2022-05-02 15:40:02.940 UTC [1] LOG: starting PostgreSQL 13.6 (Debian 13.6-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
2022-05-02T15:40:02.940993251Z 2022-05-02 15:40:02.940 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
2022-05-02T15:40:02.941163603Z 2022-05-02 15:40:02.941 UTC [1] LOG: listening on IPv6 address "::", port 5432
2022-05-02T15:40:03.971454217Z 2022-05-02 15:40:03.971 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2022-05-02T15:40:04.901696507Z 2022-05-02 15:40:04.899 UTC [61] LOG: database system was shut down at 2022-05-02 15:40:00 UTC
2022-05-02T15:40:04.910448277Z 2022-05-02 15:40:04.902 UTC [63] FATAL: the database system is starting up
2022-05-02T15:40:05.512442111Z 2022-05-02 15:40:05.512 UTC [1] LOG: database system is ready to accept connections
*********
After starting the postgres-Container, tank should be run (there is only the image of the main branch so far). We figured out that we have to wait for the database to be ready to accept connections:
services:
- name: gitlab.servus.at:5050/aura/tank:master
entrypoint: ["/bin/bash"]
command:
- '-c'
- |
# make sure postgres is up before starting tank
while true; do
timeout 0.25 cat >/dev/null 2>&1 </dev/tcp/postgres/5432
if [ "$?" = 124 ]; then break; fi
done
# disable authentication
sed '/auth:/q' /etc/aura/tank.yaml | head -n-1 >/tmp/tank.yaml
/usr/local/bin/tank --config /tmp/tank.yaml run --listen :"$TANK_PORT"
alias: tank
Again, the CI reports problems:
*** WARNING: Service runner-969a08f8-project-19-concurrent-0-54d87982bbee8fa0-gitlab.servus.at__aura__tank-1 probably didn't start properly.
Health check error:
service "runner-969a08f8-project-19-concurrent-0-54d87982bbee8fa0-gitlab.servus.at__aura__tank-1-wait-for-service" timeout
Health check container logs:
Service container logs:
2022-05-02T15:40:03.348975829Z [ --- ] starting...
2022-05-02T15:40:03.349782108Z [ --- ] successfully read config file (/tmp/tank.yaml)
2022-05-02T15:40:03.350470948Z [ --- ] authentication: disabled - will allow any request!
2022-05-02T15:40:04.904520192Z gorm.open(): pq: the database system is starting up
*********
The config is working in a test setup within another GitLab instance. There have even been some successful runs in this instance.
@kmohrf guess was, that this is a DNS problem.
robwa (3e5b160c) at 25 Aug 17:58
fix: use correct scheme path
No, I don't know why I would want/ need this. I don't need a token, when I run the tests locally.
I fixed the schemathesis tests, there were two type errors.
And now we see an error that we never saw before (and I cannot reproduce this locally). At the moment I have no idea how to fix this.
robwa (04ceeff3) at 25 Aug 11:13
fix: do not allow tests to fail
robwa (eeefa5e8) at 25 Aug 10:46
fix: use fixed schemathesis version
robwa (ce6d7aa5) at 25 Aug 10:07
fix: type errors reported by schemathesis
The scheme tests run in the Gitlab-CI currently fail.
The tests are run after building the scheme. They use the schemathesis docker image to run the schemathesis tests against the running tank service.
For the tank service to run, we need a running postgres instance:
services:
- name: postgres:13
alias: postgres
The CI reports problems when starting the postgres container:
*** WARNING: Service runner-969a08f8-project-19-concurrent-0-54d87982bbee8fa0-postgres-0 probably didn't start properly.
Health check error:
service "runner-969a08f8-project-19-concurrent-0-54d87982bbee8fa0-postgres-0-wait-for-service" timeout
Health check container logs:
Service container logs:
2022-05-02T15:39:05.046461878Z The files belonging to this database system will be owned by user "postgres".
2022-05-02T15:39:05.046530488Z This user must also own the server process.
2022-05-02T15:39:05.046543940Z
2022-05-02T15:39:05.046673029Z The database cluster will be initialized with locale "en_US.utf8".
2022-05-02T15:39:05.046690669Z The default database encoding has accordingly been set to "UTF8".
2022-05-02T15:39:05.046701801Z The default text search configuration will be set to "english".
2022-05-02T15:39:05.046727574Z
2022-05-02T15:39:05.046739846Z Data page checksums are disabled.
2022-05-02T15:39:05.046750848Z
2022-05-02T15:39:05.046864779Z fixing permissions on existing directory /var/lib/postgresql/data ... ok
2022-05-02T15:39:05.048343143Z creating subdirectories ... ok
2022-05-02T15:39:05.048633531Z selecting dynamic shared memory implementation ... posix
2022-05-02T15:39:05.075908099Z selecting default max_connections ... 100
2022-05-02T15:39:05.109516191Z selecting default shared_buffers ... 128MB
2022-05-02T15:39:05.151665860Z selecting default time zone ... Etc/UTC
2022-05-02T15:39:05.154356413Z creating configuration files ... ok
2022-05-02T15:39:05.479483267Z running bootstrap script ... ok
2022-05-02T15:39:06.313641053Z performing post-bootstrap initialization ... ok
2022-05-02T15:39:44.207169257Z syncing data to disk ... ok
2022-05-02T15:39:44.207829110Z
2022-05-02T15:39:44.208628934Z initdb: warning: enabling "trust" authentication for local connections
2022-05-02T15:39:44.208661170Z You can change this by editing pg_hba.conf or using the option -A, or
2022-05-02T15:39:44.208673456Z --auth-local and --auth-host, the next time you run initdb.
2022-05-02T15:39:44.208766508Z
2022-05-02T15:39:44.208818037Z Success. You can now start the database server using:
2022-05-02T15:39:44.208836522Z
2022-05-02T15:39:44.208847837Z pg_ctl -D /var/lib/postgresql/data -l logfile start
2022-05-02T15:39:44.208859105Z
2022-05-02T15:39:44.840990485Z waiting for server to start....2022-05-02 15:39:44.840 UTC [47] LOG: starting PostgreSQL 13.6 (Debian 13.6-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
2022-05-02T15:39:45.167425091Z 2022-05-02 15:39:45.167 UTC [47] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2022-05-02T15:39:45.810071418Z .2022-05-02 15:39:45.809 UTC [48] LOG: database system was shut down at 2022-05-02 15:39:06 UTC
2022-05-02T15:39:45.992033326Z 2022-05-02 15:39:45.991 UTC [47] LOG: database system is ready to accept connections
2022-05-02T15:39:46.066304984Z done
2022-05-02T15:39:46.066523593Z server started
2022-05-02T15:39:55.467931943Z CREATE DATABASE
2022-05-02T15:39:55.469944949Z
2022-05-02T15:39:55.470146924Z
2022-05-02T15:39:55.470308064Z /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
2022-05-02T15:39:55.470327862Z
2022-05-02T15:39:55.473695319Z waiting for server to shut down....2022-05-02 15:39:55.473 UTC [47] LOG: received fast shutdown request
2022-05-02T15:39:55.657591708Z 2022-05-02 15:39:55.657 UTC [47] LOG: aborting any active transactions
2022-05-02T15:39:55.660578109Z 2022-05-02 15:39:55.660 UTC [47] LOG: background worker "logical replication launcher" (PID 54) exited with exit code 1
2022-05-02T15:39:55.662639890Z 2022-05-02 15:39:55.662 UTC [49] LOG: shutting down
2022-05-02T15:40:02.175118187Z ......2022-05-02 15:40:02.174 UTC [47] LOG: database system is shut down
2022-05-02T15:40:02.193409974Z done
2022-05-02T15:40:02.193443085Z server stopped
2022-05-02T15:40:02.193975863Z
2022-05-02T15:40:02.194043860Z PostgreSQL init process complete; ready for start up.
2022-05-02T15:40:02.194057106Z
2022-05-02T15:40:02.940635505Z 2022-05-02 15:40:02.940 UTC [1] LOG: starting PostgreSQL 13.6 (Debian 13.6-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
2022-05-02T15:40:02.940993251Z 2022-05-02 15:40:02.940 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
2022-05-02T15:40:02.941163603Z 2022-05-02 15:40:02.941 UTC [1] LOG: listening on IPv6 address "::", port 5432
2022-05-02T15:40:03.971454217Z 2022-05-02 15:40:03.971 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2022-05-02T15:40:04.901696507Z 2022-05-02 15:40:04.899 UTC [61] LOG: database system was shut down at 2022-05-02 15:40:00 UTC
2022-05-02T15:40:04.910448277Z 2022-05-02 15:40:04.902 UTC [63] FATAL: the database system is starting up
2022-05-02T15:40:05.512442111Z 2022-05-02 15:40:05.512 UTC [1] LOG: database system is ready to accept connections
*********
After starting the postgres-Container, tank should be run (there is only the image of the main branch so far). We figured out that we have to wait for the database to be ready to accept connections:
services:
- name: gitlab.servus.at:5050/aura/tank:master
entrypoint: ["/bin/bash"]
command:
- '-c'
- |
# make sure postgres is up before starting tank
while true; do
timeout 0.25 cat >/dev/null 2>&1 </dev/tcp/postgres/5432
if [ "$?" = 124 ]; then break; fi
done
# disable authentication
sed '/auth:/q' /etc/aura/tank.yaml | head -n-1 >/tmp/tank.yaml
/usr/local/bin/tank --config /tmp/tank.yaml run --listen :"$TANK_PORT"
alias: tank
Again, the CI reports problems:
*** WARNING: Service runner-969a08f8-project-19-concurrent-0-54d87982bbee8fa0-gitlab.servus.at__aura__tank-1 probably didn't start properly.
Health check error:
service "runner-969a08f8-project-19-concurrent-0-54d87982bbee8fa0-gitlab.servus.at__aura__tank-1-wait-for-service" timeout
Health check container logs:
Service container logs:
2022-05-02T15:40:03.348975829Z [ --- ] starting...
2022-05-02T15:40:03.349782108Z [ --- ] successfully read config file (/tmp/tank.yaml)
2022-05-02T15:40:03.350470948Z [ --- ] authentication: disabled - will allow any request!
2022-05-02T15:40:04.904520192Z gorm.open(): pq: the database system is starting up
*********
The config is working in a test setup within another GitLab instance. There have even been some successful runs in this instance.
@kmohrf guess was, that this is a DNS problem.
robwa (ed118b69) at 20 Apr 17:04
fix: Added variables as instructed by @root
@nnrcschmdt wants to look at this last missing part. Thank you!
Integrated passing schemathesis tests into CI with !6.
The next things to do here are
robwa (752135a8) at 31 Mar 18:49
robwa (00bebb97) at 28 Mar 12:39
feat: Use schemathesis to test scheme against tank build
... and 11 more commits
robwa (9ab5ebc4) at 24 Mar 14:30
fix: Specify enum value for API scheme