Skip to content

Commit

Permalink
Add test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
caspervonb authored Sep 24, 2024
1 parent 0f164f9 commit 455bdf3
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: test

on:
push:
branches:
- main
pull_request:
branches:
- "**"

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- name: Check out repository
uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
pip install pipenv
pipenv install --dev
bash ./scripts/install_nats.sh
- name: Run tests
run: |
pipenv run flake8 --ignore=W391 ./nats/js/
pipenv run pytest -x -vv -s --continue-on-collection-errors
env:
PATH: $HOME/nats-server:$PATH
4 changes: 4 additions & 0 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,10 @@ async def next_msg():

await nc.publish(f"tests.3", b'bar')
await nc.flush()

# FIXME: this test is flaky
await asyncio.sleep(1.0)

msg = await next_msg()
self.assertEqual("tests.3", msg.subject)

Expand Down

0 comments on commit 455bdf3

Please sign in to comment.