Skip to content

Commit

Permalink
Merge pull request #47 from Zuehlke/feature/relax-ansible-core-check
Browse files Browse the repository at this point in the history
Fix failing tests / brittle dependencies
  • Loading branch information
tknerr committed Feb 27, 2023
2 parents 400f35f + 5fca226 commit a578954
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions roles/testinfra/tasks/main.yml
Expand Up @@ -14,9 +14,9 @@
state: present
become: yes

- name: Install pytest-html reporter at version 3.1.1
- name: Install pytest-html reporter at version 3.2.0
pip:
name: pytest-html
version: 3.1.1
version: 3.2.0
state: present
become: yes
8 changes: 4 additions & 4 deletions spec/test_ansible.py
Expand Up @@ -5,16 +5,16 @@ def test_ansible_is_installed_at_version_5_5_0_(host):
assert "Name: ansible\nVersion: 5.5.0" in cmd.stdout


def test_ansible_core_is_installed_at_version_2_12_5_(host):
def test_ansible_core_is_installed_at_version_2_12_x_(host):
cmd = host.run("pip3 show --disable-pip-version-check ansible-core")
assert cmd.rc is 0
assert "Name: ansible-core\nVersion: 2.12.5" in cmd.stdout
assert "Name: ansible-core\nVersion: 2.12." in cmd.stdout


def test_ansible_commands_are_found_(host):
assert host.run('which ansible').rc is 0
assert host.run('which ansible-playbook').rc is 0


def test_ansible_version_command_reports_core_version_2_12_5_(host):
assert 'core 2.12.5' in host.run('ansible --version').stdout
def test_ansible_version_command_reports_core_version_2_12_x_(host):
assert 'core 2.12.' in host.run('ansible --version').stdout
4 changes: 2 additions & 2 deletions spec/test_testinfra.py
Expand Up @@ -9,7 +9,7 @@ def test_pytest_spec_is_installed_at_version_3_2_0_(host):
assert cmd.rc is 0
assert "Name: pytest-spec\nVersion: 3.2.0" in cmd.stdout

def test_pytest_html_formatter_is_installed_at_version_3_1_1_(host):
def test_pytest_html_formatter_is_installed_at_version_3_2_0_(host):
cmd = host.run("pip3 show --disable-pip-version-check pytest-html")
assert cmd.rc is 0
assert "Name: pytest-html\nVersion: 3.1.1" in cmd.stdout
assert "Name: pytest-html\nVersion: 3.2.0" in cmd.stdout

0 comments on commit a578954

Please sign in to comment.