Skip to content

Commit 455bdf3

Browse files
authored
Add test workflow
1 parent 0f164f9 commit 455bdf3

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

.github/workflows/test.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- "**"
10+
11+
jobs:
12+
test:
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
matrix:
16+
os: [ubuntu-latest]
17+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
18+
19+
steps:
20+
- name: Check out repository
21+
uses: actions/checkout@v2
22+
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v2
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
28+
- name: Install dependencies
29+
run: |
30+
pip install pipenv
31+
pipenv install --dev
32+
bash ./scripts/install_nats.sh
33+
34+
- name: Run tests
35+
run: |
36+
pipenv run flake8 --ignore=W391 ./nats/js/
37+
pipenv run pytest -x -vv -s --continue-on-collection-errors
38+
env:
39+
PATH: $HOME/nats-server:$PATH

tests/test_client.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,10 @@ async def next_msg():
580580

581581
await nc.publish(f"tests.3", b'bar')
582582
await nc.flush()
583+
584+
# FIXME: this test is flaky
585+
await asyncio.sleep(1.0)
586+
583587
msg = await next_msg()
584588
self.assertEqual("tests.3", msg.subject)
585589

0 commit comments

Comments
 (0)