Skip to content

Commit 6c120d8

Browse files
authored
Using Github Action to run the tests (#263)
* Using Github Action to run the tests * Fix pytest.ini grammar
1 parent 869e825 commit 6c120d8

File tree

2 files changed

+46
-1
lines changed

2 files changed

+46
-1
lines changed

.github/workflows/ci.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
jobs:
10+
tests:
11+
name: Tests (Python ${{ matrix.python-version }})
12+
runs-on: ubuntu-latest
13+
services:
14+
hbase:
15+
image: dajobe/hbase
16+
ports:
17+
- 9090:9090
18+
19+
strategy:
20+
matrix:
21+
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
22+
23+
steps:
24+
- uses: actions/checkout@v4
25+
26+
- name: Set up Python ${{ matrix.python-version }}
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: ${{ matrix.python-version }}
30+
31+
- name: Install dependencies
32+
run: pip install pytest pytest-cov -r requirements.txt
33+
34+
- name: Wait for HBase Thrift server
35+
run: |
36+
echo "Waiting for HBase Thrift server on port 9090..."
37+
timeout 120 bash -c 'until nc -z localhost 9090; do echo "Still waiting..."; sleep 5; done'
38+
echo "HBase Thrift server is ready"
39+
40+
- name: Run tests
41+
env:
42+
HAPPYBASE_HOST: localhost
43+
HAPPYBASE_PORT: "9090"
44+
run: pytest tests/ -v --tb=short

pytest.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
pytest --cov=happybase --cov-report html tests/
1+
[pytest]
2+
addopts = --cov=happybase --cov-report html

0 commit comments

Comments
 (0)