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 c5c79ed
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 2 deletions.
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

2 changes: 1 addition & 1 deletion integration-tests/test_connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,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
2 changes: 1 addition & 1 deletion integration-tests/test_disconnect.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,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
2 changes: 2 additions & 0 deletions 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 @@ -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
3 changes: 3 additions & 0 deletions integration-tests/test_version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import pytest

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

0 comments on commit c5c79ed

Please sign in to comment.