Skip to content

Commit 5a34f13

Browse files
committed
Test that ghe-service-ensure-xxx commands are run on settings restore
1 parent e2c5deb commit 5a34f13

3 files changed

Lines changed: 18 additions & 0 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
# Usage: ghe-service-ensure-mysql
3+
# Emulates the remote GitHub ghe-service-ensure-mysql command. Tests use this
4+
# to assert that the command was executed.
5+
set -e
6+
echo "ghe-service-ensure-elasticsearch OK"

test/bin/ghe-service-ensure-mysql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
# Usage: ghe-service-ensure-mysql
3+
# Emulates the remote GitHub ghe-service-ensure-mysql command. Tests use this
4+
# to assert that the command was executed.
5+
set -e
6+
echo "ghe-service-ensure-mysql OK"

test/test-ghe-restore.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ begin_test "ghe-restore into unconfigured vm"
7171
grep -q "fake ghe-export-settings data" "$TRASHDIR/restore-out"
7272
grep -q "ghe-import-es-indices" "$TRASHDIR/restore-out"
7373

74+
# verify service-ensure scripts were run under versions >= v2.x
75+
if [ "$GHE_VERSION_MAJOR" -ge 2 ]; then
76+
grep -q "ghe-service-ensure-mysql OK" "$TRASHDIR/restore-out"
77+
grep -q "ghe-service-ensure-elasticsearch OK" "$TRASHDIR/restore-out"
78+
fi
79+
7480
# verify all repository data was transferred to the restore location
7581
diff -ru "$GHE_DATA_DIR/current/repositories" "$GHE_REMOTE_DATA_USER_DIR/repositories"
7682

0 commit comments

Comments
 (0)