Skip to content

test(a2a-server): migrate process.env to vi.stubEnv() per GEMINI.md conventions #19826

Description

@krrishverma1805-web

Description

Per the testing conventions documented in GEMINI.md:

When testing code that depends on environment variables, use
vi.stubEnv('NAME', 'value') in beforeEach and
vi.unstubAllEnvs() in afterEach. Avoid modifying process.env
directly as it can lead to test leakage and is less reliable.

Several test files in packages/a2a-server/ still use direct
process.env manipulation:

  • src/commands/init.test.ts (1 direct assignment)
  • src/config/config.test.ts (~8 direct assignments/deletions)
  • src/http/app.test.ts (3 direct assignments/deletions)

Proposed fix

Replace all direct process.env writes and deletes with
vi.stubEnv() / vi.unstubAllEnvs() following the pattern
documented in GEMINI.md.

I'd be happy to submit a PR for this.

Metadata

Metadata

Labels

Stalearea/platformIssues related to Build infra, Release mgmt, Testing, Eval infra, Capacity, Quota mgmtgood first issuehelp wantedWe will accept PRs from all issues marked as "help wanted". Thanks for your support!kind/bugkind/customer-issueIssues that were reported by customerspriority/p3Backlog - a good idea but not currently a priority.status/bot-triaged

Type

Fields

No fields configured for Bug.

Projects

Status
No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions