This is an automated email from the ASF dual-hosted git repository.
rshah pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git
The following commit(s) were added to refs/heads/master by this push:
new 335406dc87 T3C integration tests: Seed database after resetting it
(#7785)
335406dc87 is described below
commit 335406dc8707a97464ea47475ac359639fb78352
Author: Zach Hoffman <[email protected]>
AuthorDate: Wed Sep 6 13:38:26 2023 -0600
T3C integration tests: Seed database after resetting it (#7785)
---
cache-config/testing/docker/traffic_ops/run.sh | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/cache-config/testing/docker/traffic_ops/run.sh
b/cache-config/testing/docker/traffic_ops/run.sh
index da015f96aa..8fb7d1efdb 100755
--- a/cache-config/testing/docker/traffic_ops/run.sh
+++ b/cache-config/testing/docker/traffic_ops/run.sh
@@ -6,9 +6,9 @@
# 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
@@ -128,10 +128,10 @@ if [ -z "$INITIALIZED" ]; then init; fi
i=0
sleep_time=3
-while ! nc $DB_SERVER $DB_PORT </dev/null; do
+while ! nc $DB_SERVER $DB_PORT </dev/null; do
echo "waiting for $DB_SERVER:$DB_PORT" >> /var/log/traffic_ops/to_admin.log
sleep $sleep_time
- let i=i+1
+ let i=i+1
if [ $i -gt 10 ]; then
let d=i*sleep_time
echo "$DB_SERVER:$DB_PORT is unavailable after $d seconds, giving up" >>
/var/log/traffic_ops/to_admin.log
@@ -145,10 +145,14 @@ set -o errexit
mkdir -p /var/log/traffic_ops/
touch /var/log/traffic_ops/to_admin.log /var/log/traffic_ops/tv_admin.log
tail -f /var/log/traffic_ops/to_admin.log /var/log/traffic_ops/tv_admin.log &
-cd /opt/traffic_ops/app && db/admin --env=production reset >>
/var/log/traffic_ops/to_admin.log 2>&1
-cd /opt/traffic_ops/app && db/admin --trafficvault --env=production reset >>
/var/log/traffic_ops/tv_admin.log 2>&1
-) || {
- echo Failed to run migrations
+cd /opt/traffic_ops/app
+(
+db/admin --env=production reset
+db/admin --env=production upgrade
+db/admin --trafficvault --env=production reset
+db/admin --trafficvault --env=production upgrade
+) >> /var/log/traffic_ops/to_admin.log 2>&1) || {
+ echo Failed to run migrations;
exit 1
}