mirror of
https://github.com/nocodb/nocodb.git
synced 2026-04-26 22:25:40 +00:00
test: test for restart and upgrade
This commit is contained in:
27
docker-compose/setup-script/tests/configure/restart.bats
Executable file
27
docker-compose/setup-script/tests/configure/restart.bats
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
NOCO_HOME="${HOME}/.nocodb"
|
||||
export NOCO_HOME
|
||||
|
||||
WORKING_DIR="$(pwd)"
|
||||
|
||||
setup() {
|
||||
cd "${WORKING_DIR}" || exit 1
|
||||
./setup.sh "setup"
|
||||
}
|
||||
|
||||
teardown() {
|
||||
cd "${WORKING_DIR}" || exit 1
|
||||
./setup.sh
|
||||
}
|
||||
|
||||
@test "Check Redis, WatchTower and NocoDB are restarted" {
|
||||
../expects/configure/restart.sh
|
||||
|
||||
cd "${NOCO_HOME}" || exit 1
|
||||
|
||||
# Verify container is running
|
||||
docker compose ps | grep -q 'redis'
|
||||
docker compose ps | grep -q 'watchtower'
|
||||
docker compose ps | grep -q 'nocodb'
|
||||
}
|
||||
27
docker-compose/setup-script/tests/configure/upgrade.bats
Executable file
27
docker-compose/setup-script/tests/configure/upgrade.bats
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
NOCO_HOME="${HOME}/.nocodb"
|
||||
export NOCO_HOME
|
||||
|
||||
WORKING_DIR="$(pwd)"
|
||||
|
||||
setup() {
|
||||
cd "${WORKING_DIR}" || exit 1
|
||||
./setup.sh "setup"
|
||||
}
|
||||
|
||||
teardown() {
|
||||
cd "${WORKING_DIR}" || exit 1
|
||||
./setup.sh
|
||||
}
|
||||
|
||||
@test "Check Redis, WatchTower and NocoDB are upgraded" {
|
||||
../expects/configure/upgrade.sh
|
||||
|
||||
cd "${NOCO_HOME}" || exit 1
|
||||
|
||||
# Verify container is running
|
||||
docker compose ps | grep -q 'redis'
|
||||
docker compose ps | grep -q 'watchtower'
|
||||
docker compose ps | grep -q 'nocodb'
|
||||
}
|
||||
18
docker-compose/setup-script/tests/expects/configure/restart.sh
Executable file
18
docker-compose/setup-script/tests/expects/configure/restart.sh
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
# Configure timeout for each expect command
|
||||
set timeout 10
|
||||
|
||||
# Start your main script
|
||||
spawn bash ../../noco.sh
|
||||
|
||||
expect "Do you want to reinstall NocoDB*"
|
||||
send "N\r"
|
||||
|
||||
expect "Enter your choice: "
|
||||
send "4\r"
|
||||
|
||||
expect "Enter your choice: "
|
||||
send "0\r"
|
||||
|
||||
expect EOF
|
||||
18
docker-compose/setup-script/tests/expects/configure/upgrade.sh
Executable file
18
docker-compose/setup-script/tests/expects/configure/upgrade.sh
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
# Configure timeout for each expect command
|
||||
set timeout 10
|
||||
|
||||
# Start your main script
|
||||
spawn bash ../../noco.sh
|
||||
|
||||
expect "Do you want to reinstall NocoDB*"
|
||||
send "N\r"
|
||||
|
||||
expect "Enter your choice: "
|
||||
send "5\r"
|
||||
|
||||
expect "Enter your choice: "
|
||||
send "0\r"
|
||||
|
||||
expect EOF
|
||||
Reference in New Issue
Block a user