Skip to content

Commit

Permalink
tests: add sdm unit tests from source-declarative-manifest connector …
Browse files Browse the repository at this point in the history
…directory (#82)
  • Loading branch information
aaronsteers authored Nov 21, 2024
1 parent 249fa23 commit 2368b59
Show file tree
Hide file tree
Showing 15 changed files with 1,557 additions and 10 deletions.
4 changes: 4 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ categories:
- "chore"
- "ci"
- "refactor"
- "testing"
- title: "Documentation 📖"
label: "docs"
change-template: "- $TITLE (#$NUMBER)"
Expand All @@ -38,6 +39,9 @@ autolabeler:
- label: "chore"
title:
- '/^chore(\(.*\))?\:/i'
- label: "testing"
title:
- '/^tests(\(.*\))?\:/i'
- label: "ci"
title:
- '/^ci(\(.*\))?\:/i'
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/pytest_fast.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,7 @@ on:
push:
branches:
- main
paths:
- 'airbyte_cdk/**'
- 'poetry.lock'
- 'pyproject.toml'
pull_request:
paths:
- 'airbyte_cdk/**'
- 'poetry.lock'
- 'pyproject.toml'

jobs:
pytest-fast:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/pytest_matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ on:
- main
paths:
- 'airbyte_cdk/**'
- 'unit_tests/**'
- 'poetry.lock'
- 'pyproject.toml'
pull_request:
paths:
- 'airbyte_cdk/**'
- 'unit_tests/**'
- 'poetry.lock'
- 'pyproject.toml'

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/semantic_pr_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ jobs:
Chore
build
Build
test
Test
tests
Tests
Empty file.
53 changes: 53 additions & 0 deletions unit_tests/source_declarative_manifest/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#
# Copyright (c) 2024 Airbyte, Inc., all rights reserved.
#

import pytest
import os
import yaml


def get_fixture_path(file_name):
return os.path.join(os.path.dirname(__file__), file_name)


@pytest.fixture
def valid_remote_config():
return get_fixture_path("resources/valid_remote_config.json")


@pytest.fixture
def invalid_remote_config():
return get_fixture_path("resources/invalid_remote_config.json")


@pytest.fixture
def valid_local_manifest():
return get_fixture_path("resources/valid_local_manifest.yaml")


@pytest.fixture
def invalid_local_manifest():
return get_fixture_path("resources/invalid_local_manifest.yaml")


@pytest.fixture
def valid_local_manifest_yaml(valid_local_manifest):
with open(valid_local_manifest, "r") as file:
return yaml.safe_load(file)


@pytest.fixture
def invalid_local_manifest_yaml(invalid_local_manifest):
with open(invalid_local_manifest, "r") as file:
return yaml.safe_load(file)


@pytest.fixture
def valid_local_config_file():
return get_fixture_path("resources/valid_local_pokeapi_config.json")


@pytest.fixture
def invalid_local_config_file():
return get_fixture_path("resources/invalid_local_pokeapi_config.json")
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 0.78.5

type: DeclarativeSource

check:
type: CheckStream
stream_names:
- pokemon
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Loading

0 comments on commit 2368b59

Please sign in to comment.