Skip to content

Commit

Permalink
MB-58691: Overwrite passed cluster with result from testset
Browse files Browse the repository at this point in the history
This allow us to change the cluster variable of a testset and have the
modification manifest for the testrunner to correctly tear down the
correct cluster. This will be used in a future change to test node
remapping which tears down and recreates the original cluster at the
start and end of the test respectively.

Change-Id: I1ce5b15f03ff3ad9542fb76db4ed57705de97480
Reviewed-on: https://review.couchbase.org/c/ns_server/+/209394
Well-Formed: Build Bot <build@couchbase.com>
Well-Formed: Restriction Checker
Tested-by: Ben Huddleston <ben.huddleston@couchbase.com>
Reviewed-by: Peter Searby <peter.searby@couchbase.com>
  • Loading branch information
BenHuddleston committed May 8, 2024
1 parent 9e82804 commit 9e3aee6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions cluster_tests/run.py
Expand Up @@ -326,7 +326,8 @@ def main():
start_index)
testset_start_ts = time.time_ns()
# Run the testsets on the cluster
tests_executed, testset_errors, testset_not_ran, log_collection_time = \
tests_executed, testset_errors, testset_not_ran, log_collection_time,\
cluster = \
run_testsets(cluster, testsets, total_num,
seed=seed,
stop_after_first_error=stop_after_first_error,
Expand Down Expand Up @@ -611,6 +612,7 @@ def skip_this_testset(error):
executed += res[0]
testset_errors = res[1]
not_ran += res[2]
cluster = res[3]
# We use a catch-all here because if we hit any errors while running
# a testset, but not in a test, then it is likely an issue with the
# cluster, so we should keep running more tests
Expand Down Expand Up @@ -668,7 +670,7 @@ def skip_this_testset(error):
print(f"Collected logs for {node.url}: {path}")

log_collection_time += (time.time_ns() - collect_start_time)
return executed, errors, not_ran, log_collection_time
return executed, errors, not_ran, log_collection_time, cluster


if __name__ == '__main__':
Expand Down
5 changes: 4 additions & 1 deletion cluster_tests/testlib/testlib.py
Expand Up @@ -123,6 +123,9 @@ def run_testset(testset, cluster, total_testsets_num, seed=None,
_, err = safe_test_function_call(testset_instance, test,
[], testiter, verbose=True,
seed=test_seed)

cluster = testset_instance.cluster

if err is not None:
errors.append(err)

Expand Down Expand Up @@ -154,7 +157,7 @@ def run_testset(testset, cluster, total_testsets_num, seed=None,
if err is not None:
errors.append(err)

return executed, errors, not_ran
return executed, errors, not_ran, cluster


def test_name(testset, testname, testiter):
Expand Down

0 comments on commit 9e3aee6

Please sign in to comment.