Skip to content

Commit 33133f7

Browse files
authored
chore: Add CI tests (#38)
1 parent ed7f4e4 commit 33133f7

File tree

11 files changed

+154
-8
lines changed

11 files changed

+154
-8
lines changed

.github/workflows/lint.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Lint with Black
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Set up Python
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: "3.13"
20+
- name: Install dependencies
21+
run: |
22+
pip3 install --no-cache-dir poetry==2.1.4
23+
poetry install --no-interaction --no-ansi --no-root
24+
- name: Check formatting
25+
run: make fmt-check

.github/workflows/unittests.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Test
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
test:
11+
timeout-minutes: 30
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
- # Required for the package command tests to work
19+
name: Set up Docker Buildx
20+
uses: docker/setup-buildx-action@v3
21+
- name: Set up Python
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: "3.13"
25+
- name: Install dependencies
26+
run: |
27+
pip3 install --no-cache-dir poetry==2.1.4
28+
poetry install --no-interaction --no-ansi --no-root
29+
- name: Run tests
30+
run: make test

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ WORKDIR /app
77
# Copy requirements.txt and install the Python dependencies
88
COPY pyproject.toml .
99
COPY poetry.lock .
10-
RUN pip3 install --no-cache-dir poetry
10+
RUN pip3 install --no-cache-dir poetry==2.1.4
1111
RUN poetry install --no-interaction --no-ansi --no-root
1212

1313
# Copy the rest of the code

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
test:
2-
pytest .
2+
poetry run pytest . -vv
33

44
fmt:
5-
black .
5+
poetry run black .
66

77
fmt-check:
8-
black --check .
8+
poetry run black --check .

TestConfig.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ kind: destination
1313
spec:
1414
name: sqlite
1515
path: cloudquery/sqlite
16-
version: "v2.4.11"
16+
version: "v2.4.11" # latest version of destination sqlite plugin
1717
spec:
1818
connection_string: ./db.sqlite
File renamed without changes.

plugin/plugin.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919
class ExamplePlugin(plugin.Plugin):
2020
def __init__(self) -> None:
2121
super().__init__(
22-
PLUGIN_NAME, PLUGIN_VERSION, plugin.plugin.Options(team=TEAM_NAME, kind=PLUGIN_KIND)
22+
PLUGIN_NAME,
23+
PLUGIN_VERSION,
24+
plugin.plugin.Options(team=TEAM_NAME, kind=PLUGIN_KIND),
2325
)
2426
self._spec_json = None
2527
self._spec = None

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
description = ""
55
authors = ["Plaintextnerds <[email protected]>"]
66
readme = "README.md"
7-
packages = [{include = "plugin"}]
7+
packages = [{ include = "plugin" }]
88

99
[tool.poetry.dependencies]
1010
python = ">=3.11,<3.14"
@@ -20,4 +20,3 @@ main = "main:main"
2020
[build-system]
2121
requires = ["poetry-core"]
2222
build-backend = "poetry.core.masonry.api"
23-

pytest.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[pytest]
2+
python_files = tests/*.py

tests/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)