Skip to content

Commit

Permalink
wip4
Browse files Browse the repository at this point in the history
  • Loading branch information
adamws committed Oct 28, 2024
1 parent 0ac0ebc commit 41fcde4
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 6 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
shell: bash
run: |
chmod +x zig-out/bin/klawa
cd tests && . .env/bin/activate && python -m pytest
cd tests && . .env/bin/activate && python -m pytest -n auto src/
- uses: actions/upload-artifact@v4
if: always()
with:
Expand All @@ -82,6 +82,10 @@ jobs:
needs:
- run-functional-tests
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: ./tests
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion .justfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ test-queue:
zig test src/spsc_queue.zig

pytest:
. .env/bin/activate && cd tests && python -m pytest
cd tests && . .env/bin/activate && python -m pytest -n auto src/
5 changes: 5 additions & 0 deletions tests/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.env/
.pytest_cache/
.vercel/
__pycache__/
report/
2 changes: 1 addition & 1 deletion tests/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e
set -u

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
DEPLOY_DIR=${SCRIPT_DIR}/../.vercel/output
DEPLOY_DIR=${SCRIPT_DIR}/.vercel/output
REPORT_DIR=${SCRIPT_DIR}/report

rm -rf $DEPLOY_DIR
Expand Down
1 change: 1 addition & 0 deletions tests/dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ Pillow==10.4.0
pytest==8.3.0
pytest-metadata==3.1.1
pytest-html==4.1.1
pytest-xdist==3.6.1
PyVirtualDisplay==3.0
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/conftest.py → tests/src/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ def pytest_runtest_makereport(item, call):
for f in videos:
dest = shutil.copy(f, artifact_dir / f"output{webm_count}.webm")
dest = Path(dest).relative_to(artifact_dir)
html = f'<video controls><source src="{dest}" type="video/webm"></video>'
html = f'<video controls autoplay loop><source src="{dest}" type="video/webm"></video>'
extras.append(pytest_html.extras.html(html))
report.extras = extras
2 changes: 1 addition & 1 deletion tests/test_rendering.py → tests/src/test_rendering.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def test_record_and_render(app_isolation, text: str) -> None:
args=([app, "--record", "events.bin"], app_dir, "klawa", processes,)
)
thread.start()
time.sleep(0.5)
time.sleep(2)

subprocess.run(["xdotool", "type", "--delay", "200", text])

Expand Down
2 changes: 1 addition & 1 deletion vercel.json → tests/vercel.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"buildCommand": "./tests/deploy.sh",
"buildCommand": "./deploy.sh",
"outputDirectory": ".vercel/output"
}

0 comments on commit 41fcde4

Please sign in to comment.