Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix failing tests / brittle dependencies #47

Merged
merged 2 commits into from
Feb 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions roles/testinfra/tasks/main.yml
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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