moleske commented on a change in pull request #746:
URL: https://github.com/apache/geode-native/pull/746#discussion_r578613553



##########
File path: ci/lib/templates.lib.txt
##########
@@ -0,0 +1,253 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+(@ load("@ytt:data", "data") -@)
+(@ load("functions.lib.yml",
+        "gci_label_value",
+        "image_family_name")
+-@)
+
+(@ def google_variables(): -@)
+GOOGLE_PROJECT=(@=data.values.google.project @)
+GOOGLE_ZONE=(@=data.values.google.zone @)
+(@- end @)
+
+
+(@ def instance_variables(): -@)
+INSTANCE_USER=build
+INSTANCE_DIR=$(pwd)/instance
+
+if [ ! -d "${INSTANCE_DIR}" ]; then
+  echo "${INSTANCE_DIR} not found."
+  exit 1
+fi
+(@- end @)
+
+(@ def remote_functions(): -@)
+(@=instance_variables() @)
+
+SSH_OPTIONS=${SSH_OPTIONS:-"-o StrictHostKeyChecking=no -o 
PasswordAuthentication=no"}
+
+ssh_key_file=${INSTANCE_DIR}/identity
+if [ ! -r "${ssh_key_file}" ]; then
+  echo "${ssh_key_file} not readable."
+  exit 1
+fi
+
+instance_file=${INSTANCE_DIR}/instance.sh
+if [ ! -r "${instance_file}" ]; then
+  echo "${instance_file} not readable."
+  exit 1
+fi
+
+external_ip=$(source ${instance_file} && echo -n 
${networkInterfaces_accessConfigs_natIP})
+
+function remote_shell {
+  ssh ${SSH_OPTIONS} -i ${ssh_key_file} ${INSTANCE_USER}@${external_ip} "$@"
+}
+
+function remote_download {
+  scp ${SSH_OPTIONS} -i ${ssh_key_file} -q -r 
"${INSTANCE_USER}@${external_ip}:${1}" "$2"
+}
+
+function remote_download_directory {
+  ssh ${SSH_OPTIONS} -i ${ssh_key_file} ${INSTANCE_USER}@${external_ip} tar -C 
$(dirname ${1}) -czf - $(basename ${1}) | tar -C ${2} -zxf -
+}
+
+function remote_upload {
+  scp ${SSH_OPTIONS} -i ${ssh_key_file} -q -r "$1" 
"${INSTANCE_USER}@${external_ip}:${2}"
+}
+
+(@- end @)
+
+(@ def run_cpp_unit_tests(): -@)
+set -ueo pipefail
+(@= remote_functions() @)
+remote_shell cmake -E chdir build/cppcache/test ctest -C ${CMAKE_CONFIG} -j8 
--timeout=500 --output-on-failure --schedule-random

Review comment:
       `-j8` on the cppcache unit tests doesn't make sense since there is only 
one possible job to run.  Though fine keeping it if we feel they'll be more
   
   ```
   2021-02-18 09:27 ~/workspace/geode-native/build/cppcache/test |wip/ci-layers 
↓·4 U:1|
   moleske-a01 moeng $ ctest -j8
   Test project /Users/pivotal/workspace/geode-native/build/cppcache/test
       Start 1: apache-geode_unittests
   1/1 Test #1: apache-geode_unittests ...........   Passed   11.87 sec
   
   100% tests passed, 0 tests failed out of 1
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to