-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: add integration testing for main roles (#34)
* build: add integration testing ci: add github workflow for integration tests ci: use matrix for integration testing chore: add tag to skip idempotence tests for clickhouse build: add integration testing for mysql 8.4 test: fix verify command for mysql_8_4 test: fix mysql ansible variables build: add integration testing for mysql 8.0 test: fix idempotence tests test: setup vars in the all group chore: run all jobs on parallel build: add integration testing for caddy build: add integration testing for caddy build: add integration testing for elasticsearch_7_10 build: add integration testing for mongo_4_2 build: add integration testing build: add integration testing * fix: ensure gpg-agent is installed fix: update docker images fix: mark tasks are no idempotence fix: run caddy tests on ubuntu fix: add no idempotence tag for caddy and mongo * fix: update elasticsearch log directory * chore: remove mysql8.4 integration tests * fix: setup bind IP for elastichsearch * chore: remove outdated verify comment * build: only run changed environments * build: add integration testing for mysql 8.4 * build: only run changed environments * build: only run changed environments * build: only run changed environments * docs: add molecule documentation * docs: add molecule documentation * fix: force a valid priv instead of using defaults * test: add dependencies for mysql_8_4 * build: only run changed environments
- Loading branch information
Showing
52 changed files
with
687 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: Integration Test | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
|
||
load-roles: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
roles: ${{ steps.changed_roles.outputs.roles }} | ||
scenarios: ${{ steps.scenarios.outputs.scenarios}} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Find changed roles | ||
id: changed_roles | ||
run: | | ||
ROLES=$(git diff --name-only origin/main origin/${GITHUB_HEAD_REF} -- roles/*/ | awk -F '/' '{print $2}' | uniq | jq -R -s -c 'split("\n")[:-1]') | ||
echo "::set-output name=roles::$ROLES" | ||
- name: Find available scenarios | ||
id: scenarios | ||
run: | | ||
SCENARIOS=$(ls molecule | jq -R -s -c 'split("\n")[:-1]') | ||
echo "::set-output name=scenarios::$SCENARIOS" | ||
molecule: | ||
needs: load-roles | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
environment: ${{ fromJson(needs.load-roles.outputs.roles) }} | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.8' | ||
|
||
- name: Install test dependencies | ||
run: pip3 install molecule[docker] yamllint ansible-lint | ||
|
||
- name: Run molecule tests | ||
if: ${{ contains(fromJson(needs.load-roles.outputs.scenarios), matrix.environment) }} | ||
run: molecule test -s ${{ matrix.environment }} | ||
env: | ||
PY_COLORS: '1' | ||
ANSIBLE_FORCE_COLORS: '1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
- name: Converge | ||
hosts: all | ||
tasks: | ||
- name: "Include atlas-ansible-utils" | ||
include_role: | ||
name: "atlas-ansible-utils" | ||
- import_playbook: ../../caddy.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
dependency: | ||
name: galaxy | ||
driver: | ||
name: docker | ||
platforms: | ||
- name: caddy-instance | ||
image: geerlingguy/docker-ubuntu2204-ansible:latest | ||
command: "" | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:rw | ||
capabilities: | ||
- SYS_ADMIN | ||
tmpfs: | ||
- /run | ||
- /tmp | ||
cgroupns_mode: host | ||
privileged: true | ||
pre_build_image: true | ||
groups: | ||
- caddy_servers | ||
provisioner: | ||
name: ansible | ||
inventory: | ||
all: {} | ||
verifier: | ||
name: ansible |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
|
||
|
||
- name: Verify | ||
hosts: all | ||
gather_facts: false | ||
tasks: | ||
- name: Verify Caddy installation | ||
register: caddy | ||
shell: | | ||
caddy version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
- name: Converge | ||
hosts: all | ||
tasks: | ||
- name: "Include atlas-ansible-utils" | ||
include_role: | ||
name: "atlas-ansible-utils" | ||
- import_playbook: ../../clickhouse.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
dependency: | ||
name: galaxy | ||
driver: | ||
name: docker | ||
platforms: | ||
- name: clickhouse-instance | ||
image: geerlingguy/docker-ubuntu2004-ansible:latest | ||
command: "" | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:rw | ||
capabilities: | ||
- SYS_ADMIN | ||
tmpfs: | ||
- /run | ||
- /tmp | ||
cgroupns_mode: host | ||
privileged: true | ||
pre_build_image: true | ||
groups: | ||
- clickhouse_servers | ||
provisioner: | ||
name: ansible | ||
inventory: | ||
all: | ||
CLICKHOUSE_DEFAULT_USER_PASSWORD: password | ||
verifier: | ||
name: ansible |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
|
||
|
||
- name: Verify | ||
hosts: all | ||
gather_facts: false | ||
tasks: | ||
- name: Verify ClickHouse HTTP | ||
uri: | ||
url: "http://localhost:8123/" | ||
status_code: 200 | ||
timeout: 1 | ||
return_content: yes | ||
- name: Verify ClickHouse installation | ||
register: clickhouse_client | ||
shell: | | ||
clickhouse-client --user "default" --password="password" --query "SELECT 1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
- name: Converge | ||
hosts: all | ||
tasks: | ||
- name: "Include atlas-ansible-utils" | ||
include_role: | ||
name: "atlas-ansible-utils" | ||
- import_playbook: ../../elasticsearch_7_10.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
dependency: | ||
name: galaxy | ||
driver: | ||
name: docker | ||
platforms: | ||
- name: elasticsearch-instance | ||
image: geerlingguy/docker-ubuntu2004-ansible:latest | ||
command: "" | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:rw | ||
capabilities: | ||
- SYS_ADMIN | ||
tmpfs: | ||
- /run | ||
- /tmp | ||
cgroupns_mode: host | ||
privileged: true | ||
pre_build_image: true | ||
groups: | ||
- elasticsearch_servers | ||
provisioner: | ||
name: ansible | ||
inventory: | ||
all: {} | ||
verifier: | ||
name: ansible |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
|
||
|
||
- name: Verify | ||
hosts: all | ||
gather_facts: false | ||
tasks: | ||
- name: Verify ElasticSearch installation | ||
uri: | ||
url: http://localhost:9200/ | ||
status_code: 200 | ||
timeout: 1 | ||
return_content: yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
- name: Converge | ||
hosts: all | ||
tasks: | ||
- name: "Include atlas-ansible-utils" | ||
include_role: | ||
name: "atlas-ansible-utils" | ||
- import_playbook: ../../mongo_4_2.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
dependency: | ||
name: galaxy | ||
driver: | ||
name: docker | ||
platforms: | ||
- name: mongo-instance | ||
image: geerlingguy/docker-ubuntu2004-ansible:latest | ||
command: "" | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:rw | ||
capabilities: | ||
- SYS_ADMIN | ||
tmpfs: | ||
- /run | ||
- /tmp | ||
cgroupns_mode: host | ||
privileged: true | ||
pre_build_image: true | ||
groups: | ||
- mongo_servers | ||
provisioner: | ||
name: ansible | ||
inventory: | ||
all: {} | ||
verifier: | ||
name: ansible |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
|
||
|
||
- name: Verify | ||
hosts: all | ||
gather_facts: false | ||
tasks: | ||
- name: Verify MongoDB installation | ||
uri: | ||
url: http://localhost:27017/ | ||
status_code: 200 | ||
timeout: 1 | ||
return_content: yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
- name: Converge | ||
hosts: all | ||
tasks: | ||
- name: "Include atlas-ansible-utils" | ||
include_role: | ||
name: "atlas-ansible-utils" | ||
- import_playbook: ../../mongo_4_4.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
dependency: | ||
name: galaxy | ||
driver: | ||
name: docker | ||
platforms: | ||
- name: mongo-4-4-instance | ||
image: geerlingguy/docker-ubuntu2204-ansible:latest | ||
command: "" | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:rw | ||
capabilities: | ||
- SYS_ADMIN | ||
tmpfs: | ||
- /run | ||
- /tmp | ||
cgroupns_mode: host | ||
privileged: true | ||
pre_build_image: true | ||
groups: | ||
- mongo_servers | ||
provisioner: | ||
name: ansible | ||
inventory: | ||
all: {} | ||
verifier: | ||
name: ansible |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
|
||
|
||
- name: Verify | ||
hosts: all | ||
gather_facts: false | ||
tasks: | ||
- name: Verify MongoDB installation | ||
uri: | ||
url: http://localhost:27017/ | ||
status_code: 200 | ||
timeout: 1 | ||
return_content: yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
- name: Converge | ||
hosts: all | ||
tasks: | ||
- name: "Include atlas-ansible-utils" | ||
include_role: | ||
name: "atlas-ansible-utils" | ||
- import_playbook: ../../mongo_7_0.yml |
Oops, something went wrong.