Repository navigation
[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
Conversation
…ons fixtures from src/emulator/testing/fixtures.ts and storage fixtures from scripts/emulator-tests/fixtures.ts (b/577232030)
Contributor
There was a problem hiding this comment.
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
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.
Description
Resolves Buganizer b/577232030 (Parent Goal b/563463614)
#7318 ("Move emulator tests") copied
src/emulator/testing/fixtures.tstoscripts/emulator-tests/fixtures.tsand left both copies in place. Each copy carried dead code:src/emulator/testing/fixtures.ts, the functions-emulator fixturesTIMEOUT_LONG,TIMEOUT_MED,MODULE_ROOTandFunctionRuntimeBundleshad no importers (functions-emulator tests import them from their siblingscripts/emulator-tests/fixtures.ts). Removed the unusedfindModuleRoot, FunctionsRuntimeBundleimport,TIMEOUT_*,MODULE_ROOT, andFunctionRuntimeBundles. Retained live storage fixtures:createTmpDir,IMAGE_FILE_BASE64, andStorageRulesFiles.scripts/emulator-tests/fixtures.ts,IMAGE_FILE_BASE64had no importer.StorageRulesFileswas a duplicate of thesrc/copy, and the file ended with a commented-out storage rules block. DroppedIMAGE_FILE_BASE64,StorageRulesFiles, and the dead commented-out rules block. Retained live functions fixtures:TIMEOUT_*,MODULE_ROOT, andFunctionRuntimeBundles.scripts/storage-emulator-integration/rules/runtime.test.ts, updated the import ofStorageRulesFilesfrom../../emulator-tests/fixturesto../../../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 cleanlynpm run test:compile: Full type-check passed cleanlynpx tsc --noEmit -p tsconfig.json: Passed cleanlynpx tsc --noEmit -p scripts/emulator-tests/tsconfig.dev.json: Passed cleanlynpm run lint:quiet: Full repository lint and prettier checks passed with 0 errorsnpx mocha src/emulator/storage/rules/config.spec.ts: Passed (7/7 passing)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)