Skip to content

Commit c4ff972

Browse files
authored
Remove Node 6 from Integration Tests (#459)
* update integration tests: remove node6, add node10 * add tracking bug for Node 10, move functions around * nit fix
1 parent ff1d203 commit c4ff972

File tree

3 files changed

+38
-37
lines changed

3 files changed

+38
-37
lines changed

integration_test/package.node6.json renamed to integration_test/package.node10.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"@google-cloud/pubsub": "~0.19.0",
99
"@types/google-cloud__pubsub": "^0.18.0",
1010
"@types/lodash": "~4.14.41",
11-
"firebase-admin": "^7.0.0",
11+
"firebase-admin": "^8.0.0",
1212
"firebase-functions": "./firebase-functions.tgz",
1313
"lodash": "~4.17.2"
1414
},
@@ -17,7 +17,7 @@
1717
"typescript": "~3.1.0"
1818
},
1919
"engines": {
20-
"node": "6"
20+
"node": "10"
2121
},
2222
"private": true
23-
}
23+
}

integration_test/package.node8.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"@google-cloud/pubsub": "~0.19.0",
99
"@types/google-cloud__pubsub": "^0.18.0",
1010
"@types/lodash": "~4.14.41",
11-
"firebase-admin": "^7.0.0",
11+
"firebase-admin": "^8.0.0",
1212
"firebase-functions": "./firebase-functions.tgz",
1313
"lodash": "~4.17.2"
1414
},
@@ -20,4 +20,4 @@
2020
"node": "8"
2121
},
2222
"private": true
23-
}
23+
}

integration_test/run_tests.sh

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,24 @@
44
set -e
55

66
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>]"
88
exit 1
99
}
1010

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.
1616
if [[ $1 == "" ]]; then
1717
usage
1818
fi
1919
if [[ $2 == "" ]]; then
20-
PROJECT_ID_NODE_6=$1
2120
PROJECT_ID_NODE_8=$1
21+
PROJECT_ID_NODE_10=$1
2222
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
2525
fi
2626

2727
# Directory where this script lives.
@@ -39,18 +39,18 @@ function build_sdk {
3939
mv firebase-functions-*.tgz integration_test/functions/firebase-functions.tgz
4040
}
4141

42-
function pick_node6 {
43-
cd $DIR
44-
PROJECT_ID=$PROJECT_ID_NODE_6
45-
cp package.node6.json functions/package.json
46-
}
47-
4842
function pick_node8 {
4943
cd $DIR
5044
PROJECT_ID=$PROJECT_ID_NODE_8
5145
cp package.node8.json functions/package.json
5246
}
5347

48+
function pick_node10 {
49+
cd $DIR
50+
PROJECT_ID=$PROJECT_ID_NODE_10
51+
cp package.node10.json functions/package.json
52+
}
53+
5454
function install_deps {
5555
announce "Installing dependencies..."
5656
cd $DIR/functions
@@ -63,9 +63,9 @@ function delete_all_functions {
6363
cd $DIR
6464
# Try to delete, if there are errors it is because the project is already empty,
6565
# 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 || : &
6969
fi
7070
wait
7171
announce "Project emptied."
@@ -96,14 +96,14 @@ function run_all_tests {
9696
if [[ $FIREBASE_FUNCTIONS_URL == "https://preprod-cloudfunctions.sandbox.googleapis.com" ]]; then
9797
TEST_DOMAIN="txcloud.net"
9898
fi
99-
TEST_URL_NODE_6="https://us-central1-$PROJECT_ID_NODE_6.$TEST_DOMAIN/integrationTests"
10099
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"
102101
echo $TEST_URL_NODE_8
103-
curl --fail $TEST_URL_NODE_6 & NODE6PID=$!
102+
echo $TEST_URL_NODE_10
104103
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=$!
106105
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)
107107
}
108108

109109
function run_tests {
@@ -137,18 +137,19 @@ install_deps
137137
delete_all_functions
138138
announce "Deploying functions to Node 8 runtime ..."
139139
deploy
140-
if [[ $PROJECT_ID_NODE_6 == $PROJECT_ID_NODE_8 ]]; then
140+
if [[ $PROJECT_ID_NODE_8 == $PROJECT_ID_NODE_10 ]]; then
141141
waitForPropagation
142142
run_tests
143143
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
153154
cleanup
154155
announce "All tests pass!"

0 commit comments

Comments
 (0)