Skip to content

Commit

Permalink
feat(test): Adding custom markers to tests for gating tests
Browse files Browse the repository at this point in the history
  • Loading branch information
archana-redhat committed Dec 5, 2024
1 parent 0345b25 commit cee3497
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 1 deletion.
6 changes: 6 additions & 0 deletions integration-tests/pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[pytest]
markers =
gating : mark a test that should run for gating jobs
tier1 : mark a test to run as tier1 priority
tier2 : mark a test to run as tier2 priority

1 change: 1 addition & 0 deletions integration-tests/test_connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
logger = logging.getLogger(__name__)


@pytest.mark.gating
@pytest.mark.parametrize("auth", ["basic", "activation-key"])
def test_connect(external_candlepin, rhc, test_config, auth):
"""Test if RHC can connect to CRC using basic auth and activation key,
Expand Down
1 change: 1 addition & 0 deletions integration-tests/test_disconnect.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from utils import yggdrasil_service_is_active


@pytest.mark.gating
def test_rhc_disconnect(external_candlepin, rhc, test_config):
"""Verify that RHC disconnect command disconnects host from server
and deactivates yggdrasil service.
Expand Down
4 changes: 3 additions & 1 deletion integration-tests/test_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from utils import yggdrasil_service_is_active


@pytest.mark.gating
def test_status_connected(external_candlepin, rhc, test_config):
"""Test RHC Status command when the host is connected.
test_steps:
Expand Down Expand Up @@ -47,7 +48,7 @@ def test_status_connected_format_json(external_candlepin, rhc, test_config):
"""
rhc.connect(
username=test_config.get("candlepin.username"),
password=test_config.get("candlepin.password")
password=test_config.get("candlepin.password"),
)
status_result = rhc.run("status", "--format", "json", check=False)
assert status_result.returncode == 0
Expand All @@ -61,6 +62,7 @@ def test_status_connected_format_json(external_candlepin, rhc, test_config):
assert type(status_json["yggdrasil_running"]) == bool


@pytest.mark.gating
def test_status_disconnected(rhc):
"""Test RHC Status command when the host is disconnected.
Ref: https://issues.redhat.com/browse/CCT-525
Expand Down
4 changes: 4 additions & 0 deletions integration-tests/test_version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import pytest


@pytest.mark.gating
def test_version(rhc):
proc = rhc.run("--version")
assert "rhc version " in proc.stdout

0 comments on commit cee3497

Please sign in to comment.