Skip to content

Commit

Permalink
tests/rptests: fixes to make it run at a basic level
Browse files Browse the repository at this point in the history
  • Loading branch information
andijcr committed Mar 22, 2023

Verified

This commit was signed with the committer’s verified signature.
jkroepke Jan-Otto Kröpke
1 parent 5e76d77 commit e6c2394
Showing 4 changed files with 12 additions and 10 deletions.
5 changes: 2 additions & 3 deletions tests/rptest/services/redpanda_installer.py
Original file line number Diff line number Diff line change
@@ -441,11 +441,10 @@ def release_range(
"""

self.start()
self._initialize_released_versions()

# default to oldest
if not earliest:
earliest = self._released_versions[-1][0:2]
earliest = self.released_versions[-1][0:2]

# convert to specific version
if len(earliest) == 2:
@@ -460,7 +459,7 @@ def release_range(
latest, _ = self.latest_for_line(latest)

# setup a copy (we are going to modify it)
rel_range = copy.deepcopy(self._released_versions)
rel_range = copy.deepcopy(self.released_versions)

# glue head in front, as the most recent version
rel_range.insert(0, self._head_version)
4 changes: 2 additions & 2 deletions tests/rptest/services/workload_protocol.py
Original file line number Diff line number Diff line change
@@ -46,8 +46,8 @@ def begin(self) -> None:
"""
return

def partial_progress(self, versions: map[Any, tuple[int, int,
int]]) -> int:
def partial_progress(self, versions: dict[Any, tuple[int, int,
int]]) -> int:
"""
This method is called while upgrading a cluster, after each node is upgraded.
"""
11 changes: 7 additions & 4 deletions tests/rptest/tests/upgrade_test.py
Original file line number Diff line number Diff line change
@@ -655,12 +655,14 @@ def _expand_version(self, version: Optional[Union[str, tuple[int, int],
# version is a release line, get latest minor for it
return [v for v in self.upgrade_steps if v[0:2] == v][-1]

@cluster(num_nodes=3)
def test_workloads_through_releases(self):
current_version = self.upgrade_steps[0]
rest_versions = self.upgrade_steps[1:]
self.logger.info(f"installing base version {current_version}")
self.installer.install(nodes=self.redpanda.nodes,
version=current_version)
self.redpanda.start(clean_nodes=True)
for next_version in rest_versions:
# TODO final loop progress is not done at the moment
to_check_workloads = self.not_started_workloads[:]
@@ -682,7 +684,7 @@ def test_workloads_through_releases(self):
w: w.progress(current_version)
for w in to_check_workloads
}
for w, state in status_progress:
for w, state in status_progress.items():
if state == PWorkload.DONE:
self.logger.info(
f"{w.get_workload_name()} progress check done")
@@ -695,11 +697,12 @@ def test_workloads_through_releases(self):
versions = {n: current_version for n in self.redpanda.nodes}
for n in self.redpanda.nodes:
self.installer.install(nodes=[n], version=next_version)
self.redpanda.restart_nodes(nodes=[n])
versions[n] = next_version
# TODO move this to a lambda or private method, like the progress loop
to_check_workloads = [
self._expand_version(w.get_latest_applicable_release()) >=
next_version for w in self.active_workloads
w for w in self.active_workloads if self._expand_version(
w.get_latest_applicable_release()) >= next_version
]
while len(to_check_workloads) > 0:
self.logger.info(
@@ -709,7 +712,7 @@ def test_workloads_through_releases(self):
w: w.partial_progress(versions)
for w in to_check_workloads
}
for w, state in status_progress:
for w, state in status_progress.items():
if state == PWorkload.DONE:
self.logger.info(
f"{w.get_workload_name()} partial_progress check done"
2 changes: 1 addition & 1 deletion tests/setup.py
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@
'psutil==5.9.0', 'numpy==1.22.3', 'pygal==3.0', 'pytest==7.1.2',
'jump-consistent-hash==3.2.0', 'azure-storage-blob==12.14.1',
'kafkatest@git+https://github.com/apache/kafka.git@058589b03db686803b33052d574ce887fb5cfbd1#egg=kafkatest&subdirectory=tests',
'more-itertools>=9.0.0'
'more-itertools==5.0.0'
],
scripts=[],
)

0 comments on commit e6c2394

Please sign in to comment.