feat: added molecule testing
This commit is contained in:
parent
c3fc60e33d
commit
917c04ed7e
5 changed files with 97 additions and 7 deletions
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