mirror of
https://github.com/nocodb/nocodb.git
synced 2026-04-29 20:26:56 +00:00
update : refactor auto-upstall and installation methods
This commit is contained in:
36
docker-compose/1_Auto_Upstall/tests/install/default.bats
Executable file
36
docker-compose/1_Auto_Upstall/tests/install/default.bats
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
NOCO_HOME="./nocodb"
|
||||
export NOCO_HOME
|
||||
|
||||
|
||||
|
||||
setup() {
|
||||
cd "${WORKING_DIR}/install" || exit 1
|
||||
./setup.sh
|
||||
}
|
||||
|
||||
teardown() {
|
||||
if [ -n "$SKIP_TEARDOWN" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
cd "${WORKING_DIR}/install" || exit 1
|
||||
./setup.sh
|
||||
}
|
||||
|
||||
@test "Check installation with all default options" {
|
||||
../expects/install/default.sh
|
||||
|
||||
cd "${NOCO_HOME}"
|
||||
|
||||
# Check Docker Compose file to verify configuration
|
||||
grep -q 'redis' docker-compose.yml
|
||||
grep -q 'watchtower' docker-compose.yml
|
||||
grep -q 'nocodb' docker-compose.yml
|
||||
|
||||
# Verify container is running
|
||||
docker compose ps | grep -q 'redis'
|
||||
docker compose ps | grep -q 'watchtower'
|
||||
docker compose ps | grep -q 'nocodb'
|
||||
}
|
||||
36
docker-compose/1_Auto_Upstall/tests/install/ip.bats
Executable file
36
docker-compose/1_Auto_Upstall/tests/install/ip.bats
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
NOCO_HOME="./nocodb"
|
||||
export NOCO_HOME
|
||||
|
||||
|
||||
|
||||
setup() {
|
||||
cd "${WORKING_DIR}/install" || exit 1
|
||||
./setup.sh
|
||||
}
|
||||
|
||||
teardown() {
|
||||
if [ -n "$SKIP_TEARDOWN" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
cd "${WORKING_DIR}/install" || exit 1
|
||||
./setup.sh
|
||||
}
|
||||
|
||||
@test "Check installation with custom ip" {
|
||||
../expects/install/ip.sh
|
||||
|
||||
cd "${NOCO_HOME}"
|
||||
|
||||
# Check Docker Compose file to verify configuration
|
||||
grep -q 'redis' docker-compose.yml
|
||||
grep -q 'watchtower' docker-compose.yml
|
||||
grep -q 'nocodb' docker-compose.yml
|
||||
|
||||
# Verify container is running
|
||||
docker compose ps | grep -q 'redis'
|
||||
docker compose ps | grep -q 'watchtower'
|
||||
docker compose ps | grep -q 'nocodb'
|
||||
}
|
||||
32
docker-compose/1_Auto_Upstall/tests/install/redis.bats
Executable file
32
docker-compose/1_Auto_Upstall/tests/install/redis.bats
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
NOCO_HOME="./nocodb"
|
||||
export NOCO_HOME
|
||||
|
||||
|
||||
|
||||
setup() {
|
||||
cd "${WORKING_DIR}/install" || exit 1
|
||||
./setup.sh
|
||||
}
|
||||
|
||||
teardown() {
|
||||
if [ -n "$SKIP_TEARDOWN" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
cd "${WORKING_DIR}/install" || 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'
|
||||
}
|
||||
30
docker-compose/1_Auto_Upstall/tests/install/scale.bats
Executable file
30
docker-compose/1_Auto_Upstall/tests/install/scale.bats
Executable file
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
NOCO_HOME="./nocodb"
|
||||
export NOCO_HOME
|
||||
|
||||
|
||||
|
||||
setup() {
|
||||
cd "${WORKING_DIR}/install" || exit 1
|
||||
./setup.sh
|
||||
}
|
||||
|
||||
teardown() {
|
||||
if [ -n "$SKIP_TEARDOWN" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
cd "${WORKING_DIR}/install" || exit 1
|
||||
./setup.sh
|
||||
}
|
||||
|
||||
@test "Check if two instances of NoCoDB can be run" {
|
||||
../expects/install/scale.sh
|
||||
|
||||
cd "${NOCO_HOME}"
|
||||
|
||||
# Get scale from docker compose ps
|
||||
scale=$(docker compose ps | grep -c "nocodb/nocodb")
|
||||
[ "$scale" -eq 2 ]
|
||||
}
|
||||
12
docker-compose/1_Auto_Upstall/tests/install/setup.sh
Executable file
12
docker-compose/1_Auto_Upstall/tests/install/setup.sh
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ -z "$NOCO_HOME" ]; then
|
||||
NOCO_HOME="./nocodb"
|
||||
fi
|
||||
|
||||
if [ -d "$NOCO_HOME" ]; then
|
||||
cd "$NOCO_HOME" || exit
|
||||
docker compose down
|
||||
fi
|
||||
|
||||
rm -rf "$NOCO_HOME"
|
||||
30
docker-compose/1_Auto_Upstall/tests/install/ssl.bats
Normal file
30
docker-compose/1_Auto_Upstall/tests/install/ssl.bats
Normal file
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
|
||||
|
||||
RANDOM_NUMBER=$RANDOM
|
||||
|
||||
setup() {
|
||||
cd "${WORKING_DIR}/install" || exit 1
|
||||
./setup.sh
|
||||
}
|
||||
|
||||
teardown() {
|
||||
if [ -n "$SKIP_TEARDOWN" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
cd "${WORKING_DIR}/install" || exit 1
|
||||
./setup.sh
|
||||
}
|
||||
|
||||
@test "Should create SSL certificates" {
|
||||
if [ -z "$TEST_SSL" ]
|
||||
then
|
||||
skip "Skipping SSL tests"
|
||||
fi
|
||||
|
||||
../expects/install/ssl.sh "$RANDOM_NUMBER"
|
||||
|
||||
curl -ksS --head "https://${RANDOM_NUMBER}.ssl.nocodb.dev" > /dev/null
|
||||
}
|
||||
30
docker-compose/1_Auto_Upstall/tests/install/watchtower.bats
Executable file
30
docker-compose/1_Auto_Upstall/tests/install/watchtower.bats
Executable file
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
NOCO_HOME="./nocodb"
|
||||
export NOCO_HOME
|
||||
|
||||
setup() {
|
||||
cd "${WORKING_DIR}/install" || exit 1
|
||||
./setup.sh
|
||||
}
|
||||
|
||||
teardown() {
|
||||
if [ -n "$SKIP_TEARDOWN" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
cd "${WORKING_DIR}/install" || 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