From 9480f76a270ac4791fd2cc18e175bd037594f1a6 Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Thu, 16 Nov 2023 14:21:54 -0800 Subject: [PATCH] reflex_init_in_docker_test: export both frontend and backend (#2182) --- integration/init-test/Dockerfile | 18 ++----------- .../init-test/in_docker_test_script.sh | 26 +++++++++++++------ 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/integration/init-test/Dockerfile b/integration/init-test/Dockerfile index 37cd2d72c..8bc6e4b13 100644 --- a/integration/init-test/Dockerfile +++ b/integration/init-test/Dockerfile @@ -1,21 +1,7 @@ -FROM ubuntu:latest +FROM python:3.11 ARG USERNAME=kerrigan -ARG USER_UID=1000 -ARG USER_GID=$USER_UID - -RUN groupadd --gid $USER_GID $USERNAME \ - && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \ - # - # [Optional] Add sudo support. Omit if you don't need to install software after connecting. - && apt-get update \ - && apt-get install -y sudo curl xz-utils python3 python3-pip python3.10-venv unzip \ - && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \ - && chmod 0440 /etc/sudoers.d/$USERNAME - +RUN useradd -m $USERNAME USER $USERNAME -RUN curl -sSL https://install.python-poetry.org | python3 - -RUN sudo ln -s /home/$USERNAME/.local/bin/poetry /usr/local/bin/poetry - WORKDIR /home/$USERNAME diff --git a/integration/init-test/in_docker_test_script.sh b/integration/init-test/in_docker_test_script.sh index a0bfc4afd..beecfc91c 100755 --- a/integration/init-test/in_docker_test_script.sh +++ b/integration/init-test/in_docker_test_script.sh @@ -1,15 +1,25 @@ #!/usr/bin/env bash -set -ex +set -euxo pipefail + +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 +} echo "Preparing test project dir" -mkdir hello -python3 -m venv ~/hello/venv -source ~/hello/venv/bin/activate +python3 -m venv ~/venv +source ~/venv/bin/activate echo "Installing reflex from local repo code" -cd /reflex-repo -poetry install +pip install /reflex-repo + echo "Running reflex init in test project dir" -export TELEMETRY_ENABLED=false -poetry run /bin/bash -c "cd ~/hello && reflex init --template blank && rm -rf ~/.reflex .web && reflex export --backend-only" \ No newline at end of file +do_export blank +do_export sidebar \ No newline at end of file