Pārlūkot izejas kodu

reflex_init_in_docker_test: export both frontend and backend (#2182)

Masen Furer 1 gadu atpakaļ
vecāks
revīzija
9480f76a27

+ 2 - 16
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

+ 18 - 8
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"
+do_export blank
+do_export sidebar