mirror of
https://github.com/nocodb/nocodb.git
synced 2026-04-26 12:15:42 +00:00
test: test for watchtower and scaling
This commit is contained in:
28
docker-compose/setup-script/tests/install/redis.bats
Normal file
28
docker-compose/setup-script/tests/install/redis.bats
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
NOCO_HOME="${HOME}/.nocodb"
|
||||
export NOCO_HOME
|
||||
|
||||
WORKING_DIR="$(pwd)"
|
||||
|
||||
setup() {
|
||||
cd "${WORKING_DIR}" || exit 1
|
||||
../setup.sh
|
||||
}
|
||||
|
||||
teardown() {
|
||||
cd "${WORKING_DIR}" || exit 1
|
||||
../setup.sh
|
||||
}
|
||||
|
||||
@test "Check Redis is enabled when specified" {
|
||||
../expects/install/redis.sh
|
||||
|
||||
cd "${NOCO_HOME}"
|
||||
|
||||
# Check Docker Compose file to verify Redis configuration
|
||||
grep -q 'redis' docker-compose.yml
|
||||
|
||||
# Verify Redis container is running
|
||||
docker compose ps | grep -q 'redis'
|
||||
}
|
||||
31
docker-compose/setup-script/tests/install/scale.bats
Normal file
31
docker-compose/setup-script/tests/install/scale.bats
Normal file
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
NOCO_HOME="${HOME}/.nocodb"
|
||||
export NOCO_HOME
|
||||
|
||||
WORKING_DIR="$(pwd)"
|
||||
|
||||
setup() {
|
||||
cd "${WORKING_DIR}" || exit 1
|
||||
../setup.sh
|
||||
}
|
||||
|
||||
teardown() {
|
||||
cd "${WORKING_DIR}" || exit 1
|
||||
../setup.sh
|
||||
}
|
||||
|
||||
@test "Check if two instances of NoCoDB can be run" {
|
||||
# Mock nproc to return 4
|
||||
nproc() {
|
||||
echo 4
|
||||
}
|
||||
|
||||
../expects/install/scale.sh
|
||||
|
||||
cd "${NOCO_HOME}"
|
||||
|
||||
# Get scale from docker compose ps
|
||||
scale=$(docker compose ps | grep nocodb | awk '{print $1}')
|
||||
[ "$scale" -eq 2 ]
|
||||
}
|
||||
28
docker-compose/setup-script/tests/install/watchtower.bats
Normal file
28
docker-compose/setup-script/tests/install/watchtower.bats
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
NOCO_HOME="${HOME}/.nocodb"
|
||||
export NOCO_HOME
|
||||
|
||||
WORKING_DIR="$(pwd)"
|
||||
|
||||
setup() {
|
||||
cd "${WORKING_DIR}" || exit 1
|
||||
../setup.sh
|
||||
}
|
||||
|
||||
teardown() {
|
||||
cd "${WORKING_DIR}" || exit 1
|
||||
../setup.sh
|
||||
}
|
||||
|
||||
@test "Check WatchTower is enabled when specified" {
|
||||
../expects/install/watchtower.sh
|
||||
|
||||
cd "${NOCO_HOME}"
|
||||
|
||||
# Check Docker Compose file to verify WatchTower configuration
|
||||
grep -q 'watchtower' docker-compose.yml
|
||||
|
||||
# Verify WatchTower container is running
|
||||
docker compose ps | grep -q 'watchtower'
|
||||
}
|
||||
Reference in New Issue
Block a user