Skip to content

Integration Tests #1054

Integration Tests

Integration Tests #1054

name: Integration Tests
on:
push:
pull_request:
schedule:
- cron: '0 0 * * 0' # weekly
jobs:
# Label of the container job
container-job:
# Containers must run in Linux based operating systems
runs-on: ubuntu-latest
# Docker Hub image that `container-job` executes in
container: ubuntu:22.04
# Service containers to run with `container-job`
services:
# Label used to access the service container
consul:
image: hashicorp/consul
ports:
- 8500:8500
etcd:
image: quay.io/coreos/etcd:v3.5.13
ports:
- 2379:2379
env:
ETCD_LISTEN_CLIENT_URLS: http://0.0.0.0:2379
ETCD_ADVERTISE_CLIENT_URLS: http://0.0.0.0:2379
localstack:
image: localstack/localstack
ports:
- 4566:4566
env:
SERVICES: dynamodb,ssm
redis:
image: redis
# Set health checks to wait until redis has started
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
vault:
image: hashicorp/vault
ports:
- 8200:8200
env:
VAULT_DEV_ROOT_TOKEN_ID: "super-secret-token"
zookeeper:
image: zookeeper
ports:
- 2181:2181
env:
ZOO_STANDALONE_ENABLED: true
steps:
- name: Install dependencies
run: |
apt-get -q update
DEBIAN_FRONTEND="noninteractive" apt-get install -y git curl make redis-tools sudo awscli gnupg2 lsb-release etcd-client
echo "deb [arch=$(dpkg --print-architecture)] https://apt.releases.hashicorp.com $(lsb_release -cs) main" >> /etc/apt/sources.list
curl -fsSL https://apt.releases.hashicorp.com/gpg | apt-key add -
apt-get -q update
DEBIAN_FRONTEND="noninteractive" apt-get install -y vault
# Downloads a copy of the code in your repository before running CI tests
- name: Check out repository code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.21.6
- name: Build and Install
run: |
git config --global --add safe.directory /__w/confd/confd
make build
sudo make install
- name: Test Env
run: |
test/integration/env/test.sh
test/integration/expect/check.sh
- name: Test File
run: |
test/integration/file/test_yaml.sh
test/integration/expect/check.sh
test/integration/file/test_json.sh
test/integration/expect/check.sh
- name: Test Consul
run: |
test/integration/consul/test.sh
test/integration/expect/check.sh
env:
CONSUL_HOST: consul
CONSUL_PORT: 8500
- name: Test etcd
run: |
test/integration/etcd/test.sh
test/integration/expect/check.sh
env:
ETCD_ENDPOINT: "http://etcd:2379"
- name: Test DynamoDB
run: |
test/integration/dynamodb/test.sh
test/integration/expect/check.sh
env:
AWS_ACCESS_KEY_ID: "test"
AWS_SECRET_ACCESS_KEY: "test"
AWS_REGION: "us-east-1"
AWS_DEFAULT_REGION: "us-east-1"
DYNAMODB_LOCAL: 1
DYNAMODB_ENDPOINT_URL: http://localstack:4566
- name: Test Redis
run: |
test/integration/redis/test.sh
test/integration/expect/check.sh
env:
REDIS_HOST: redis
REDIS_PORT: 6379
- name: Test SSM Parameter Store
run: |
test/integration/ssm/test.sh
test/integration/expect/check.sh
env:
AWS_ACCESS_KEY_ID: "test"
AWS_SECRET_ACCESS_KEY: "test"
AWS_REGION: "us-east-1"
AWS_DEFAULT_REGION: "us-east-1"
SSM_LOCAL: "1"
SSM_ENDPOINT_URL: "http://localstack:4566"
- name: Test Vault
run: |
test/integration/vault-v1/test.sh
test/integration/expect/check.sh
test/integration/vault-v2/test.sh
test/integration/expect/check.sh
test/integration/vault-approle/test.sh
test/integration/expect/check.sh
env:
VAULT_ADDR: http://vault:8200
VAULT_TOKEN: "super-secret-token"
- name: Test Zookeeper
run: |
test/integration/zookeeper/test.sh
test/integration/expect/check.sh
env:
ZOOKEEPER_NODE: zookeeper