fix(tests): fix i18n tests [skip ci] #2950
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The tests were failing on #2924 but i thought it was just the CI being flaky… surely changing one word in a comment wouldn’t cause the entire test suite to hang! So i merged it.
Boy was I wrong. Turns out that the i18n tests actually greps the filesystem looking for instances of the
translate()
function, extracts their keys, and then compares those keys to the list inside the translation files.This
grep
command doesn’t take commented code into consideration so it sees these blocks of code as equally valid instances of thetranslate()
function:So the test will look for
["key1", "key2", "key3"]
and make sure the translations exist instead of just["key1"]
like we'd expect.To solve this, I added the key
”hello”
to the EXCEPTIONS list with a large comment above it about why... so that this comment will no longer cause the test suite to hang and eventually fail.Checklist