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

Change the AuthenticationTest log file name to indicate result #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
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
12 changes: 10 additions & 2 deletions src/ipaperftest/plugins/authenticationtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,15 +224,23 @@ def post_process_logs(self, ctx):
)

if total_percentage == 100:
msg = "success"
yield Result(self, SUCCESS, msg="All threads succeded.")
else:
msg = "fails"
yield Result(self, ERROR,
error="Not all threads succeeded: %s/%s (%s)."
% (total_successes, total_threads, total_percentage))

self.results_archive_name = "AuthenticationTest-{}-{}-{}threads-{}fails".format(
amount = ctx.params["amount"]
threads = ctx.params["threads"]

self.results_archive_name = "AuthenticationTest-{}-{}-{}-{}-{}threads-{}{}".format(
datetime.now().strftime("%FT%H%MZ"),
ctx.params['server_image'].replace("/", ""),
amount,
threads,
total_threads,
total_successes
total_successes,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Here, if msg is fails, it will be shown alongside the successes (from total_successes). We could add a conditional so that fails are only shown if there were any, or to be consistent we can just show fails always and for a successful run it would show as 0fails (total_threads - total_succeses).

So it would behave like:
10 threads, 10 successes: 0fails
10 threads, 6 successes: 4fails
10 threads, 0 successes: 10fails

What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Having something unique to regex on to find the successes when doing ranges of tests is handy. I guess 0fails could be that thing but just looking for success is simpler IMHO.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, that works too. But then we can remove the msg variable and just put "successes" on the string.

msg
)