Skip to main content

The dbt adapter tests for adapter plugins

Project description

dbt logo

dbt-tests-adapter

For context and guidance on using this package, please read: "Testing a new adapter"

What is it?

This package includes reusable test cases that reinforce behaviors common to all or many adapter plugins. There are two categories of tests:

  1. Basic tests that every adapter plugin is expected to pass. These are defined in tests.adapter.basic. Given differences across data platforms, these may require slight modification or reimplementation. Significantly overriding or disabling these tests should be with good reason, since each represents basic functionality expected by dbt users. For example, if your adapter does not support incremental models, you should disable the test, by marking it with skip or xfail, as well as noting that limitation in any documentation, READMEs, and usage guides that accompany your adapter.

  2. Optional tests, for second-order functionality that is common across plugins, but not required for basic use. Your plugin can opt into these test cases by inheriting existing ones, or reimplementing them with adjustments. For now, this category includes all tests located outside the basic subdirectory. More tests will be added as we convert older tests defined on dbt-core and mature plugins to use the standard framework.

How to use it?

Each test case in this repo is packaged as a class, prefixed Base. To enable a test case to run with your adapter plugin, you should inherit the base class into a new class, prefixed Test. That test class will be discovered and run by pytest. It can also makes modifications if needed.

class TestSimpleMaterializations(BaseSimpleMaterializations):
    pass

Distribution

To install:

pip install dbt-tests-adapter

This package is versioned in lockstep with dbt-core, and the same versioning guidelines apply:

  • New "basic" test cases MAY be added in minor versions ONLY. They may not be included in patch releases.
  • Breaking changes to existing test cases MAY be included and communicated as part of minor version upgrades ONLY. They MAY NOT be included in patch releases. We will aim to avoid these whenever possible.
  • New "optional" test cases, and non-breaking fixes to existing test cases, MAY be added in minor or patch versions.

Assuming you adapter plugin is pinned to a specific minor version of dbt-core (e.g. ~=1.1.0), you can use the same pin for dbt-tests-adapter.

Note: This is packaged as a plugin using a python namespace package. It cannot have an __init__.py file in the part of the hierarchy to which it needs to be attached.

Project details


Release history Release notifications | RSS feed

This version

1.6.7

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dbt-tests-adapter-1.6.7.tar.gz (119.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dbt_tests_adapter-1.6.7-py3-none-any.whl (169.1 kB view details)

Uploaded Python 3

File details

Details for the file dbt-tests-adapter-1.6.7.tar.gz.

File metadata

  • Download URL: dbt-tests-adapter-1.6.7.tar.gz
  • Upload date:
  • Size: 119.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.6

File hashes

Hashes for dbt-tests-adapter-1.6.7.tar.gz
Algorithm Hash digest
SHA256 44caf71323f409d2f8c3ee195462565aafa64c7f8f8039134804f1d02e9cf16c
MD5 1d47e59ca938836b5270659f1cc0497f
BLAKE2b-256 a96312cb07f6d8a69a6adfa4992775b31e914538fe93b5cdb96b14ec6ea9977b

See more details on using hashes here.

File details

Details for the file dbt_tests_adapter-1.6.7-py3-none-any.whl.

File metadata

File hashes

Hashes for dbt_tests_adapter-1.6.7-py3-none-any.whl
Algorithm Hash digest
SHA256 d54ead453c2f50d6f345bb12c29f902ad433125fc14c7a106acfd987c3b60292
MD5 a0ee01e691b80322a8a4c47f29dc8ece
BLAKE2b-256 6c54b4efe5f841941cba4a71409c6a395c8de8f6c835a96478adf116cd7d164b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page