reflex/.github/workflows/integration_tests_wsl.yml
Masen Furer 438b31f270
[ENG-4005] Proxy backend requests on '/' to the frontend (#3300)
* Proxy backend requests on '/' to the frontend

If the optional extra `proxy` is installed, then the backend can handle all
requests by proxy unrecognized routes to the frontend nextjs server.

* Update lock file

* pre-commit fu

* AppHarness: set config frontend_port and backend_port

* integration: frontend port and backend port should return the same content

with proxying enabled by default in dev mode, both frontend and backend ports
on / should return the same content.

* Retry up to 100 times when proxying to frontend

* Reduce retry attempts to 25

Fix log level passing to subprocess

* scripts/wait_for_listening_port: primarily check HTTP responses

if the port is up or not, we don't really care... the HTTP request needs to
work and not return errors

* aiohttp is an optional dep

* adapt integration.sh for --backend-only (counter integration test)

* woops

* windows WTF?

* scratching my head 🎄

* double WTF windows

* Fix remaining integration tests
2025-01-03 15:50:38 -08:00

101 lines
3.1 KiB
YAML

name: integration-tests-wsl
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.id }}
cancel-in-progress: true
on:
push:
branches: ['main']
paths-ignore:
- '**/*.md'
pull_request:
branches: ['main']
paths-ignore:
- '**/*.md'
permissions:
contents: read
env:
TELEMETRY_ENABLED: false
NODE_OPTIONS: '--max_old_space_size=4096'
jobs:
example-counter-wsl:
timeout-minutes: 30
# 2019 is more stable with WSL in GH actions
# https://github.com/actions/runner-images/issues/5151
# Confirmed through trial and error. 2022 has >80% failure rate (probably BSOD)
runs-on: windows-2019
steps:
- uses: actions/checkout@v4
- name: Clone Reflex Examples Repo
uses: actions/checkout@v4
with:
repository: reflex-dev/reflex-examples
path: reflex-examples
- uses: Vampire/setup-wsl@v3
with:
distribution: Ubuntu-24.04
- name: Install Python
shell: wsl-bash {0}
run: |
apt update
apt install -y python3 python3-pip curl dos2unix zip unzip
- name: Install Poetry
shell: wsl-bash {0}
run: |
curl -sSL https://install.python-poetry.org | python3 -
# Symlink seems easier to make work than persisting PATH changes, in WSL
ln -s /root/.local/bin/poetry /usr/local/bin/poetry
- name: Install reflex deps
shell: wsl-bash {0}
run: |
poetry install
- name: Install uv
shell: wsl-bash {0}
run: |
poetry run pip install uv
- name: Install requirements for counter example
working-directory: ./reflex-examples/counter
shell: wsl-bash {0}
run: |
poetry run uv pip install -r requirements.txt
- name: Check export --backend-only before init for counter example
working-directory: ./reflex-examples/counter
shell: wsl-bash {0}
run: |
export TELEMETRY_ENABLED=false
poetry run reflex export --backend-only
- name: Check run --backend-only before init for counter example
shell: wsl-bash {0}
run: |
export TELEMETRY_ENABLED=false
export WAIT_FOR_LISTENING_PORT_ARGS="--path ping"
dos2unix scripts/integration.sh
poetry run bash scripts/integration.sh ./reflex-examples/counter dev 8001 --backend-only --backend-port 8001
- name: Init Website for counter example
working-directory: ./reflex-examples/counter
shell: wsl-bash {0}
run: |
export TELEMETRY_ENABLED=false
poetry run reflex init --loglevel debug
- name: Check export for counter example
working-directory: ./reflex-examples/counter
shell: wsl-bash {0}
run: |
export TELEMETRY_ENABLED=false
poetry run reflex export --frontend-only --loglevel debug
- name: Run Website and Check for errors
shell: wsl-bash {0}
run: |
export TELEMETRY_ENABLED=false
poetry run bash scripts/integration.sh ./reflex-examples/counter dev