From ce106074dcfa15529e0dd2d5f989bc12dcc0152c Mon Sep 17 00:00:00 2001 From: xbgmsharp Date: Fri, 29 Dec 2023 18:26:22 +0100 Subject: [PATCH] Feat: Update tests for pre logbook check and grafana cron job support --- tests/sql/cron_post_jobs.sql.output | 4 ++-- tests/sql/cron_run_jobs.sql.output | 4 ++-- tests/tests.sh | 9 +++++++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/tests/sql/cron_post_jobs.sql.output b/tests/sql/cron_post_jobs.sql.output index 42baafb..c4952f3 100644 --- a/tests/sql/cron_post_jobs.sql.output +++ b/tests/sql/cron_post_jobs.sql.output @@ -27,7 +27,7 @@ duration | PT27M avg_speed | 3.6357142857142852 max_speed | 6.1 max_wind_speed | 22.1 -notes | new log note +notes | extra | {"metrics": {"propulsion.main.runTime": 10}, "observations": {"seaState": -1, "visibility": -1, "cloudCoverage": -1}} -[ RECORD 2 ]--+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- name | Norra hamnen to Ekenäs @@ -66,7 +66,7 @@ stay_code | 4 eventlogs_view -[ RECORD 1 ] -count | 11 +count | 14 stats_logs_fn SELECT 1 diff --git a/tests/sql/cron_run_jobs.sql.output b/tests/sql/cron_run_jobs.sql.output index 9c04985..df23479 100644 --- a/tests/sql/cron_run_jobs.sql.output +++ b/tests/sql/cron_run_jobs.sql.output @@ -6,11 +6,11 @@ You are now connected to database "signalk" as user "username". Expanded display is on. -[ RECORD 1 ] -jobs | 24 +jobs | 26 -[ RECORD 1 ]-+- run_cron_jobs | -[ RECORD 1 ]----+-- -any_pending_jobs | 0 +any_pending_jobs | 2 diff --git a/tests/tests.sh b/tests/tests.sh index 522c074..c300aa4 100644 --- a/tests/tests.sh +++ b/tests/tests.sh @@ -9,6 +9,11 @@ if [[ -z "${PGSAIL_API_URI}" ]]; then exit 1 fi +# psql +if [[ ! -x "/usr/bin/psql" ]]; then + apt update && apt -y install postgresql-client +fi + # go install if [[ ! -x "/usr/bin/go" || ! -x "/root/go/bin/mermerd" ]]; then #wget -q https://go.dev/dl/go1.21.4.linux-arm64.tar.gz && \ @@ -189,11 +194,11 @@ else fi # Generate and update mermaid schema documentation -/root/go/bin/mermerd --runConfig ../ERD/mermerdConfig.yaml +/root/go/bin/mermerd --runConfig ../docs/ERD/mermerdConfig.yaml echo $? echo 0 if [ $? -eq 0 ]; then - cp postgsail.md ../ERD/postgsail.md + cp postgsail.md ../docs/ERD/postgsail.md echo postgsail.md OK else echo postgsail.md FAILED