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

Fix parametrization reload #983

Merged
merged 5 commits into from
Aug 17, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed an issue whereas changes to a parametric testcases were not reflected on the interactive GUI upon reload.
31 changes: 22 additions & 9 deletions testplan/runnable/interactive/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -797,16 +797,29 @@ def reload_report(self):
len(new_report[mt.uid][st.uid].entries)
): # testcase level
try:
# Update new report testcase state
new_report[mt.uid][st.uid].entries[
new_case_index
] = st[
new_report[mt.uid][st.uid]
.entries[new_case_index]
.uid
]
tc = new_report[mt.uid][st.uid].entries[new_case_index]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider to introduce temporary variables instead of those long indexing chains. Speaking names could make this more(euphemism) readable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved most of it to enumerate.

if isinstance(tc, TestGroupReport):
for new_param_idx in range(
len(new_report[mt.uid][st.uid][tc.uid].entries)
): # parametrization level
try:
new_report[mt.uid][st.uid][tc.uid].entries[
new_param_idx
] = st[tc.uid][
tc.entries[new_param_idx].uid
]
except KeyError: # new parametrization
continue
else:
new_report[mt.uid][st.uid].entries[
new_case_index
] = st[
new_report[mt.uid][st.uid]
.entries[new_case_index]
.uid
]
except KeyError: # new testcase
pass
continue
mt.entries[st_index] = new_st

def _setup_http_handler(self):
Expand Down