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

Cleanup and handleSummaryResult() tests #1803

Merged
merged 6 commits into from
Jan 18, 2021
Merged

Cleanup and handleSummaryResult() tests #1803

merged 6 commits into from
Jan 18, 2021

Conversation

na--
Copy link
Member

@na-- na-- commented Jan 15, 2021

There were a few other things I wondered if I should fix in the current Go summary code, but at this point in time I'll probably just fix them in the upcoming JS replacement... For example, this code: https://github.com/loadimpact/k6/blob/c00a85bfea21d748f0f9d11fdbc326087f34c411/ui/summary.go#L91

Should be

if !inEscSeq && !inLongEscSeq {
	n++
}

i.e. that StrWidth() function is completely broken... 🤦‍♂️ But this turns not to matter one bit, since almost all of the errors are by the same margin and mostly cancel out... 🤣 Not to mention that the Unicode normalization it tries to do might actually be worse than not doing anything at all: https://github.com/loadimpact/k6/blob/c00a85bfea21d748f0f9d11fdbc326087f34c411/ui/summary.go#L64-L65

See this MDN article for a good explanation of the various normalization modes, and why NFC or NFKC (or even doing nothing) might be better for our use case than NFKD. On the other hand, not even they are sufficient, so maybe it doesn't really matter and everything in life is pointless: https://hsivonen.fi/string-length/ 😭 😅 🤣

Anyway, I think this is the final summary-related PR before v0.30.0.

@na-- na-- requested review from mstoykov and imiric January 15, 2021 13:33
mstoykov
mstoykov previously approved these changes Jan 15, 2021
Copy link
Contributor

@mstoykov mstoykov left a comment

Choose a reason for hiding this comment

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

LGTM!

I opted to not read the linked stuff ... for now :P

@na--
Copy link
Member Author

na-- commented Jan 15, 2021

You are very wise... 😅 ugh, I'll have to remember how to fix the windows fs tests now...

js/summary.go Show resolved Hide resolved
@na-- na-- mentioned this pull request Jan 18, 2021
imiric
imiric previously approved these changes Jan 18, 2021
@na-- na-- merged commit 45fff81 into master Jan 18, 2021
@na-- na-- deleted the handle-summary-changes branch January 18, 2021 15:11
@na-- na-- added this to the v0.30.0 milestone Jan 19, 2021
salem84 pushed a commit to salem84/k6 that referenced this pull request Feb 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants