Conversation
Because: it was disabled during the Mocha->Jest migration since it needs a config/oldKey.json that isn't generated by default (the oauth_gen_keys keysExist short-circuit skips it), and the key-rotation behavior it checked is already covered deterministically by lib/oauth/keys.spec.ts and lib/routes/oauth/jwks.spec.ts. This commit: deletes the dead it.skip rather than reviving it behind fragile boot-time key provisioning. FXA-13262
Contributor
There was a problem hiding this comment.
Pull request overview
Removes a redundant, permanently skipped /jwks integration test from the auth server remote integration suite, reducing dead/fragile test code after the Mocha→Jest migration.
Changes:
- Deletes the skipped
should include the oldKey if presenttest from the/jwksintegration block. - Removes the associated comment describing the
config/oldKey.jsondependency.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
vbudhram
approved these changes
Jun 11, 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.
Because
The
it.skip('should include the oldKey if present')test inoauth_api.in.spec.tsneeds removed.History: in Mocha this was a normal running test. It was skipped during the migration. Its first assertion,
expect(config.get('oauthServer.openid.oldKey')).toBeTruthy(), fails deterministically wheneverconfig/oldKey.jsonis absent (config resolvesoldKeytonull). It was disabled to get the suite green, not because of any flakiness.Could we just generate
oldKey.json? Yes,scripts/oauth_gen_keys.jswrites a fake public-only old key for dev/test. However, it short-circuits onkeysExist(ifkey.jsonalready exists it returns before writingoldKey.json), which is exactly why it's "not generated by default." Making the integration test reliable would require guaranteeingoldKey.jsonexists at server boot for the whole oauth suite adding a global, boot-time, ordering-coupled setup dependency for a single assertion.Shift-left decision: the behavior this test checked is already covered at the unit layer, with no key files required:
lib/oauth/keys.spec.ts: the full key-rotation matrix (current-only, current+new, current+new+old) plus public-only shape and distinctkids, via mocked config.lib/routes/oauth/jwks.spec.ts: the/jwksroute returnsPUBLIC_KEYS./jwksintegration test already exercises the real HTTP path (status, cache headers, no private component) for the single-key case.So the integration version adds essentially nothing the unit tests don't, at real setup cost. Deleting it removes a fragile, redundant test rather than propping it up
This pull request
should include the oldKey if presenttest frompackages/fxa-auth-server/test/remote/oauth_api.in.spec.ts.Issue that this pull request solves
Closes: FXA-13262
Checklist
Put an
xin the boxes that applyHow to review (Optional)
cd packages/fxa-auth-server && node ../../node_modules/jest/bin/jest.js lib/oauth/keys.spec.ts lib/routes/oauth/jwks.spec.ts→ 16 tests green, covering the deleted test's behavior.