diff --git a/integration_tests/README.md b/integration_tests/README.md index 44e82c847..6f1c7eb22 100644 --- a/integration_tests/README.md +++ b/integration_tests/README.md @@ -31,7 +31,15 @@ elementary_tests: pip install -r requirements.txt ``` -4. Run the tests. +4. Install elementary-data + +`elementary-data` is required for testing. Install specific version if latest doesn't fit your needs. + +```shell +pip install elementary-data +``` + +5. Run the tests. ```shell pytest -vvv -n8 diff --git a/integration_tests/tests/test_dbt_artifacts/test_artifacts.py b/integration_tests/tests/test_dbt_artifacts/test_artifacts.py index 0391dc6cb..eacdf3988 100644 --- a/integration_tests/tests/test_dbt_artifacts/test_artifacts.py +++ b/integration_tests/tests/test_dbt_artifacts/test_artifacts.py @@ -59,6 +59,38 @@ def test_dbt_invocations(dbt_project: DbtProject): ) +def test_seed_run_results(dbt_project: DbtProject): + dbt_project.read_table("seed_run_results", raise_if_empty=False) + + +def test_job_run_results(dbt_project: DbtProject): + dbt_project.read_table("job_run_results", raise_if_empty=False) + + +def test_model_run_results(dbt_project: DbtProject): + dbt_project.read_table("model_run_results", raise_if_empty=False) + + +def test_snapshot_run_results(dbt_project: DbtProject): + dbt_project.read_table("snapshot_run_results", raise_if_empty=False) + + +def test_monitors_runs(dbt_project: DbtProject): + dbt_project.read_table("monitors_runs", raise_if_empty=False) + + +def test_dbt_artifacts_hashes(dbt_project: DbtProject): + dbt_project.read_table("dbt_artifacts_hashes", raise_if_empty=False) + + +def test_anomaly_threshold_sensitivity(dbt_project: DbtProject): + dbt_project.read_table("anomaly_threshold_sensitivity", raise_if_empty=False) + + +def test_metrics_anomaly_score(dbt_project: DbtProject): + dbt_project.read_table("metrics_anomaly_score", raise_if_empty=False) + + @pytest.mark.requires_dbt_version("1.8.0") def test_source_freshness_results(test_id: str, dbt_project: DbtProject): source_config = { diff --git a/models/edr/run_results/seed_run_results.sql b/models/edr/run_results/seed_run_results.sql new file mode 100644 index 000000000..60f9e651d --- /dev/null +++ b/models/edr/run_results/seed_run_results.sql @@ -0,0 +1,44 @@ +{{ + config( + materialized = 'view', + bind=False + ) +}} + +with dbt_run_results as ( + select * from {{ ref('dbt_run_results') }} +), + +dbt_seeds as ( + select * from {{ ref('dbt_seeds') }} +) + +SELECT + run_results.model_execution_id, + run_results.unique_id, + run_results.invocation_id, + run_results.query_id, + run_results.name, + run_results.generated_at, + run_results.status, + run_results.full_refresh, + run_results.message, + run_results.execution_time, + run_results.execute_started_at, + run_results.execute_completed_at, + run_results.compile_started_at, + run_results.compile_completed_at, + run_results.compiled_code, + run_results.adapter_response, + run_results.thread_id, + seeds.database_name, + seeds.schema_name, + run_results.materialization, + seeds.tags, + seeds.package_name, + seeds.path, + seeds.original_path, + seeds.owner, + seeds.alias +FROM dbt_run_results run_results +JOIN dbt_seeds seeds ON run_results.unique_id = seeds.unique_id