-
-
Notifications
You must be signed in to change notification settings - Fork 949
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
CI failure in git.commitEntry test #1803
Comments
Also: VITEST_SEQUENCE_SEED 1675271531940 |
The same error again: VITEST_SEQUENCE_SEED 1675275945101 https://github.com/faker-js/faker/actions/runs/4067493397/jobs/7004904658 |
the name comes from Whereas the regex only allows \w (which doesn't include '), . and space. So blindly adding ' would indeed fix it. If the same test was run in other locales, it would still fail as they could contain other unicode chars. But as the test is only run in English at the moment i think this would suffice. |
btw is there any way in the logs to make it print out the full string for expected value? The way it ellipsizes the full value is annoying. |
Vitest also has a documentation website, even with search function Now the funny part: the option does not work 🤦 |
I would still like to know which characters are allowed there (and how it is called). |
We could see the failing test as an implementation error as well.
This could be solved by defining that the generated user is always a username instead of using a fullname. |
Unicode characters are permissible according to https://stackoverflow.com/questions/24845258/is-it-ok-to-use-a-long-non-ascii-name-for-the-user-name-git-configuration |
Honestly I'd just add the ' for now to fix the intermittent CI errors and leave a TODO to revisit this later if tests are added for every locale. Regex for Unicode text can be quite tricky, and I don't think this is a heavily used method in faker. |
vite repo `git log --pretty=format:%an | sort -u` 👀
|
instead of i noticed if i do so it seems to be stripping out angle brackets to avoid confusion with the email |
bit more info on stripping: |
Now we coming closer to an appropriated solution 👍 |
So we should actually refactor the implementation to normalize the username/full name before using it in the commit entry. |
What are you referring to with normalization? IMO we should make sure we pass the correct validation, but for that we need to actually have the correct validation. |
They mean normalize the generated values inside faker/src/modules/git/index.ts Lines 108 to 122 in 1ae2f6f
Like doing an extra step in line 114 for variable |
Hmm how would you test that though considering fullName never includes a < |
VITEST_SEQUENCE_SEED 1675266128640
https://github.com/faker-js/faker/actions/runs/4066068064/jobs/7002435580
The regex needs to be checked for correctness (blindy adding
'
is a non goal).The text was updated successfully, but these errors were encountered: