feat: added molecule testing
This commit is contained in:
parent
c3fc60e33d
commit
917c04ed7e
5 changed files with 97 additions and 7 deletions
|
|
@ -1,3 +1,10 @@
|
|||
---
|
||||
|
||||
# renovate: datasource=github-releases depName=atuinsh/atuin versioning=pep440
|
||||
atuin_version: "18.7.1"
|
||||
|
||||
# atuin db creds
|
||||
atuin_db_host: "localhost"
|
||||
atuin_db_name: "atuin"
|
||||
atuin_db_user: "atuin"
|
||||
atuin_db_pass: "atuin"
|
||||
|
|
|
|||
|
|
@ -7,10 +7,4 @@
|
|||
state: "restarted"
|
||||
daemon_reload: true
|
||||
enabled: true
|
||||
|
||||
# sysusers
|
||||
- name: "restart sysusers"
|
||||
ansible.builtin.systemd:
|
||||
name: "systemd-sysusers.service"
|
||||
state: "restarted"
|
||||
enabled: true
|
||||
when: "not lookup('env', 'MOLECULE_TESTING') | bool"
|
||||
|
|
|
|||
8
molecule/default/converge.yml
Normal file
8
molecule/default/converge.yml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
---
|
||||
|
||||
- name: "converge"
|
||||
hosts: "all"
|
||||
become: true
|
||||
gather_facts: true
|
||||
roles:
|
||||
- role: "siempie.atuin"
|
||||
44
molecule/default/molecule.yml
Normal file
44
molecule/default/molecule.yml
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
---
|
||||
|
||||
dependency:
|
||||
name: "galaxy"
|
||||
|
||||
driver:
|
||||
name: "docker"
|
||||
|
||||
provisioner:
|
||||
name: "ansible"
|
||||
env:
|
||||
MOLECULE_TESTING: "true"
|
||||
|
||||
verifier:
|
||||
name: "ansible"
|
||||
|
||||
platforms:
|
||||
|
||||
# debian 12
|
||||
- name: "debian-12"
|
||||
image: "geerlingguy/docker-debian12-ansible:latest"
|
||||
pre_build_image: true
|
||||
privileged: true
|
||||
volumes:
|
||||
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
|
||||
command: "/lib/systemd/systemd"
|
||||
|
||||
# ubuntu 22
|
||||
- name: "ubuntu-22"
|
||||
image: "geerlingguy/docker-ubuntu2204-ansible:latest"
|
||||
pre_build_image: true
|
||||
privileged: true
|
||||
volumes:
|
||||
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
|
||||
command: "/lib/systemd/systemd"
|
||||
|
||||
# ubuntu 24
|
||||
- name: "ubuntu-24"
|
||||
image: "geerlingguy/docker-ubuntu2404-ansible:latest"
|
||||
pre_build_image: true
|
||||
privileged: true
|
||||
volumes:
|
||||
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
|
||||
command: "/lib/systemd/systemd"
|
||||
37
molecule/default/verify.yml
Normal file
37
molecule/default/verify.yml
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
---
|
||||
|
||||
# verify
|
||||
- name: "verify"
|
||||
hosts: "all"
|
||||
become: true
|
||||
gather_facts: true
|
||||
vars:
|
||||
# renovate: datasource=github-releases depName=atuinsh/atuin versioning=pep440
|
||||
atuin_version: "18.7.1"
|
||||
atuin_binary_path: "/usr/local/bin/atuin"
|
||||
|
||||
tasks:
|
||||
|
||||
# check if atuin binary is installed
|
||||
- name: "check if atuin binary exists"
|
||||
ansible.builtin.stat:
|
||||
path: "{{ atuin_binary_path }}"
|
||||
register: "atuin_binary_stat"
|
||||
|
||||
- name: "fail if atuin binary does not exist"
|
||||
ansible.builtin.fail:
|
||||
msg: "Atuin binary not found at {{ atuin_binary_path }}"
|
||||
when: "not atuin_binary_stat.stat.exists"
|
||||
|
||||
# check atuin version
|
||||
- name: "check current atuin version"
|
||||
ansible.builtin.command: "{{ atuin_binary_path }} -V"
|
||||
register: "atuin_version_check"
|
||||
changed_when: false
|
||||
failed_when: "atuin_version_check.rc != 0"
|
||||
|
||||
- name: "assert atuin version matches expected"
|
||||
ansible.builtin.assert:
|
||||
that: "'{{ atuin_version }}' in atuin_version_check.stdout"
|
||||
fail_msg: "Atuin version ({{ atuin_version_check.stdout }}) does not match ({{ atuin_version }})"
|
||||
success_msg: "Atuin version matches expected ({{ atuin_version }})"
|
||||
Loading…
Add table
Add a link
Reference in a new issue