Skip to content

Commit 73fa561

Browse files
authored
chore: upgrade functions framework to 1.0 (GoogleCloudPlatform#1519)
1 parent c1b12f3 commit 73fa561

File tree

25 files changed

+37
-26
lines changed

25 files changed

+37
-26
lines changed

functions/concepts_filesystem/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"require": {
3-
"google/cloud-functions-framework": "^0.8"
3+
"google/cloud-functions-framework": "^1.0"
44
},
55
"scripts": {
66
"start": [

functions/concepts_requests/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"require": {
3-
"google/cloud-functions-framework": "^0.8",
3+
"google/cloud-functions-framework": "^1.0",
44
"guzzlehttp/guzzle": "^7.2.0"
55
},
66
"scripts": {

functions/env_vars/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"require": {
3-
"google/cloud-functions-framework": "^0.8"
3+
"google/cloud-functions-framework": "^1.0"
44
},
55
"scripts": {
66
"start": [

functions/firebase_analytics/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"require": {
3-
"google/cloud-functions-framework": "^0.8.0"
3+
"google/cloud-functions-framework": "^1.0.0"
44
},
55
"scripts": {
66
"start": [

functions/firebase_firestore/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"require": {
3-
"google/cloud-functions-framework": "^0.8.0",
3+
"google/cloud-functions-framework": "^1.0.0",
44
"google/cloud-firestore": "^1.18"
55
},
66
"scripts": {

functions/firebase_firestore/test/DeployTest.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,14 @@ private static function doDeploy()
8383
);
8484
$event = 'providers/cloud.firestore/eventTypes/document.write';
8585

86-
return self::$fn->deploy([
86+
self::$fn->deploy([
8787
'--trigger-resource' => $resource,
8888
'--trigger-event' => $event
8989
], '');
90+
91+
// Sleep after deployment for a few seconds
92+
printf('Sleeping after deployment for %d second(s)' . PHP_EOL, $sleep = 30);
93+
sleep($sleep);
9094
}
9195

9296
public function dataProvider()
@@ -126,7 +130,7 @@ public function testFirebaseFirestore(array $data, string $expected): void
126130
// Only testing one property to decrease odds the expected logs are
127131
// split between log requests.
128132
$this->assertStringContainsString($expected, $actual);
129-
}, 5, 30);
133+
}, $retries = 6, $initialSleep = 10);
130134
}
131135

132136
/**

functions/firebase_remote_config/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"require": {
3-
"google/cloud-functions-framework": "^0.8.0"
3+
"google/cloud-functions-framework": "^1.0.0"
44
},
55
"scripts": {
66
"start": [

functions/firebase_remote_config/test/DeployTest.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,13 @@ private static function doDeploy()
6464

6565
$event = 'google.firebase.remoteconfig.update';
6666

67-
return self::$fn->deploy([
67+
self::$fn->deploy([
6868
'--trigger-event' => $event
6969
], '');
70+
71+
// Sleep after deployment for a few seconds
72+
printf('Sleeping after deployment for %d second(s)' . PHP_EOL, $sleep = 30);
73+
sleep($sleep);
7074
}
7175

7276
public function dataProvider()
@@ -118,7 +122,7 @@ public function testFirebaseRemoteConfig(
118122
// Only testing one property to decrease odds the expected logs are
119123
// split between log requests.
120124
$this->assertStringContainsString($expected, $actual, $label);
121-
}, 10, 60);
125+
}, $retries = 10, $intialSleep = 30);
122126
}
123127

124128
/**

functions/firebase_rtdb/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"require": {
3-
"google/cloud-functions-framework": "^0.8.0",
3+
"google/cloud-functions-framework": "^1.0.0",
44
"guzzlehttp/guzzle": "^7.2.0"
55
},
66
"scripts": {

functions/helloworld_get/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"require": {
3-
"google/cloud-functions-framework": "^0.8"
3+
"google/cloud-functions-framework": "^1.0"
44
},
55
"scripts": {
66
"start": [

functions/helloworld_http/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"require": {
3-
"google/cloud-functions-framework": "^0.8"
3+
"google/cloud-functions-framework": "^1.0"
44
},
55
"scripts": {
66
"start": [

functions/helloworld_log/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"require": {
3-
"google/cloud-functions-framework": "^0.8"
3+
"google/cloud-functions-framework": "^1.0"
44
},
55
"scripts": {
66
"start": [

functions/helloworld_pubsub/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"require": {
3-
"google/cloud-functions-framework": "^0.8.0"
3+
"google/cloud-functions-framework": "^1.0.0"
44
},
55
"scripts": {
66
"start": [

functions/helloworld_storage/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"require": {
3-
"google/cloud-functions-framework": "^0.8.0"
3+
"google/cloud-functions-framework": "^1.0.0"
44
},
55
"scripts": {
66
"start": [

functions/http_content_type/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"require": {
3-
"google/cloud-functions-framework": "^0.8"
3+
"google/cloud-functions-framework": "^1.0"
44
},
55
"scripts": {
66
"start": [

functions/http_cors/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"require": {
3-
"google/cloud-functions-framework": "^0.8"
3+
"google/cloud-functions-framework": "^1.0"
44
},
55
"scripts": {
66
"start": [

functions/http_form_data/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"require": {
3-
"google/cloud-functions-framework": "^0.8",
3+
"google/cloud-functions-framework": "^1.0",
44
"guzzlehttp/psr7": "^2.0"
55
},
66
"scripts": {

functions/http_method/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"require": {
3-
"google/cloud-functions-framework": "^0.8"
3+
"google/cloud-functions-framework": "^1.0"
44
},
55
"scripts": {
66
"start": [

functions/imagemagick/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"require": {
3-
"google/cloud-functions-framework": "^0.8",
3+
"google/cloud-functions-framework": "^1.0",
44
"google/cloud-storage": "^1.23",
55
"google/cloud-vision": "^1.2",
66
"ext-imagick": "*"

functions/slack_slash_command/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"require": {
3-
"google/cloud-functions-framework": "^0.8",
3+
"google/cloud-functions-framework": "^1.0",
44
"google/apiclient": "^2.8"
55
},
66
"scripts": {

functions/tips_infinite_retries/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"require": {
3-
"google/cloud-functions-framework": "^0.8.0"
3+
"google/cloud-functions-framework": "^1.0.0"
44
},
55
"scripts": {
66
"start": [

functions/tips_phpinfo/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"require": {
3-
"google/cloud-functions-framework": "^0.8.0"
3+
"google/cloud-functions-framework": "^1.0.0"
44
},
55
"scripts": {
66
"start": [

functions/tips_retry/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"require": {
3-
"google/cloud-functions-framework": "^0.8.0"
3+
"google/cloud-functions-framework": "^1.0.0"
44
},
55
"require-dev": {
66
"google/cloud-pubsub": "^1.29",

functions/tips_scopes/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"require": {
3-
"google/cloud-functions-framework": "^0.8.0"
3+
"google/cloud-functions-framework": "^1.0.0"
44
},
55
"scripts": {
66
"start": [

functions/tips_scopes/test/DeployTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ public function testFunction(): void
4444
// Uncomment and CURLOPT_VERBOSE debug content will be sent to stdout.
4545
// 'debug' => true
4646
]);
47+
48+
sleep(1); // avoid race condition
49+
4750
$secondResp = $this->client->post('', [
4851
// Uncomment and CURLOPT_VERBOSE debug content will be sent to stdout.
4952
// 'debug' => true

0 commit comments

Comments
 (0)