Skip to content

Commit

Permalink
fix tests broken by a deprecation warning
Browse files Browse the repository at this point in the history
The string starts with a deprecation warning, so let's check for
presence of the PLAY in the logs.

Signed-off-by: Tomas Tomecek <[email protected]>
  • Loading branch information
TomasTomecek committed Jun 9, 2022
1 parent d9ee56a commit 82d2b5e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/functional/test_buildah.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def test_build_failure(tmpdir):
with pytest.raises(subprocess.CalledProcessError):
ab(cmd, str(tmpdir))
out = ab(["get-logs"], str(tmpdir), return_output=True).lstrip()
assert out.startswith("PLAY [registry")
assert "PLAY [registry" in out

# regex string for target image
image_name_regex = "%s+[-]+[0-9]+[-]+[0-9]+-failed" %(target_image)
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def test_get_logs(target_image, tmpdir):
cmd = ["build", basic_playbook_path, base_image, target_image]
ab(cmd, str(tmpdir))
out = ab(["get-logs"], str(tmpdir), return_output=True).lstrip()
assert out.startswith("PLAY [registry")
assert "PLAY [registry" in out
assert "TASK [Gathering Facts]" in out
assert "failed=0" in out
assert "TASK [print local env vars]" in out
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def test_build_db_metadata(application, build):
assert build.build_start_time is not None
assert build.log_lines is not None
logs = "\n".join([l for l in build.log_lines if l])
assert logs.startswith("PLAY [registry")
assert "PLAY [registry" in logs
assert "TASK [Gathering Facts]" in logs
assert "failed=0" in logs

Expand Down

0 comments on commit 82d2b5e

Please sign in to comment.