Browse Source

add a playbook to be able to run integrationtest also locally

local_integrationtest
Markus Bergholz 1 year ago
parent
commit
208fd5bb32
No known key found for this signature in database
GPG Key ID: B45724801354B174
  1. 3
      .github/workflows/ansible-test-plugins.yml
  2. 11
      tests/integration/targets/setup_proxysql/tasks/main.yml
  3. 2
      tests/integration/targets/test_proxysql_query_rules_fast_routing/tasks/base_test.yml

3
.github/workflows/ansible-test-plugins.yml

@ -80,6 +80,9 @@ jobs:
- name: Set ProxySQL version (${{ matrix.proxysql }})
run: "sed -i 's/^proxysql_version:.*/proxysql_version: \"${{ matrix.proxysql }}\"/g' ${{ env.proxysql_version_file }}"
- name: install python3-apt to detect of proxysql is already available
run: apt install python3-apt -y
- name: Run integration tests
run: ansible-test integration --docker -v --color --retry-on-error --continue-on-error --python ${{ matrix.python }} --diff --coverage
working-directory: ./ansible_collections/community/proxysql

11
tests/integration/targets/setup_proxysql/tasks/main.yml

@ -3,6 +3,13 @@
# WARNING: These are designed specifically for Ansible tests #
# and should not be used as examples of how to write Ansible roles #
####################################################################
- name: Gather the package facts
ansible.builtin.package_facts:
manager: apt
ignore_errors: yes
- import_tasks: install.yml
- import_tasks: config.yml
- name: install and configure proxysql only if not exists
when: ansible_facts.packages['proxysql'] is not defined
block:
- import_tasks: install.yml
- import_tasks: config.yml

2
tests/integration/targets/test_proxysql_query_rules_fast_routing/tasks/base_test.yml

@ -11,7 +11,7 @@
### when
- name: "{{ role_name }} | {{ current_test }} | {{ test_delete|ternary('delete','create') }} test query rules fast routing"
proxysql_query_rules_fast_routing:
community.proxysql.proxysql_query_rules_fast_routing:
login_user: admin
login_password: admin
username: '{{ test_user }}'

Loading…
Cancel
Save