user592419
user592419

Reputation: 5233

How do I test a google cloud function that uses a storage upload to trigger?

It's exceptionally slow to test this by uploading files. Is there a better way?

Upvotes: 1

Views: 540

Answers (1)

John Hanley
John Hanley

Reputation: 81454

In my development and testing, I capture one of the messages that triggers Cloud Functions. These messages are just JSON, so save it to a file and then send back to the function.

Usually, I develop my code locally and run at my desktop. Then I use tools such as curl to call my code. Once I have completed development and testing, I move to the cloud and use the same tools to call the Cloud Functions endpoint using Stackdriver to log messages to.

Upvotes: 2

Related Questions