From 3dc0c231fc4e14bb34f02d0f2f31c953273d21e1 Mon Sep 17 00:00:00 2001 From: Mark Bakhit Date: Tue, 29 Oct 2024 03:24:04 -0700 Subject: [PATCH] Fix flakey `use_location` test (#1234) * Fix flakey `use_location` test * Bump workflow versions --- .github/workflows/.hatch-run.yml | 6 +-- .github/workflows/deploy-docs.yml | 44 +++++++++---------- .github/workflows/publish.yml | 24 +++++----- src/py/reactpy/tests/test_backend/test_all.py | 7 +-- 4 files changed, 38 insertions(+), 43 deletions(-) diff --git a/.github/workflows/.hatch-run.yml b/.github/workflows/.hatch-run.yml index d18e3a190..1630378b9 100644 --- a/.github/workflows/.hatch-run.yml +++ b/.github/workflows/.hatch-run.yml @@ -38,15 +38,15 @@ jobs: runs-on: ${{ fromJson(inputs.runs-on-array) }} runs-on: ${{ matrix.runs-on }} steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: "23.x" registry-url: ${{ inputs.node-registry-url }} - name: Pin NPM Version run: npm install -g npm@8.19.3 - name: Use Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install Python Dependencies diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 7337f505b..f9f9431c6 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -4,27 +4,27 @@ name: deploy-docs on: - push: - branches: - - "main" - tags: - - "*" + push: + branches: + - "main" + tags: + - "*" jobs: - deploy-documentation: - runs-on: ubuntu-latest - steps: - - name: Check out src from Git - uses: actions/checkout@v2 - - name: Get history and tags for SCM versioning to work - run: | - git fetch --prune --unshallow - git fetch --depth=1 origin +refs/tags/*:refs/tags/* - - name: Login to Heroku Container Registry - run: echo ${{ secrets.HEROKU_API_KEY }} | docker login -u ${{ secrets.HEROKU_EMAIL }} --password-stdin registry.heroku.com - - name: Build Docker Image - run: docker build . --file docs/Dockerfile --tag registry.heroku.com/${{ secrets.HEROKU_APP_NAME }}/web - - name: Push Docker Image - run: docker push registry.heroku.com/${{ secrets.HEROKU_APP_NAME }}/web - - name: Deploy - run: HEROKU_API_KEY=${{ secrets.HEROKU_API_KEY }} heroku container:release web --app ${{ secrets.HEROKU_APP_NAME }} + deploy-documentation: + runs-on: ubuntu-latest + steps: + - name: Check out src from Git + uses: actions/checkout@v4 + - name: Get history and tags for SCM versioning to work + run: | + git fetch --prune --unshallow + git fetch --depth=1 origin +refs/tags/*:refs/tags/* + - name: Login to Heroku Container Registry + run: echo ${{ secrets.HEROKU_API_KEY }} | docker login -u ${{ secrets.HEROKU_EMAIL }} --password-stdin registry.heroku.com + - name: Build Docker Image + run: docker build . --file docs/Dockerfile --tag registry.heroku.com/${{ secrets.HEROKU_APP_NAME }}/web + - name: Push Docker Image + run: docker push registry.heroku.com/${{ secrets.HEROKU_APP_NAME }}/web + - name: Deploy + run: HEROKU_API_KEY=${{ secrets.HEROKU_API_KEY }} heroku container:release web --app ${{ secrets.HEROKU_APP_NAME }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e9271cbd5..8e523ce04 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -4,17 +4,17 @@ name: publish on: - release: - types: [published] + release: + types: [published] jobs: - publish: - uses: ./.github/workflows/.hatch-run.yml - with: - job-name: "publish" - hatch-run: "publish" - node-registry-url: "https://registry.npmjs.org" - secrets: - node-auth-token: ${{ secrets.NODE_AUTH_TOKEN }} - pypi-username: ${{ secrets.PYPI_USERNAME }} - pypi-password: ${{ secrets.PYPI_PASSWORD }} + publish: + uses: ./.github/workflows/.hatch-run.yml + with: + job-name: "publish" + hatch-run: "publish" + node-registry-url: "https://registry.npmjs.org" + secrets: + node-auth-token: ${{ secrets.NODE_AUTH_TOKEN }} + pypi-username: ${{ secrets.PYPI_USERNAME }} + pypi-password: ${{ secrets.PYPI_PASSWORD }} diff --git a/src/py/reactpy/tests/test_backend/test_all.py b/src/py/reactpy/tests/test_backend/test_all.py index 9a1440d52..cd2f371f5 100644 --- a/src/py/reactpy/tests/test_backend/test_all.py +++ b/src/py/reactpy/tests/test_backend/test_all.py @@ -1,4 +1,3 @@ -import sys from collections.abc import MutableMapping import pytest @@ -107,17 +106,13 @@ def ShowScope(): assert isinstance(scope.current, MutableMapping) -@pytest.mark.skipIf( - sys.platform == "darwin", - reason="Tornado and Flask backends are currently buggy on MacOS.", -) async def test_use_location(display: DisplayFixture): location = reactpy.Ref() @poll async def poll_location(): """This needs to be async to allow the server to respond""" - return location.current + return getattr(location, "current", None) @reactpy.component def ShowRoute():