Skip to content

Commit 48db664

Browse files
committed
tests
1 parent fbbc33c commit 48db664

File tree

7 files changed

+401
-50
lines changed

7 files changed

+401
-50
lines changed

.github/workflows/ci.yml

Lines changed: 54 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,60 @@
1-
### A CI workflow template that runs linting and python testing
2-
### TODO: Modify as needed or as desired.
3-
41
name: Test target-redshift
52

6-
on:
3+
on:
74
pull_request:
8-
types: ["opened", "synchronize", "reopened"]
5+
types: [opened, synchronize, reopened]
6+
push:
7+
branches: [main]
8+
workflow_dispatch:
9+
inputs: {}
910

1011
jobs:
11-
linter:
12-
runs-on: ubuntu-latest
12+
tests:
13+
runs-on: depot-ubuntu-22.04
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
python-version:
18+
- "3.12"
19+
- "3.11"
20+
- "3.10"
21+
- "3.9"
22+
- "3.8"
23+
steps:
24+
- uses: actions/checkout@v4
25+
- name: Set up Python '${{ matrix.python-version }}'
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version: '${{ matrix.python-version }}'
29+
- name: Install Poetry
30+
env:
31+
PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/constraints.txt
32+
run: |
33+
python -m pip install --upgrade pip
34+
pipx install poetry
35+
- name: Install dependencies
36+
run: |
37+
poetry env use python${{ matrix.python-version }}
38+
poetry install
39+
- name: Run pytest
40+
run: |
41+
poetry run pytest --capture=no
42+
- name: Run lint
43+
run: |
44+
poetry run tox -e lint
45+
46+
integration:
47+
runs-on: depot-ubuntu-22.04
1348
steps:
14-
- uses: actions/checkout@v4
15-
- uses: chartboost/ruff-action@v1
16-
# pytest:
17-
# runs-on: ubuntu-latest
18-
# env:
19-
# GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
20-
# strategy:
21-
# matrix:
22-
# python-version: ["3.8", "3.9", "3.10", "3.11"]
23-
# steps:
24-
# - uses: actions/checkout@v3
25-
# - name: Set up Python ${{ matrix.python-version }}
26-
# uses: actions/setup-python@v4
27-
# with:
28-
# python-version: ${{ matrix.python-version }}
29-
# - name: Install Poetry
30-
# run: |
31-
# pip install poetry
32-
# - name: Install dependencies
33-
# run: |
34-
# poetry install
35-
# - name: Test with pytest
36-
# run: |
37-
# poetry run pytest
49+
- uses: actions/checkout@v4
50+
- name: Set up Python
51+
uses: actions/setup-python@v5
52+
with:
53+
python-version: 3.x
54+
- name: Install dependencies
55+
run: |
56+
python -m pip install --upgrade pip
57+
pipx install meltano
58+
meltano install
59+
- name: smoke-test-tap
60+
run: meltano run tap-smoke-test target-postgres

config.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

test.ipynb

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": 2,
6+
"metadata": {},
7+
"outputs": [],
8+
"source": [
9+
"import redshift_connector"
10+
]
11+
},
12+
{
13+
"cell_type": "code",
14+
"execution_count": 3,
15+
"metadata": {},
16+
"outputs": [],
17+
"source": [
18+
"connection = redshift_connector.connect(\n",
19+
" user=\"target_redshift_test\",\n",
20+
" password=\"cqzixvWUg4JknqPxFTp..mHGnDPEJX\",\n",
21+
" host=\"localhost\",\n",
22+
" port=\"5001\",\n",
23+
" database=\"reporting\"\n",
24+
" )"
25+
]
26+
},
27+
{
28+
"cell_type": "code",
29+
"execution_count": 4,
30+
"metadata": {},
31+
"outputs": [],
32+
"source": [
33+
"cursor = connection.cursor()"
34+
]
35+
},
36+
{
37+
"cell_type": "code",
38+
"execution_count": 5,
39+
"metadata": {},
40+
"outputs": [
41+
{
42+
"data": {
43+
"text/plain": [
44+
"<redshift_connector.cursor.Cursor at 0x106e86f20>"
45+
]
46+
},
47+
"execution_count": 5,
48+
"metadata": {},
49+
"output_type": "execute_result"
50+
}
51+
],
52+
"source": [
53+
"cursor.execute(\"create schema target_redshift_test\")"
54+
]
55+
},
56+
{
57+
"cell_type": "code",
58+
"execution_count": 6,
59+
"metadata": {},
60+
"outputs": [],
61+
"source": [
62+
"connection.commit()"
63+
]
64+
}
65+
],
66+
"metadata": {
67+
"kernelspec": {
68+
"display_name": ".venv",
69+
"language": "python",
70+
"name": "python3"
71+
},
72+
"language_info": {
73+
"codemirror_mode": {
74+
"name": "ipython",
75+
"version": 3
76+
},
77+
"file_extension": ".py",
78+
"mimetype": "text/x-python",
79+
"name": "python",
80+
"nbconvert_exporter": "python",
81+
"pygments_lexer": "ipython3",
82+
"version": "3.10.14"
83+
}
84+
},
85+
"nbformat": 4,
86+
"nbformat_minor": 2
87+
}

tests/conftest.py

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)