Skip to content

[AI Improvement] [Task] Deduplicate emulator test fixtures: drop dead functions fixtures from src/emulator/testing/fixtures.ts and storage fixtures from scripts/emulator-tests/fixtures.ts - #11362

Draft
joehan wants to merge 1 commit into
mainfrom
ai-improve-577232030-task-deduplicate-emulator-test-fixt
Draft

joehan wants to merge 1 commit into
mainfrom
ai-improve-577232030-task-deduplicate-emulator-test-fixt

Conversation

@joehan

@joehan joehan commented Oct 23, 2026

Copy link
Copy Markdown
Member

Description

Resolves Buganizer b/577232030 (Parent Goal b/563463614)

#7318 ("Move emulator tests") copied src/emulator/testing/fixtures.ts to scripts/emulator-tests/fixtures.ts and left both copies in place. Each copy carried dead code:

  1. In src/emulator/testing/fixtures.ts, the functions-emulator fixtures TIMEOUT_LONG, TIMEOUT_MED, MODULE_ROOT and FunctionRuntimeBundles had no importers (functions-emulator tests import them from their sibling scripts/emulator-tests/fixtures.ts). Removed the unused findModuleRoot, FunctionsRuntimeBundle import, TIMEOUT_*, MODULE_ROOT, and FunctionRuntimeBundles. Retained live storage fixtures: createTmpDir, IMAGE_FILE_BASE64, and StorageRulesFiles.
  2. In scripts/emulator-tests/fixtures.ts, IMAGE_FILE_BASE64 had no importer. StorageRulesFiles was a duplicate of the src/ copy, and the file ended with a commented-out storage rules block. Dropped IMAGE_FILE_BASE64, StorageRulesFiles, and the dead commented-out rules block. Retained live functions fixtures: TIMEOUT_*, MODULE_ROOT, and FunctionRuntimeBundles.
  3. In scripts/storage-emulator-integration/rules/runtime.test.ts, updated the import of StorageRulesFiles from ../../emulator-tests/fixtures to ../../../src/emulator/testing/fixtures, aligning it with sibling storage integration tests.

Net ~260 lines of dead and duplicated test fixtures removed.

Scenarios Tested

  • npm run build: Passed cleanly
  • npm run test:compile: Full type-check passed cleanly
  • npx tsc --noEmit -p tsconfig.json: Passed cleanly
  • npx tsc --noEmit -p scripts/emulator-tests/tsconfig.dev.json: Passed cleanly
  • npm run lint:quiet: Full repository lint and prettier checks passed with 0 errors
  • npx mocha src/emulator/storage/rules/config.spec.ts: Passed (7/7 passing)
  • Verified grep checks:
    • git grep -n -E "IMAGE_FILE_BASE64|StorageRulesFiles" -- scripts/emulator-tests (0 results)
    • git grep -n -E "TIMEOUT_LONG|MODULE_ROOT|FunctionRuntimeBundles" -- src (0 results)

Sample Commands

N/A (test-only refactoring)

…ons fixtures from src/emulator/testing/fixtures.ts and storage fixtures from scripts/emulator-tests/fixtures.ts (b/577232030)
@joehan joehan self-assigned this Oct 23, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request moves the StorageRulesFiles fixture and IMAGE_FILE_BASE64 from scripts/emulator-tests/fixtures.ts to src/emulator/testing/fixtures.ts to consolidate testing fixtures. It also cleans up unused constants and bundles in the process. There are no review comments to address.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant