Skip to content

Commit 3dc0c23

Browse files
authored
Fix flakey use_location test (#1234)
* Fix flakey `use_location` test * Bump workflow versions
1 parent f81c168 commit 3dc0c23

File tree

4 files changed

+38
-43
lines changed

4 files changed

+38
-43
lines changed

.github/workflows/.hatch-run.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ jobs:
3838
runs-on: ${{ fromJson(inputs.runs-on-array) }}
3939
runs-on: ${{ matrix.runs-on }}
4040
steps:
41-
- uses: actions/checkout@v2
42-
- uses: actions/setup-node@v2
41+
- uses: actions/checkout@v4
42+
- uses: actions/setup-node@v4
4343
with:
4444
node-version: "23.x"
4545
registry-url: ${{ inputs.node-registry-url }}
4646
- name: Pin NPM Version
4747
run: npm install -g [email protected]
4848
- name: Use Python ${{ matrix.python-version }}
49-
uses: actions/setup-python@v2
49+
uses: actions/setup-python@v5
5050
with:
5151
python-version: ${{ matrix.python-version }}
5252
- name: Install Python Dependencies

.github/workflows/deploy-docs.yml

+22-22
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,27 @@
44
name: deploy-docs
55

66
on:
7-
push:
8-
branches:
9-
- "main"
10-
tags:
11-
- "*"
7+
push:
8+
branches:
9+
- "main"
10+
tags:
11+
- "*"
1212

1313
jobs:
14-
deploy-documentation:
15-
runs-on: ubuntu-latest
16-
steps:
17-
- name: Check out src from Git
18-
uses: actions/checkout@v2
19-
- name: Get history and tags for SCM versioning to work
20-
run: |
21-
git fetch --prune --unshallow
22-
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
23-
- name: Login to Heroku Container Registry
24-
run: echo ${{ secrets.HEROKU_API_KEY }} | docker login -u ${{ secrets.HEROKU_EMAIL }} --password-stdin registry.heroku.com
25-
- name: Build Docker Image
26-
run: docker build . --file docs/Dockerfile --tag registry.heroku.com/${{ secrets.HEROKU_APP_NAME }}/web
27-
- name: Push Docker Image
28-
run: docker push registry.heroku.com/${{ secrets.HEROKU_APP_NAME }}/web
29-
- name: Deploy
30-
run: HEROKU_API_KEY=${{ secrets.HEROKU_API_KEY }} heroku container:release web --app ${{ secrets.HEROKU_APP_NAME }}
14+
deploy-documentation:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Check out src from Git
18+
uses: actions/checkout@v4
19+
- name: Get history and tags for SCM versioning to work
20+
run: |
21+
git fetch --prune --unshallow
22+
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
23+
- name: Login to Heroku Container Registry
24+
run: echo ${{ secrets.HEROKU_API_KEY }} | docker login -u ${{ secrets.HEROKU_EMAIL }} --password-stdin registry.heroku.com
25+
- name: Build Docker Image
26+
run: docker build . --file docs/Dockerfile --tag registry.heroku.com/${{ secrets.HEROKU_APP_NAME }}/web
27+
- name: Push Docker Image
28+
run: docker push registry.heroku.com/${{ secrets.HEROKU_APP_NAME }}/web
29+
- name: Deploy
30+
run: HEROKU_API_KEY=${{ secrets.HEROKU_API_KEY }} heroku container:release web --app ${{ secrets.HEROKU_APP_NAME }}

.github/workflows/publish.yml

+12-12
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44
name: publish
55

66
on:
7-
release:
8-
types: [published]
7+
release:
8+
types: [published]
99

1010
jobs:
11-
publish:
12-
uses: ./.github/workflows/.hatch-run.yml
13-
with:
14-
job-name: "publish"
15-
hatch-run: "publish"
16-
node-registry-url: "https://registry.npmjs.org"
17-
secrets:
18-
node-auth-token: ${{ secrets.NODE_AUTH_TOKEN }}
19-
pypi-username: ${{ secrets.PYPI_USERNAME }}
20-
pypi-password: ${{ secrets.PYPI_PASSWORD }}
11+
publish:
12+
uses: ./.github/workflows/.hatch-run.yml
13+
with:
14+
job-name: "publish"
15+
hatch-run: "publish"
16+
node-registry-url: "https://registry.npmjs.org"
17+
secrets:
18+
node-auth-token: ${{ secrets.NODE_AUTH_TOKEN }}
19+
pypi-username: ${{ secrets.PYPI_USERNAME }}
20+
pypi-password: ${{ secrets.PYPI_PASSWORD }}

src/py/reactpy/tests/test_backend/test_all.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import sys
21
from collections.abc import MutableMapping
32

43
import pytest
@@ -107,17 +106,13 @@ def ShowScope():
107106
assert isinstance(scope.current, MutableMapping)
108107

109108

110-
@pytest.mark.skipIf(
111-
sys.platform == "darwin",
112-
reason="Tornado and Flask backends are currently buggy on MacOS.",
113-
)
114109
async def test_use_location(display: DisplayFixture):
115110
location = reactpy.Ref()
116111

117112
@poll
118113
async def poll_location():
119114
"""This needs to be async to allow the server to respond"""
120-
return location.current
115+
return getattr(location, "current", None)
121116

122117
@reactpy.component
123118
def ShowRoute():

0 commit comments

Comments
 (0)