Skip to content

Commit

Permalink
use pytest-reportportal with backport and add unit test (#3043)
Browse files Browse the repository at this point in the history
* use internal version of pytest-reportportal that removes the following patch for
v1.10.0 - reportportal/agent-python-pytest#132

Fixes: #2973

Signed-off-by: Vasu Kulkarni <[email protected]>
  • Loading branch information
vasukulkarni authored Nov 13, 2020
1 parent f847ae6 commit be6407c
Show file tree
Hide file tree
Showing 7 changed files with 103 additions and 3 deletions.
42 changes: 42 additions & 0 deletions ocs_ci/framework/tests/order/a/test_a.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
from os import environ
from ocs_ci.framework.pytest_customization.marks import (
post_ocs_upgrade,
post_upgrade,
ocs_upgrade,
)


@post_upgrade
def test_1():
"""
This test depends on test_e.py in folder 'e', test_z.py in folder 'z'
to test our internal upgrade ordering marks.
Each test within specific folder 'e' and 'z' update same environment
variable 'RH' with one character in specific order to test the final
string "Red Hat".
Any order changes will cause the environment variable to differ.
"""

assert environ["RH"] == "Red Hat"


@post_ocs_upgrade
def test_2():
"""
update environment variable 'RH' to include character "T"
final verification done in test_1.
"""

environ["RH"] += "t"


@ocs_upgrade
def test_3():
"""
update environment variable 'RH' to include character "a"
final verification done in test_1.
"""

environ["RH"] += "a"
36 changes: 36 additions & 0 deletions ocs_ci/framework/tests/order/e/test_e.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
from os import environ
from ocs_ci.framework.pytest_customization.marks import (
post_ocp_upgrade,
pre_ocs_upgrade,
ocp_upgrade,
)


@pre_ocs_upgrade
def test_4():
"""
update environment variable 'RH' to include character "H"
final verification done in test_1 in upper level folder 'a'.
"""

environ["RH"] += "H"


@post_ocp_upgrade
def test_5():
"""
update environment variable 'RH' to include character " "
final verification done in test_1 in upper level folder 'a'.
"""

environ["RH"] += " "


@ocp_upgrade
def test_6():
"""
update environment variable 'RH' to include character "d"
final verification done in test_1 in upper level folder 'a'.
"""

environ["RH"] += "d"
22 changes: 22 additions & 0 deletions ocs_ci/framework/tests/order/z/test_z.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from os import environ
from ocs_ci.framework.pytest_customization.marks import pre_ocp_upgrade, pre_upgrade


@pre_ocp_upgrade
def test_7():
"""
update environment variable 'RH' to include character "e"
final verification done in test_1 in upper level folder 'a'.
"""

environ["RH"] += "e"


@pre_upgrade
def test_8():
"""
update environment variable 'RH' to include character "R"
final verification done in test_1 in upper level folder 'a'.
"""

environ["RH"] = "R"
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pre-commit==2.5.1
black==20.8b1
-e .
-r requirements.txt
2 changes: 1 addition & 1 deletion requirements-docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ sphinx==2.4.4
sphinx-autopackagesummary==1.3
sphinx_rtd_theme==0.5.0
recommonmark==0.6.0
-e .
-r requirements.txt
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
-e git+https://github.com/vasukulkarni/[email protected]#egg=pytest-reportportal
-e .
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"boto3==1.14.7",
"munch==2.5.0",
"pytest==5.3.5",
"pytest-reportportal==1.10.0",
"pytest-logger==0.5.1",
'dataclasses==0.7;python_version < "3.7"',
"pytest-html==2.1.1",
Expand Down

0 comments on commit be6407c

Please sign in to comment.