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 utf8 tests #8192

Merged
merged 9 commits into from
Sep 21, 2019
Merged

Fix utf8 tests #8192

merged 9 commits into from
Sep 21, 2019

Conversation

guillep2k
Copy link
Member

modules/charset/ tests have been failing randomly. My guess, once again, is the LOCALE on the CI server might be producing diferent compilation results when the compiler parses the strings.

This time around I've eliminated all but the simplest string literals, e.g.:

res = ToUTF8("áéíóú")

changed into

res = ToUTF8(string([]byte{0xef, 0xbb, 0xbf, 0xc3, 0xa1, 0xc3, 0xa9, 0xc3, 0xad, 0xc3, 0xb3,
		0xc3, 0xba}))

I hope this is the solution. Otherwise, I'd recommend just removing all the UTF8 test.

@codecov-io
Copy link

codecov-io commented Sep 15, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@73f7e82). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #8192   +/-   ##
=========================================
  Coverage          ?   41.58%           
=========================================
  Files             ?      488           
  Lines             ?    65211           
  Branches          ?        0           
=========================================
  Hits              ?    27116           
  Misses            ?    34607           
  Partials          ?     3488
Impacted Files Coverage Δ
modules/charset/charset.go 69.56% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 73f7e82...6da827b. Read the comment docs.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Sep 15, 2019
@lunny
Copy link
Member

lunny commented Sep 16, 2019

how about to set a locale on tests?

@guillep2k
Copy link
Member Author

how about to set a locale on tests?

@lunny As I understand it the problem is the compiler's locale, not the actual code. When the compiler parses the strings to generate code, it's got rules and defaults to deal with invalid data that are (or should be) based in the locale. What we could do is to set a LOCALE in the Makefile to force one during compilation.

Anyway, with the changes I've made in this PR that shouldn't be necessary, as all the strings are generated from bytes in the code and I've attempted to isolate all the conflicting strings as much as possible. The compiler's locale should no longer affect the generated code nor the test run.

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Sep 17, 2019
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Sep 20, 2019
@techknowlogick
Copy link
Member

ping LG-TM bot

@techknowlogick techknowlogick merged commit 2628b15 into go-gitea:master Sep 21, 2019
@guillep2k guillep2k deleted the fix-utf8-tests branch October 3, 2019 22:55
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants