Repository navigation
test(mcp-server-supabase): make the generatePassword symbols test deterministic - #501
Merged
Merged
Conversation
Coverage Report for CI Build 40853173030Warning No base build found for commit Coverage: 97.62%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsRequires a base build to compare against. How to fix this → Coverage Stats💛 - Coveralls |
Rodriguespn
approved these changes
Oct 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What kind of change does this PR introduce?
Test fix (flaky test). Test-only, one file, no package or changelog impact.
What is the current behavior?
should generate a password with symbolsinpackages/mcp-server-supabase/src/password.test.tsis flaky. It failed the Tests job on #500 and passed on rerun.The test calls
generatePassword({ symbols: true })and asserts at least one symbol. That draws 10 characters uniformly from letters + symbols, and nothing guarantees a symbol appears. The regex also had/-=inside the character class, which is a range from/to=, so digits counted as symbols and a literal-didn't. Together that makes it fail about 1.4% of runs: (53/81)^10, where 53 is the 52 letters plus-.What is the new behavior?
The test disables letters, like the existing
with numberstest already does, and asserts no character is a letter or digit. It can't fail by chance any more, and it fails on every run if the symbols option adds nothing or adds letters or digits instead of symbols.I fixed the test and left
generatePasswordalone. Its only production caller iscreateProject, which generates a 16-characterdb_passfrom letters and numbers and never enables symbols. The Management API types givedb_passas a plain string with no character-class rule. So the options choose which sets to draw from without promising that each set appears, and changing the generator would change behavior that nothing depends on.Verification
pnpm --filter @supabase/mcp-server-supabase exec vitest run src/password.test.tspasses, and repeat runs stay green. MutatinggeneratePasswordso the symbols option adds nothing, or adds uppercase letters or digits instead of symbols, fails the test on every run.