From 33e61f3277b6b55f5d2cdf3a36cb958ad8acb304 Mon Sep 17 00:00:00 2001 From: Ben Kochie Date: Sat, 27 Feb 2021 15:53:14 +0100 Subject: [PATCH] Add integration tests Setup integration test matrix in CircleCI. * Update README integration testing list. Signed-off-by: Ben Kochie --- .circleci/config.yml | 35 +++++++++++++++++++++++++++++++++++ README.md | 2 +- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 27d4c5a0..8280b7bf 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -20,6 +20,30 @@ jobs: - prometheus/store_artifact: file: postgres_exporter + integration: + docker: + - image: circleci/golang:1.15 + - image: << parameters.postgres_image >> + environment: + POSTGRES_DB: circle_test + POSTGRES_USER: postgres + POSTGRES_PASSWORD: test + + parameters: + postgres_image: + type: string + + environment: + DATA_SOURCE_NAME: 'postgresql://postgres:test@localhost:5432/circle_test?sslmode=disable' + GOOPTS: '-v -tags integration' + + steps: + - checkout + - setup_remote_docker + - run: docker version + - run: make build + - run: make test + workflows: version: 2 postgres_exporter: @@ -28,6 +52,17 @@ workflows: filters: tags: only: /.*/ + - integration: + matrix: + parameters: + postgres_image: + - circleci/postgres:9.4 + - circleci/postgres:9.5 + - circleci/postgres:9.6 + - circleci/postgres:10 + - circleci/postgres:11 + - circleci/postgres:12 + - circleci/postgres:13 - prometheus/build: name: build filters: diff --git a/README.md b/README.md index 77180891..70ffa1c0 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Prometheus exporter for PostgreSQL server metrics. -CI Tested PostgreSQL versions: `9.4`, `9.5`, `9.6`, `10`, `11` +CI Tested PostgreSQL versions: `9.4`, `9.5`, `9.6`, `10`, `11`, `12`, `13` ## Quick Start This package is available for Docker: