Skip to content

Commit

Permalink
Fix flakey use_location test (#1234)
Browse files Browse the repository at this point in the history
* Fix flakey `use_location` test
* Bump workflow versions
  • Loading branch information
Archmonger authored Oct 29, 2024
1 parent f81c168 commit 3dc0c23
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 43 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/.hatch-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected]
- 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
Expand Down
44 changes: 22 additions & 22 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
24 changes: 12 additions & 12 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
7 changes: 1 addition & 6 deletions src/py/reactpy/tests/test_backend/test_all.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import sys
from collections.abc import MutableMapping

import pytest
Expand Down Expand Up @@ -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():
Expand Down

0 comments on commit 3dc0c23

Please sign in to comment.