Skip to content

Commit

Permalink
Merge pull request #27 from redpanda-data/cdt-vtools-2043-report-cmd-…
Browse files Browse the repository at this point in the history
…line

ducktape: Save command line on start and add it to HTML report
  • Loading branch information
savex authored Sep 12, 2023
2 parents 62e0285 + 51ef2b8 commit 71a2932
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ducktape/command_line/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def main():
deflake_num = max(1, deflake_num)
runner = TestRunner(cluster, session_context, session_logger, tests, deflake_num)
test_results = runner.run_all_tests()

test_results.command_line = " ".join(sys.argv)
# Report results
reporters = [
SimpleStdoutSummaryReporter(test_results),
Expand Down
4 changes: 3 additions & 1 deletion ducktape/templates/report/report.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ <h1>
</h1>
<p>Test Session: {this.props.heading.session}</p>
<p>Ducktape Version: {this.props.heading.ducktape_version}</p>
<p>Command line: {this.props.heading.command_line}</p>
</div>
);
}
Expand Down Expand Up @@ -196,7 +197,8 @@ <h2>{this.props.title}</h2>

HEADING={
"ducktape_version": '%(ducktape_version)s',
"session": '%(session)s'
"session": '%(session)s',
"command_line": '%(command_line)s'
};

COLOR_KEYS=[%(test_status_names)s];
Expand Down
1 change: 1 addition & 0 deletions ducktape/tests/reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ def format_report(self):

args = {
'ducktape_version': ducktape_version(),
'command_line': self.results.command_line,
'num_tests': num_tests,
'num_passes': self.results.num_passed,
'num_flaky': self.results.num_flaky,
Expand Down
2 changes: 1 addition & 1 deletion ducktape/tests/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def __init__(self, session_context, cluster):
self._results = []
self.session_context = session_context
self.cluster = cluster

self.command_line = ""
# For tracking total run time
self.start_time = -1
self.stop_time = -1
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ pycryptodome==3.9.8
more-itertools==5.0.0
tox==3.20.0
six==1.15.0
PyYAML==6.0
PyYAML==6.0.1

0 comments on commit 71a2932

Please sign in to comment.