From af986e017847385a104307cda1fb6592b7d8de8e Mon Sep 17 00:00:00 2001 From: yuxuan-ms <43603130+yuxuan-ms@users.noreply.github.com> Date: Mon, 21 Aug 2023 19:19:14 +0800 Subject: [PATCH] Fix interactive mode render issue. --- .../2590_changed.interactive_render_issue.rst | 1 + testplan/common/utils/comparison.py | 7 +++++-- testplan/web_ui/testing/src/Report/InteractiveReport.js | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) create mode 100755 doc/newsfragments/2590_changed.interactive_render_issue.rst diff --git a/doc/newsfragments/2590_changed.interactive_render_issue.rst b/doc/newsfragments/2590_changed.interactive_render_issue.rst new file mode 100755 index 000000000..f760b6f1d --- /dev/null +++ b/doc/newsfragments/2590_changed.interactive_render_issue.rst @@ -0,0 +1 @@ +Fix interactive mode table rendered with every poll (Bad UX scroll/highlight not maintained) \ No newline at end of file diff --git a/testplan/common/utils/comparison.py b/testplan/common/utils/comparison.py index 9aee97921..a207a08b6 100644 --- a/testplan/common/utils/comparison.py +++ b/testplan/common/utils/comparison.py @@ -329,8 +329,11 @@ def serialize(cls, obj): @classmethod def match(cls, regex, value): - - return Match.from_bool(bool(regex.match(value))) + try: + ret = bool(regex.match(value)) + except TypeError: + ret = False + return Match.from_bool(ret) @staticmethod def compare(lhs, rhs): diff --git a/testplan/web_ui/testing/src/Report/InteractiveReport.js b/testplan/web_ui/testing/src/Report/InteractiveReport.js index f2ae8b1d6..8f339c309 100644 --- a/testplan/web_ui/testing/src/Report/InteractiveReport.js +++ b/testplan/web_ui/testing/src/Report/InteractiveReport.js @@ -122,7 +122,9 @@ class InteractiveReportComponent extends BaseReport { response.data.runtime_status === "finished" || response.data.runtime_status === "not_run" ) { - this.setState({ resetting: false }); + if (this.state.resetting){ + this.setState({ resetting: false }); + } } if ( !this.state.report ||