reflex/tests/integration/init-test/in_docker_test_script.sh
Thomas Brandého 3f538865b5
reorganize all tests in a single top folder (#3981)
* lift node version restraint to allow more recent version if already installed

* add node test for latest version

* change python version

* use purple for debug logs

* update workflow

* add playwright dev dependency

* update workflow

* change test

* oops

* improve test

* update test

* fix tests

* mv units tests to a subfolder

* reorganize tests

* fix install

* update test_state

* revert node changes and only keep new tests organization

* move integration tests in tests/integration

* fix integration workflow

* fix dockerfile workflow

* fix dockerfile workflow 2

* fix shared_state
2024-09-26 01:22:52 +02:00

38 lines
899 B
Bash
Executable File

#!/usr/bin/env bash
set -euxo pipefail
SCRIPTPATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
export TELEMETRY_ENABLED=false
function do_export () {
template=$1
mkdir ~/"$template"
cd ~/"$template"
rm -rf ~/.local/share/reflex ~/"$template"/.web
reflex init --template "$template"
reflex export
(
cd "$SCRIPTPATH/../../.."
scripts/integration.sh ~/"$template" dev
pkill -9 -f 'next-server|python3' || true
sleep 10
REDIS_URL=redis://localhost scripts/integration.sh ~/"$template" prod
pkill -9 -f 'next-server|python3' || true
sleep 10
)
}
echo "Preparing test project dir"
python3 -m venv ~/venv
source ~/venv/bin/activate
pip install -U pip
echo "Installing reflex from local repo code"
pip install /reflex-repo
redis-server &
echo "Running reflex init in test project dir"
do_export blank