Skip to content

Commit

Permalink
[ATL-33456] Providing cleanup mechanism for e2e tests (#1237)
Browse files Browse the repository at this point in the history
* [ATL-33456] IMP: Providing cleanup  for e2e tests

* [ATL-33456] UPD: Gitignore and pylintrc update

* [ATL-33456] UPD: Reverting storage_classes
  • Loading branch information
pawel-labuz authored Nov 18, 2024
1 parent b0af9c6 commit 62f2606
Show file tree
Hide file tree
Showing 12 changed files with 352 additions and 87 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ ci.log
tests/e2e/reports/report.xml
tests/kind/kind
tests/log.txt
# e2e tests results
tests/e2e-test-framework/logs
tests/e2e-test-framework/report
# vscode
.vscode
# python
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e-test-framework/.pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ indent-string=' '
max-line-length=210

# Maximum number of lines in a module.
max-module-lines=1000
max-module-lines=1500

# Allow the body of a class to be on the same line as the declaration if body
# contains single statement.
Expand Down
3 changes: 3 additions & 0 deletions tests/e2e-test-framework/framework/drive.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import json
import logging
import time
from typing import Any, Dict, List, TypedDict
from framework.ssh import SSHCommandExecutor

Expand Down Expand Up @@ -251,6 +252,8 @@ def wipe_drives(self) -> None:
else:
raise ValueError(f"Unknown drive type: {children['type']}")

time.sleep(1)

def _get_device_name(self, device_path_or_name: str) -> str:
return (
device_path_or_name[5:]
Expand Down
4 changes: 3 additions & 1 deletion tests/e2e-test-framework/framework/sts.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,13 @@ def create(self, storage_classes: List[str]) -> None:
assert (
response is not None
), f"Failed to create StatefulSet: {self.name}"
logging.info(f"StatefulSet created : {self.name}")
except ApiException as exc:
pytest.fail(
f"Failed to create StatefulSet: {self.name}. Reason: {str(exc)}"
)

def delete(self) -> None:
def delete(self) -> str:
try:
response = self.apps_v1_api.delete_namespaced_stateful_set(
self.name, self.namespace
Expand All @@ -113,6 +114,7 @@ def delete(self) -> None:
logging.warning(
f"Failed to delete StatefulSet: {self.name}. Reason: {str(exc)}"
)
return self.name

def verify(self, timeout: int) -> bool:
start_time = time.time()
Expand Down
Loading

0 comments on commit 62f2606

Please sign in to comment.