4
4
set -e
5
5
6
6
function usage {
7
- echo " Usage: $0 <project_id_node_6 > [<project_id_node_8 >]"
7
+ echo " Usage: $0 <project_id_node_8 > [<project_id_node_10 >]"
8
8
exit 1
9
9
}
10
10
11
- # This script takes 1 or 2 params , both of which are Firebase project ids.
12
- # If there is only one given, that project will be used for both node6 and node8
13
- # Otherwise, param1 will be used for node6
14
- # and param2 will be used for node8
15
- # The first parameter is required and is the Firebase project id .
11
+ # This script takes 1 or 2 arguments , both of which are Firebase project ids.
12
+ # If only one argument is given, that project will be used for both node 8 and node 10
13
+ # Otherwise, first argument will be used for node 8 and second argument will be used
14
+ # for node 10.
15
+ # Note that at least one argument is required .
16
16
if [[ $1 == " " ]]; then
17
17
usage
18
18
fi
19
19
if [[ $2 == " " ]]; then
20
- PROJECT_ID_NODE_6=$1
21
20
PROJECT_ID_NODE_8=$1
21
+ PROJECT_ID_NODE_10=$1
22
22
else
23
- PROJECT_ID_NODE_6 =$1
24
- PROJECT_ID_NODE_8 =$2
23
+ PROJECT_ID_NODE_8 =$1
24
+ PROJECT_ID_NODE_10 =$2
25
25
fi
26
26
27
27
# Directory where this script lives.
@@ -39,18 +39,18 @@ function build_sdk {
39
39
mv firebase-functions-* .tgz integration_test/functions/firebase-functions.tgz
40
40
}
41
41
42
- function pick_node6 {
43
- cd $DIR
44
- PROJECT_ID=$PROJECT_ID_NODE_6
45
- cp package.node6.json functions/package.json
46
- }
47
-
48
42
function pick_node8 {
49
43
cd $DIR
50
44
PROJECT_ID=$PROJECT_ID_NODE_8
51
45
cp package.node8.json functions/package.json
52
46
}
53
47
48
+ function pick_node10 {
49
+ cd $DIR
50
+ PROJECT_ID=$PROJECT_ID_NODE_10
51
+ cp package.node10.json functions/package.json
52
+ }
53
+
54
54
function install_deps {
55
55
announce " Installing dependencies..."
56
56
cd $DIR /functions
@@ -63,9 +63,9 @@ function delete_all_functions {
63
63
cd $DIR
64
64
# Try to delete, if there are errors it is because the project is already empty,
65
65
# in that case do nothing.
66
- firebase functions:delete callableTests createUserTests databaseTests deleteUserTests firestoreTests integrationTests pubsubTests remoteConfigTests --force --project=$PROJECT_ID_NODE_6 || : &
67
- if ! [[ $PROJECT_ID_NODE_6 == $PROJECT_ID_NODE_8 ]]; then
68
- firebase functions:delete callableTests createUserTests databaseTests deleteUserTests firestoreTests integrationTests pubsubTests remoteConfigTests --force --project=$PROJECT_ID_NODE_8 || : &
66
+ firebase functions:delete callableTests createUserTests databaseTests deleteUserTests firestoreTests integrationTests pubsubTests remoteConfigTests --force --project=$PROJECT_ID_NODE_8 || : &
67
+ if ! [[ $PROJECT_ID_NODE_8 == $PROJECT_ID_NODE_10 ]]; then
68
+ firebase functions:delete callableTests createUserTests databaseTests deleteUserTests firestoreTests integrationTests pubsubTests remoteConfigTests --force --project=$PROJECT_ID_NODE_10 || : &
69
69
fi
70
70
wait
71
71
announce " Project emptied."
@@ -96,14 +96,14 @@ function run_all_tests {
96
96
if [[ $FIREBASE_FUNCTIONS_URL == " https://preprod-cloudfunctions.sandbox.googleapis.com" ]]; then
97
97
TEST_DOMAIN=" txcloud.net"
98
98
fi
99
- TEST_URL_NODE_6=" https://us-central1-$PROJECT_ID_NODE_6 .$TEST_DOMAIN /integrationTests"
100
99
TEST_URL_NODE_8=" https://us-central1-$PROJECT_ID_NODE_8 .$TEST_DOMAIN /integrationTests"
101
- echo $TEST_URL_NODE_6
100
+ TEST_URL_NODE_10= " https://us-central1- $PROJECT_ID_NODE_10 . $TEST_DOMAIN /integrationTests "
102
101
echo $TEST_URL_NODE_8
103
- curl --fail $TEST_URL_NODE_6 & NODE6PID= $!
102
+ echo $TEST_URL_NODE_10
104
103
curl --fail $TEST_URL_NODE_8 & NODE8PID=$!
105
- wait $NODE6PID && echo ' node 6 passed ' || (announce ' Node 6 tests failed ' ; cleanup ; announce ' Tests failed ' ; exit 1)
104
+ curl --fail $TEST_URL_NODE_10 & NODE10PID= $!
106
105
wait $NODE8PID && echo ' node 8 passed' || (announce ' Node 8 tests failed' ; cleanup; announce ' Tests failed' ; exit 1)
106
+ wait $NODE10PID && echo ' node 10 passed' || (announce ' Node 10 tests failed' ; cleanup; announce ' Tests failed' ; exit 1)
107
107
}
108
108
109
109
function run_tests {
@@ -137,18 +137,19 @@ install_deps
137
137
delete_all_functions
138
138
announce " Deploying functions to Node 8 runtime ..."
139
139
deploy
140
- if [[ $PROJECT_ID_NODE_6 == $PROJECT_ID_NODE_8 ]]; then
140
+ if [[ $PROJECT_ID_NODE_8 == $PROJECT_ID_NODE_10 ]]; then
141
141
waitForPropagation
142
142
run_tests
143
143
fi
144
- pick_node6
145
- announce " Re-deploying the same functions to Node 6 runtime ..."
146
- deploy
147
- waitForPropagation
148
- if [[ $PROJECT_ID_NODE_6 == $PROJECT_ID_NODE_8 ]]; then
149
- run_tests
150
- else
151
- run_all_tests
152
- fi
144
+ # TODO(b/134418760): Uncomment this when Node 10 issues are fixed
145
+ # pick_node10
146
+ # announce "Re-deploying the same functions to Node 10 runtime ..."
147
+ # deploy
148
+ # waitForPropagation
149
+ # if [[ $PROJECT_ID_NODE_8 == $PROJECT_ID_NODE_10 ]]; then
150
+ # run_tests
151
+ # else
152
+ # run_all_tests
153
+ # fi
153
154
cleanup
154
155
announce " All tests pass!"
0 commit comments