Skip to content

Delete old emulators on download #1519

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 17, 2019
Merged

Delete old emulators on download #1519

merged 3 commits into from
Jul 17, 2019

Conversation

samtstern
Copy link
Contributor

@samtstern samtstern commented Jul 17, 2019

Description

Fixes #1439

Scenarios Tested

Removing old JARs

# 1) Check the cache
$ ls ~/.cache/firebase/emulators/
cloud-firestore-emulator-v1.6.0.jar  cloud-firestore-emulator-v1.6.1.jar  firebase-database-emulator-v4.0.0.jar

# 2) Start the Firestore emulator, it downloads the new version and removes the old ones 
$ npx firebase emulators:start --only firestore
i  Starting emulators: ["firestore"]
i  firestore: downloading cloud-firestore-emulator-v1.6.2.jar...
Progress: ===============================================================================================================> (100% of 58MB)
i  firestore: Removing outdated emulator: cloud-firestore-emulator-v1.6.0.jar
i  firestore: Removing outdated emulator: cloud-firestore-emulator-v1.6.1.jar
i  firestore: Logging to firestore-debug.log
✔  firestore: Emulator started at http://localhost:8080
i  firestore: For testing set FIRESTORE_EMULATOR_HOST=localhost:8080
^Ci  Shutting down emulators.
i  Stopping firestore emulator

#3) Check the cache again
$ ls ~/.cache/firebase/emulators/
cloud-firestore-emulator-v1.6.2.jar  firebase-database-emulator-v4.0.0.jar

#4) Start the emulator, no download or removal
$ npx firebase emulators:start --only firestore
i  Starting emulators: ["firestore"]
i  firestore: Logging to firestore-debug.log
✔  firestore: Emulator started at http://localhost:8080
i  firestore: For testing set FIRESTORE_EMULATOR_HOST=localhost:8080
^Ci  Shutting down emulators.
i  Stopping firestore emulator

CI Download Warning

$ CI=true npx firebase emulators:start --only firestore
i  Starting emulators: ["firestore"]
⚠  It appears you are running in a CI environment. You can avoid downloading the firestore emulator repeatedly by caching the /usr/local/google/home/samstern/.cache/firebase/emulators directory.
i  firestore: downloading cloud-firestore-emulator-v1.6.2.jar...
Progress: ===============================================================================================================> (100% of 58MB)
i  firestore: Logging to firestore-debug.log
✔  firestore: Emulator started at http://localhost:8080
i  firestore: For testing set FIRESTORE_EMULATOR_HOST=localhost:8080

Sample Commands

@googlebot googlebot added the cla: yes Manual indication that this has passed CLA. label Jul 17, 2019
@samtstern samtstern requested a review from ryanpbrewster July 17, 2019 18:29
Copy link
Contributor

@bkendall bkendall left a comment

Choose a reason for hiding this comment

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

changelog.txt!

@coveralls
Copy link

coveralls commented Jul 17, 2019

Coverage Status

Coverage decreased (-0.2%) to 62.067% when pulling 1ab882e on ss-jar-cleanup into 9d2b93a on master.

Copy link
Contributor

@bkendall bkendall left a comment

Choose a reason for hiding this comment

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

So good. Love it.

@samtstern samtstern merged commit 84ef4d5 into master Jul 17, 2019
@samtstern samtstern deleted the ss-jar-cleanup branch July 17, 2019 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Manual indication that this has passed CLA.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improvements to emulator JAR management
5 participants