tests: run frontend build earlier

This commit is contained in:
Girish Ramakrishnan
2025-07-11 18:02:52 +02:00
parent 8e8b635769
commit a470b2cd4e
+4 -3
View File
@@ -74,14 +74,15 @@ echo "=> Ensure database"
docker exec mysql-server mysql -uroot -ppassword -e "ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'password';" docker exec mysql-server mysql -uroot -ppassword -e "ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'password';"
docker exec mysql-server mysql -uroot -ppassword -e "CREATE DATABASE IF NOT EXISTS box" docker exec mysql-server mysql -uroot -ppassword -e "CREATE DATABASE IF NOT EXISTS box"
echo "=> Run database migrations" # do this before migrations! box code requires oidc files to exist which are imported in migrations
BOX_ENV=test DATABASE_URL=mysql://root:password@${MYSQL_IP}/box node_modules/.bin/db-migrate up
echo "=> Ensure dist/ exists" echo "=> Ensure dist/ exists"
if [[ ! -d "dashboard/dist" ]]; then if [[ ! -d "dashboard/dist" ]]; then
(cd dashboard && npm run build) (cd dashboard && npm run build)
fi fi
echo "=> Run database migrations"
BOX_ENV=test DATABASE_URL=mysql://root:password@${MYSQL_IP}/box node_modules/.bin/db-migrate up
TESTS=${DEFAULT_TESTS} TESTS=${DEFAULT_TESTS}
if [[ $# -gt 0 ]]; then if [[ $# -gt 0 ]]; then
TESTS="$*" TESTS="$*"