Skip to content

Commit 2368b59

Browse files
authored
tests: add sdm unit tests from source-declarative-manifest connector directory (#82)
1 parent 249fa23 commit 2368b59

15 files changed

+1557
-10
lines changed

.github/release-drafter.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ categories:
1515
- "chore"
1616
- "ci"
1717
- "refactor"
18+
- "testing"
1819
- title: "Documentation 📖"
1920
label: "docs"
2021
change-template: "- $TITLE (#$NUMBER)"
@@ -38,6 +39,9 @@ autolabeler:
3839
- label: "chore"
3940
title:
4041
- '/^chore(\(.*\))?\:/i'
42+
- label: "testing"
43+
title:
44+
- '/^tests(\(.*\))?\:/i'
4145
- label: "ci"
4246
title:
4347
- '/^ci(\(.*\))?\:/i'

.github/workflows/pytest_fast.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,7 @@ on:
44
push:
55
branches:
66
- main
7-
paths:
8-
- 'airbyte_cdk/**'
9-
- 'poetry.lock'
10-
- 'pyproject.toml'
117
pull_request:
12-
paths:
13-
- 'airbyte_cdk/**'
14-
- 'poetry.lock'
15-
- 'pyproject.toml'
168

179
jobs:
1810
pytest-fast:

.github/workflows/pytest_matrix.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ on:
1313
- main
1414
paths:
1515
- 'airbyte_cdk/**'
16+
- 'unit_tests/**'
1617
- 'poetry.lock'
1718
- 'pyproject.toml'
1819
pull_request:
1920
paths:
2021
- 'airbyte_cdk/**'
22+
- 'unit_tests/**'
2123
- 'poetry.lock'
2224
- 'pyproject.toml'
2325

.github/workflows/semantic_pr_check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ jobs:
3737
Chore
3838
build
3939
Build
40-
test
41-
Test
40+
tests
41+
Tests

unit_tests/source_declarative_manifest/__init__.py

Whitespace-only changes.
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#
2+
# Copyright (c) 2024 Airbyte, Inc., all rights reserved.
3+
#
4+
5+
import pytest
6+
import os
7+
import yaml
8+
9+
10+
def get_fixture_path(file_name):
11+
return os.path.join(os.path.dirname(__file__), file_name)
12+
13+
14+
@pytest.fixture
15+
def valid_remote_config():
16+
return get_fixture_path("resources/valid_remote_config.json")
17+
18+
19+
@pytest.fixture
20+
def invalid_remote_config():
21+
return get_fixture_path("resources/invalid_remote_config.json")
22+
23+
24+
@pytest.fixture
25+
def valid_local_manifest():
26+
return get_fixture_path("resources/valid_local_manifest.yaml")
27+
28+
29+
@pytest.fixture
30+
def invalid_local_manifest():
31+
return get_fixture_path("resources/invalid_local_manifest.yaml")
32+
33+
34+
@pytest.fixture
35+
def valid_local_manifest_yaml(valid_local_manifest):
36+
with open(valid_local_manifest, "r") as file:
37+
return yaml.safe_load(file)
38+
39+
40+
@pytest.fixture
41+
def invalid_local_manifest_yaml(invalid_local_manifest):
42+
with open(invalid_local_manifest, "r") as file:
43+
return yaml.safe_load(file)
44+
45+
46+
@pytest.fixture
47+
def valid_local_config_file():
48+
return get_fixture_path("resources/valid_local_pokeapi_config.json")
49+
50+
51+
@pytest.fixture
52+
def invalid_local_config_file():
53+
return get_fixture_path("resources/invalid_local_pokeapi_config.json")

unit_tests/source_declarative_manifest/resources/__init__.py

Whitespace-only changes.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: 0.78.5
2+
3+
type: DeclarativeSource
4+
5+
check:
6+
type: CheckStream
7+
stream_names:
8+
- pokemon
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

0 commit comments

Comments
 (0)