Add query test script and test mode

* Add a mode to test all metric queries

* Add a script to run query tests against different versions of
  PostgeSQL

* Add Docker elements for query testing

* Switch to using a --config flag when specifying the config file

* Fix some metric queries

* Allow the agent address to be configured

* Allow the sslmode connection parameter to be configured
This commit is contained in:
2025-05-22 14:53:25 -04:00
parent 529bef9679
commit c0e1531083
11 changed files with 174 additions and 108 deletions

22
tests/Dockerfile Normal file
View File

@@ -0,0 +1,22 @@
FROM alpine:3.21
RUN apk update && \
apk add py3-psycopg2 \
py3-yaml \
tini
WORKDIR /app
COPY src/pgmon.py /app/
COPY sample-config/pgmon-metrics.yml /app/
COPY tests/test-config.yml /app/
COPY --chmod=0600 --chown=postgres:postgres tests/pgpass /root/.pgpass
ENTRYPOINT ["tini", "--"]
EXPOSE 5400
CMD ["/app/pgmon.py", "-c", "/app/test-config.yml", "--test"]