dbt-unit-testing
This dbt package contains macros to support unit testing that can be (re)used across dbt projects.
File Explorer
Download Latest Version (.zip)- main.yml
- pr_integration_tests.yml
- stale.yml
- profiles.yml
- macro_with_ref.sql
- refs.sql
- test_helpers.sql
- model_references_model_with_reserved_column_name_bq.sql
- model_references_model_with_structs.sql
- model_with_quoted_columns_1_bq.sql
- model_with_quoted_columns_2_bq.sql
- model_with_reserved_column_name_bq.sql
- model_with_structs.sql
- sources.yml
- incremental_model_1.sql
- incremental_model_2.sql
- incremental_model_using_incremental_model.sql
- model-refers-model-with-dashes.sql
- model-refers-source-with-dashes.sql
- model-with-dashes.sql
- model_11.sql
- model_12.sql
- model_21.sql
- model_22.sql
- model_31.sql
- model_a.sql
- model_b_references_a.sql
- model_b_references_model_with_builtin_ref.sql
- model_b_references_subpackage.sql
- model_c_references_model_with_source.sql
- model_d_references_c_and_b.sql
- model_e_references_a_and_seed.sql
- model_ephemeral.sql
- model_f_references_a_non_nullable_field.sql
- model_for_column_transformations.sql
- model_for_incremental.sql
- model_in_database.sql
- model_references_complex_query.sql
- model_references_ephemeral.sql
- model_references_model_with_comment.sql
- model_references_model_with_reserved_column_name.sql
- model_references_model_with_upper_column_name.sql
- model_references_model_with_version.sql
- model_references_model_with_version_1.sql
- model_references_model_with_version_2.sql
- model_references_snapshot.sql
- model_refers_source_with_identifier.sql
- model_union_multi_schema.sql
- model_with_comment.sql
- model_with_complex_query.sql
- model_with_existing_source.sql
- model_with_model_object.sql
- model_with_quoted_columns_1.sql
- model_with_quoted_columns_2.sql
- model_with_reserved_column_name.sql
- model_with_source.sql
- model_with_upper_column_name.sql
- model_with_version_v1.sql
- model_with_version_v2.sql
- schema.yml
- multi_schema_1.csv
- multi_schema_2.csv
- sample_source_identifier.csv
- sample_source_without_columns_declared.csv
- source_1.csv
- source_2.csv
- seed.csv
- properties.yml
- sample_snapshot.sql
- model_references_model_with_structs.sql
- model_with_quoted_columns_2_bq.sql
- reserved_column_names_bq.sql
- reserved_column_names_mocking_bq.sql
- model_for_column_transformations_sf.sql
- expect_no_rows.sql
- incremental_model_1.sql
- incremental_model_using_incremental_model.sql
- mock_input_styles.sql
- model_31.sql
- model_b_references_a.sql
- model_b_references_model_with_builtin_ref.sql
- model_b_references_subpackage.sql
- model_c_references_model_with_source_test.sql
- model_d_references_c_and_b.sql
- model_e_references_a_and_seed.sql
- model_f_references_a_non_nullable_field.sql
- model_for_column_transformations.sql
- model_references_ephemeral.sql
- model_references_model_with_comment.sql
- model_references_model_with_version.sql
- model_references_snapshot.sql
- model_refers_model_with_dashes.sql
- model_refers_source_with_dashes.sql
- model_refers_source_with_identifier.sql
- model_union_multi_schema.sql
- model_with_comment.sql
- model_with_existing_source.sql
- model_with_model_object.sql
- model_with_quoted_columns_2.sql
- model_with_source.sql
- model_with_version.sql
- partial_mocking.sql
- references_complex_query.sql
- reserved_column_names.sql
- reserved_column_names_mocking.sql
- sample_snapshot.sql
- test_failures.sql
- upper_column_names_mocking.sql
- dbt_project.yml
- Makefile
- package-lock.yml
- packages.yml
- README.md
- model_references_parent_model.sql
- sources.yml
- sub_package_model_a.sql
- sub_package_model_b_references_a.sql
- model_references_parent_model.sql
- sub_package_model_b_references_a.sql
- dbt_project.yml
- packages.yml
- .user.yml
- profiles.yml
- dbdiagram_definition.txt
- jaffle_shop_erd.png
- macros.sql
- schema.yml
- stg_customers.sql
- stg_orders.sql
- stg_payments.sql
- customers.sql
- docs.md
- overview.md
- schema.yml
- .gitkeep
- properties.yml
- raw_customers.csv
- raw_orders.csv
- raw_payments.csv
- tests.sql
- tests_using_include_missing_columns.sql
- .gitignore
- dbt_project.yml
- LICENSE
- Makefile
- packages.yml
- README.md
- input_parsing.sql
- mock_builders.sql
- output.sql
- overrides.sql
- sql_builders.sql
- tests.sql
- utils.sql
- .gitignore
- dbt_project.yml
- docker-compose.yml
- LICENSE
- package-lock.yml
- packages.yml
- README.md
- run-all-integration-tests.sh
- run-all-jaffle-shop-tests.sh
- run-integration-tests.sh
- run-jaffle-shop-tests.sh
- run-tests-helper.sh
- run-tests-on-dbt-version.sh
# Installation Guide
1. Get the code
git clone https://github.com/EqualExperts/dbt-unit-testing
Downloads the entire project code from GitHub to your computer.
cd dbt-unit-testing
Moves into the project folder you just downloaded.
2. Docker
Easy RecommendedPrerequisites
- Git Needed to download the project code from GitHub.
- Docker Desktop Needed to build and run containers. Install it and keep it running in the background.
docker compose up -d --build
Builds and starts all defined containers (server, database, etc.) at once, in the background.
Run docker compose ps to check the containers are Up. If the README mentions a port, open http://localhost:PORT in your browser.
3. Make
MediumPrerequisites
- Git Needed to download the project code from GitHub.
- Make Usually pre-installed on Linux/macOS. On Windows, install separately (e.g. via MSYS2 or WSL).
cd integration-tests
This project's files live in a subfolder, so move into it first.
make
Compiles the code based on the generated build configuration to produce an executable.
If it finishes without errors, it worked. Try running the generated executable directly.
// repository documentation
Was this content helpful?
(0 ratings)
