Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ATL-33456] Providing cleanup mechanism for e2e tests #1237

Merged
merged 3 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading