|
13 | 13 | # See the License for the specific language governing permissions and |
14 | 14 | # limitations under the License. |
15 | 15 |
|
16 | | -run_args=( |
17 | | - # Remove the container after running |
18 | | - "--rm" |
19 | | -) |
| 16 | +CONFIG_DIRECTORY="${KOKORO_GFILE_DIR:-/dev/shm}" |
| 17 | +readonly CONFIG_DIRECTORY |
| 18 | +if [[ -f "${CONFIG_DIRECTORY}/test-configuration.sh" ]]; then |
| 19 | + source "${CONFIG_DIRECTORY}/test-configuration.sh" |
20 | 20 |
|
21 | | -echo "================================================================" |
22 | | -echo "Run Bigtable test programs against installed libraries ${DISTRO}." |
23 | | -docker run "${run_args[@]}" "${INSTALL_RUN_IMAGE}" "/i/bigtable/bigtable_install_test" |
| 21 | + run_args=( |
| 22 | + # Remove the container after running |
| 23 | + "--rm" |
24 | 24 |
|
25 | | -echo "Run Storage test programs against installed libraries ${DISTRO}." |
26 | | -docker run "${run_args[@]}" "${INSTALL_RUN_IMAGE}" "/i/storage/storage_install_test" |
27 | | -echo "================================================================" |
| 25 | + # Set the environment variables for the test program. |
| 26 | + "--env" "GOOGLE_APPLICATION_CREDENTIALS=/c/service-account.json" |
| 27 | + "--env" "GOOGLE_CLOUD_PROJECT=${PROJECT_ID}" |
| 28 | + |
| 29 | + # Mount the config directory as a volume in `/c` |
| 30 | + "--volume" "${CONFIG_DIRECTORY}:/c" |
| 31 | + ) |
| 32 | + readonly NONCE="$(date +%s)-${RANDOM}" |
| 33 | + |
| 34 | + echo "================================================================" |
| 35 | + echo "Run Bigtable test programs against installed libraries ${DISTRO}." |
| 36 | + docker run "${run_args[@]}" "${INSTALL_RUN_IMAGE}" \ |
| 37 | + "/i/bigtable/bigtable_install_test" \ |
| 38 | + "${PROJECT_ID}" "${INSTANCE_ID}" "tbl-${NONCE}" |
| 39 | + |
| 40 | + |
| 41 | + echo "Run Storage test programs against installed libraries ${DISTRO}." |
| 42 | + docker run "${run_args[@]}" "${INSTALL_RUN_IMAGE}" \ |
| 43 | + "/i/storage/storage_install_test" \ |
| 44 | + "${BUCKET_NAME}" "object-${NONCE}.txt" |
| 45 | + echo "================================================================" |
| 46 | +fi |
0 commit comments