Skip to content

Commit 884de7b

Browse files
committed
wip
1 parent 44e3c9c commit 884de7b

File tree

2 files changed

+41
-44
lines changed

2 files changed

+41
-44
lines changed

.github/workflows/build-and-test.yml

+32-28
Original file line numberDiff line numberDiff line change
@@ -109,31 +109,35 @@ jobs:
109109
retention-days: 2
110110
if-no-files-found: error
111111

112-
# deploy-preview:
113-
# name: Deploy tests results
114-
# needs:
115-
# - run-functional-tests
116-
# runs-on: ubuntu-latest
117-
# defaults:
118-
# run:
119-
# shell: bash
120-
# working-directory: ./tests
121-
# steps:
122-
# - uses: actions/checkout@v4
123-
# - uses: actions/download-artifact@v4
124-
# with:
125-
# name: report
126-
# path: tests/report
127-
# - name: Install Vercel CLI
128-
# run: npm install --global vercel@latest
129-
# - name: Pull Vercel Environment Information
130-
# run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
131-
# - name: Build Project Artifacts
132-
# run: vercel build --token=${{ secrets.VERCEL_TOKEN }}
133-
# - name: Deploy Project Artifacts to Vercel
134-
# run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} > url.txt
135-
# - name: Add summary
136-
# shell: bash
137-
# run: |
138-
# echo '### Deployed' >> $GITHUB_STEP_SUMMARY
139-
# cat url.txt >> $GITHUB_STEP_SUMMARY
112+
deploy-preview:
113+
name: Deploy tests results
114+
needs:
115+
- run-functional-tests
116+
runs-on: ubuntu-latest
117+
strategy:
118+
matrix:
119+
tested-os: [ubuntu-latest, windows-latest]
120+
defaults:
121+
run:
122+
shell: bash
123+
working-directory: ./tests
124+
steps:
125+
- uses: actions/checkout@v4
126+
- uses: actions/download-artifact@v4
127+
with:
128+
name: report-${{ matrix.tested-os }}
129+
path: tests/report
130+
- name: Install Vercel CLI
131+
run: npm install --global vercel@latest
132+
- name: Pull Vercel Environment Information
133+
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
134+
- name: Build Project Artifacts
135+
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}
136+
- name: Deploy Project Artifacts to Vercel
137+
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} > url.txt
138+
- name: Add summary
139+
shell: bash
140+
run: |
141+
echo '### Deployed' >> $GITHUB_STEP_SUMMARY
142+
echo ${{ matrix.tested-os }} >> $GITHUB_STEP_SUMMARY
143+
cat url.txt >> $GITHUB_STEP_SUMMARY

tests/src/test_rendering.py

+9-16
Original file line numberDiff line numberDiff line change
@@ -158,19 +158,12 @@ def run_process_capture_logs(command, cwd, name="", process_holder=None) -> None
158158
process.wait()
159159

160160

161-
def run_typing_process(workdir, text: str) -> None:
161+
def run_typing_process(text: str) -> None:
162162
if sys.platform == "win32":
163-
# with open(workdir / "type.ahk", "w", encoding="utf-8") as f:
164-
# f.write("SetKeyDelay 400, 100\n") # 400ms between keys, 100ms between down/up.
165-
# f.write(f"SendEvent \"{text}\"\n")
166-
# f.write("exit")
167-
# result = subprocess.run(["AutoHotkey.exe", "/ErrorStdOut", "type.ahk"], cwd=workdir)
168-
ahk.send(text, key_delay=400, send_mode="Event");
163+
ahk.send(text, key_delay=200, key_press_duration=50, send_mode="Event");
169164
else:
170-
result = subprocess.run(["xdotool", "type", "--delay", "400", text])
171-
#logger.info(f"stdout: {result.stdout}")
172-
#logger.info(f"stderr: {result.stderr}")
173-
#assert result.returncode == 0
165+
result = subprocess.run(["xdotool", "type", "--delay", "200", text])
166+
assert result.returncode == 0
174167

175168

176169
def __get_parameters():
@@ -190,10 +183,10 @@ def __get_parameters():
190183

191184
test_params.append(pytest.param(texts[0], examples[0]))
192185
test_params.append(pytest.param(texts[1], examples[0]))
193-
#test_params.append(pytest.param(texts[0], examples[1]))
194-
#test_params.append(pytest.param(texts[0], examples[2]))
195-
#test_params.append(pytest.param(texts[0], examples[3]))
196-
#test_params.append(pytest.param(texts[1], examples[4]))
186+
test_params.append(pytest.param(texts[0], examples[1]))
187+
test_params.append(pytest.param(texts[0], examples[2]))
188+
test_params.append(pytest.param(texts[0], examples[3]))
189+
test_params.append(pytest.param(texts[1], examples[4]))
197190

198191
return test_params
199192

@@ -213,7 +206,7 @@ def test_record_and_render(app_isolation, text: str, example) -> None:
213206
thread.start()
214207
time.sleep(2)
215208

216-
run_typing_process(app_dir, text)
209+
run_typing_process(text)
217210

218211
process = processes.get("klawa")
219212
if process and process.poll() is None:

0 commit comments

Comments
 (0)