Skip to content

Commit

Permalink
Add CloudStorageEmulatorContainer and PubSubEmulatorContainer to …
Browse files Browse the repository at this point in the history
…gcloud module (#805)
  • Loading branch information
weyert authored Aug 22, 2024
1 parent 6e1213b commit ce6a032
Show file tree
Hide file tree
Showing 8 changed files with 910 additions and 38 deletions.
22 changes: 19 additions & 3 deletions docs/modules/gcloud.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ Testcontainers module for the Google Cloud Platform's [Cloud SDK](https://cloud.
npm install @testcontainers/gcloud --save-dev
```

Currently, the module supports `Firestore` emulators in Native mode and Datastore mode. In order to use them, you should use the following classes:
The module now supports multiple emulators, including `firestore`, which offers both `native` and `datastore` modes.
To utilize these emulators, you should employ the following classes:

Mode | Class | Container Image
-|-|-
Native mode | FirestoreEmulatorContainer | [gcr.io/google.com/cloudsdktool/google-cloud-cli:emulators](https://gcr.io/google.com/cloudsdktool/google-cloud-cli)
Datastore mode | DatastoreEmulatorContainer | [gcr.io/google.com/cloudsdktool/google-cloud-cli:emulators](https://gcr.io/google.com/cloudsdktool/google-cloud-cli)
Firestore Native mode | FirestoreEmulatorContainer | [gcr.io/google.com/cloudsdktool/google-cloud-cli:emulators](https://gcr.io/google.com/cloudsdktool/google-cloud-cli)
Firestore Datastore mode | DatastoreEmulatorContainer | [gcr.io/google.com/cloudsdktool/google-cloud-cli:emulators](https://gcr.io/google.com/cloudsdktool/google-cloud-cli)
Cloud PubSub mode |PubSubEmulatorContainer | [gcr.io/google.com/cloudsdktool/google-cloud-cli:emulators](https://gcr.io/google.com/cloudsdktool/google-cloud-cli)
Cloud Storage mode |CloudStorageEmulatorContainer | [https://hub.docker.com/r/fsouza/fake-gcs-server](https://hub.docker.com/r/fsouza/fake-gcs-server)

## Examples

Expand All @@ -36,3 +39,16 @@ Datastore mode | DatastoreEmulatorContainer | [gcr.io/google.com/cloudsdktool/g
<!--codeinclude-->
[Starting a Datastore Emulator container with a custom emulator image](../../packages/modules/gcloud/src/datastore-emulator-container.test.ts) inside_block:datastore5
<!--/codeinclude-->

### Cloud PubSub mode

<!--codeinclude-->
[Starting a Cloud PubSub Emulator container with the default image](../../packages/modules/gcloud/src/pubsub-emulator-container.test.ts) inside_block:pubsub6
<!--/codeinclude-->

### Cloud Storage mode

The Cloud Storage mode doesn't rely on a built-in emulator created by Google but instead depends on a fake Cloud Storage server implemented by [Francisco Souza](https://github.com/fsouza). The project is open-source, and the repository can be found at [fsouza/fake-gcs-server](https://github.com/fsouza/fake-gcs-server).
<!--codeinclude-->
[Starting a Cloud Storage Emulator container with the default image](../../packages/modules/gcloud/src/cloudstorage-emulator-container.test.ts) inside_block:cloudstorage7
<!--/codeinclude-->
Loading

0 comments on commit ce6a032

Please sign in to comment.