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

artifacts: rename type to artifacts_type in get_artifacts_list #76

Merged
merged 1 commit into from
Sep 10, 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
14 changes: 7 additions & 7 deletions pytest_mh/_private/artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class MultihostArtifactsCollectable(Protocol):
Protocol: object supports artifacts collection.
"""

def get_artifacts_list(self, host: MultihostHost, type: MultihostArtifactsType) -> set[str]:
def get_artifacts_list(self, host: MultihostHost, artifacts_type: MultihostArtifactsType) -> set[str]:
"""
Return the list of artifacts to collect.

Expand All @@ -160,8 +160,8 @@ def get_artifacts_list(self, host: MultihostHost, type: MultihostArtifactsType)

:param host: Host where the artifacts are being collected.
:type host: MultihostHost
:param type: Type of artifacts that are being collected.
:type type: MultihostArtifactsType
:param artifacts_type: Type of artifacts that are being collected.
:type artifacts_type: MultihostArtifactsType
:return: List of artifacts to collect.
:rtype: set[str]
"""
Expand Down Expand Up @@ -212,7 +212,7 @@ def should_collect(self, outcome: MultihostOutcome) -> bool:

def collect(
self,
type: MultihostArtifactsType,
artifacts_type: MultihostArtifactsType,
*,
path: str,
outcome: MultihostOutcome,
Expand All @@ -221,8 +221,8 @@ def collect(
"""
Collect artifacts to $artifacts_dir/$path/$collection_path.

:param type: Artifacts type.
:type type: MultihostArtifactsType
:param artifacts_type: Artifacts type.
:type artifacts_type: MultihostArtifactsType
:param path: Artifacts path relative to artifacts directory.
:type path: str
:param outcome: Test or operation outcome.
Expand All @@ -245,7 +245,7 @@ def collect(
artifacts_set: set[str] = set()
for obj in collect_objects:
try:
artifacts_set.update(obj.get_artifacts_list(self.host, type))
artifacts_set.update(obj.get_artifacts_list(self.host, artifacts_type))
except Exception as e:
errors.append(e)

Expand Down
20 changes: 10 additions & 10 deletions pytest_mh/_private/multihost.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ def teardown(self) -> None:
"""
pass

def get_artifacts_list(self, host: MultihostHost, type: MultihostArtifactsType) -> set[str]:
def get_artifacts_list(self, host: MultihostHost, artifacts_type: MultihostArtifactsType) -> set[str]:
"""
Return the list of artifacts to collect.

Expand All @@ -594,12 +594,12 @@ def get_artifacts_list(self, host: MultihostHost, type: MultihostArtifactsType)

:param host: Host where the artifacts are being collected.
:type host: MultihostHost
:param type: Type of artifacts that are being collected.
:type type: MultihostArtifactsType
:param artifacts_type: Type of artifacts that are being collected.
:type artifacts_type: MultihostArtifactsType
:return: List of artifacts to collect.
:rtype: set[str]
"""
return self.configured_artifacts.get(type) | self.artifacts.get(type)
return self.configured_artifacts.get(artifacts_type) | self.artifacts.get(artifacts_type)

def get_connection(self, shell: Shell) -> Connection:
"""
Expand Down Expand Up @@ -682,7 +682,7 @@ def teardown(self) -> None:
"""
pass

def get_artifacts_list(self, host: MultihostHost, type: MultihostArtifactsType) -> set[str]:
def get_artifacts_list(self, host: MultihostHost, artifacts_type: MultihostArtifactsType) -> set[str]:
"""
Return the list of artifacts to collect.

Expand All @@ -693,8 +693,8 @@ def get_artifacts_list(self, host: MultihostHost, type: MultihostArtifactsType)

:param host: Host where the artifacts are being collected.
:type host: MultihostHost
:param type: Type of artifacts that are being collected.
:type type: MultihostArtifactsType
:param artifacts_type: Type of artifacts that are being collected.
:type artifacts_type: MultihostArtifactsType
:return: List of artifacts to collect.
:rtype: set[str]
"""
Expand Down Expand Up @@ -778,7 +778,7 @@ def teardown(self) -> None:
"""
pass

def get_artifacts_list(self, host: MultihostHost, type: MultihostArtifactsType) -> set[str]:
def get_artifacts_list(self, host: MultihostHost, artifacts_type: MultihostArtifactsType) -> set[str]:
"""
Return the list of artifacts to collect.

Expand All @@ -789,8 +789,8 @@ def get_artifacts_list(self, host: MultihostHost, type: MultihostArtifactsType)

:param host: Host where the artifacts are being collected.
:type host: MultihostHost
:param type: Type of artifacts that are being collected.
:type type: MultihostArtifactsType
:param artifacts_type: Type of artifacts that are being collected.
:type artifacts_type: MultihostArtifactsType
:return: List of artifacts to collect.
:rtype: set[str]
"""
Expand Down
8 changes: 4 additions & 4 deletions pytest_mh/_private/topology_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ def hosts(self) -> list[MultihostHost]:

return self.__hosts

def get_artifacts_list(self, host: MultihostHost, type: MultihostArtifactsType) -> set[str]:
def get_artifacts_list(self, host: MultihostHost, artifacts_type: MultihostArtifactsType) -> set[str]:
"""
Return the list of artifacts to collect.

Expand All @@ -293,12 +293,12 @@ def get_artifacts_list(self, host: MultihostHost, type: MultihostArtifactsType)

:param host: Host where the artifacts are being collected.
:type host: MultihostHost
:param type: Type of artifacts that are being collected.
:type type: MultihostArtifactsType
:param artifacts_type: Type of artifacts that are being collected.
:type artifacts_type: MultihostArtifactsType
:return: List of artifacts to collect.
:rtype: set[str]
"""
return self.artifacts.get(host, type)
return self.artifacts.get(host, artifacts_type)

def set_artifacts(self, *args, **kwargs) -> None:
"""
Expand Down
6 changes: 3 additions & 3 deletions pytest_mh/utils/coredumpd.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,14 @@ def parse_core_file_name(self, name: str) -> tuple[str, str]:

return (pid, timestamp)

def get_artifacts_list(self, host: MultihostHost, type: MultihostArtifactsType) -> set[str]:
def get_artifacts_list(self, host: MultihostHost, artifacts_type: MultihostArtifactsType) -> set[str]:
"""
Dump backtrace and other information from generated core files for easy access.

:param host: Host where the artifacts are being collected.
:type host: MultihostHost
:param type: Type of artifacts that are being collected.
:type type: MultihostArtifactsType
:param artifacts_type: Type of artifacts that are being collected.
:type artifacts_type: MultihostArtifactsType
:return: List of artifacts to collect.
:rtype: set[str]
"""
Expand Down
6 changes: 3 additions & 3 deletions pytest_mh/utils/journald.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ def setup(self) -> None:
"""
self._test_start = self.now

def get_artifacts_list(self, host: MultihostHost, type: MultihostArtifactsType) -> set[str]:
def get_artifacts_list(self, host: MultihostHost, artifacts_type: MultihostArtifactsType) -> set[str]:
"""
Dump journald into file that can be collected.

:param host: Host where the artifacts are being collected.
:type host: MultihostHost
:param type: Type of artifacts that are being collected.
:type type: MultihostArtifactsType
:param artifacts_type: Type of artifacts that are being collected.
:type artifacts_type: MultihostArtifactsType
:return: List of artifacts to collect.
:rtype: set[str]
"""
Expand Down
Loading