Skip to content

Commit 1133e75

Browse files
committed
allows gcloud to fail, ensures drupal path is correct, fails bigquery without project ID
1 parent 70f9963 commit 1133e75

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

bigquery/api/mainTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,14 @@ public function test()
3030
if (!self::$hasCredentials) {
3131
$this->markTestSkipped('No application credentials were found.');
3232
}
33+
34+
if (!$projectId = getenv('GOOGLE_PROJECT_ID')) {
35+
$this->markTestSkipped('No project ID');
36+
}
37+
3338
// Invoke main.php.
3439
global $argc, $argv;
35-
$argv[1] = getenv('GOOGLE_PROJECT_ID');
40+
$argv[1] = $projectId;
3641
$argc = 2;
3742
// Capture stdout.
3843
ob_start();

managed_vms/drupal8/tests/run-tests.sh

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ if [ "${PREREQ}" = "false" ]; then
3030
fi
3131

3232
# Install drupal console
33-
if [ ! -e ${HOME}/bin/drupal ]; then
33+
if [ ! -e ${DIR}/drupal ]; then
3434
curl https://drupalconsole.com/installer -L -o drupal
3535
chmod +x drupal
36-
mv drupal "${HOME}/bin/drupal"
36+
mv drupal "${DIR}/drupal"
3737
fi
3838

3939
# cleanup installation dir
@@ -49,14 +49,14 @@ sed -i -e "s/@@DRUPAL_ADMIN_USERNAME@@/${DRUPAL_ADMIN_USERNAME}/" $INSTALL_FILE
4949
sed -i -e "s/@@DRUPAL_ADMIN_PASSWORD@@/${DRUPAL_ADMIN_PASSWORD}/" $INSTALL_FILE
5050

5151
# download and install
52-
drupal init --root=$DIR
53-
drupal chain --file=$INSTALL_FILE
52+
${DIR}/drupal init --root=$DIR
53+
${DIR}/drupal chain --file=$INSTALL_FILE
5454

5555
cd $DRUPAL_DIR
5656

5757
# run some setup commands
58-
drupal theme:download bootstrap 8.x-3.0-beta2
59-
drupal cache:rebuild all
58+
${DIR}/drupal theme:download bootstrap 8.x-3.0-beta2
59+
${DIR}/drupal cache:rebuild all
6060

6161
## Perform steps outlined in the README ##
6262

@@ -74,6 +74,8 @@ if [ -z "${GOOGLE_VERSION_ID}" ]; then
7474
fi
7575

7676
# Deploy to gcloud (try 3 times)
77+
# "unset -e" temporarily to allow deployments to fail
78+
unset -e
7779
attempts=0
7880
until [ $attempts -ge 3 ]
7981
do
@@ -85,6 +87,7 @@ do
8587
attempts=$[$attempts+1]
8688
sleep 1
8789
done
90+
set -e
8891

8992
# Determine the deployed URL
9093
if [ -z "${GOOGLE_MODULE}" ]; then

managed_vms/symfony/tests/run-tests.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ if [ -z "${GOOGLE_VERSION_ID}" ]; then
6464
fi
6565

6666
# Deploy to gcloud (try 3 times)
67+
# "unset -e" temporarily to allow deployments to fail
68+
unset -e
6769
attempts=0
6870
until [ $attempts -ge 3 ]
6971
do
@@ -75,6 +77,7 @@ do
7577
attempts=$[$attempts+1]
7678
sleep 1
7779
done
80+
set -e
7881

7982
# Determine the deployed URL
8083
if [ -z "${GOOGLE_MODULE}" ]; then

0 commit comments

Comments
 (0)