Skip to content

Commit

Permalink
AN-4129/fix-long-running-daily-tests (#97)
Browse files Browse the repository at this point in the history
* transfer tests

* add missing test
  • Loading branch information
mattromano authored Nov 7, 2023
1 parent 05eb6a2 commit 1b05690
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{{ config (
materialized = 'view',
tags = ['full_test']
) }}

SELECT
*
FROM
{{ ref('silver__transfers') }}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: 2
models:
- name: silver__transfers
- name: test_silver__transfers_full
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
Expand Down Expand Up @@ -65,4 +65,6 @@ models:
- name: ORIGIN_TO_ADDRESS
tests:
- dbt_expectations.expect_column_values_to_match_regex:
regex: 0[xX][0-9a-fA-F]+
regex: 0[xX][0-9a-fA-F]+


Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{ config (
materialized = 'view',
tags = ['recent_test']
) }}

WITH last_3_days AS (

SELECT
block_number
FROM
{{ ref("_max_block_by_date") }}
qualify ROW_NUMBER() over (
ORDER BY
block_number DESC
) = 3
)
SELECT
*
FROM
{{ ref('silver__transfers') }}
WHERE
block_number >= (
SELECT
block_number
FROM
last_3_days
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
version: 2
models:
- name: test_silver__transfers_recent
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- _LOG_ID
columns:
- name: BLOCK_NUMBER
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- NUMBER
- FLOAT
- name: BLOCK_TIMESTAMP
tests:
- not_null
- dbt_expectations.expect_row_values_to_have_recent_data:
datepart: day
interval: 1
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- TIMESTAMP_NTZ
- name: TX_HASH
tests:
- not_null
- dbt_expectations.expect_column_values_to_match_regex:
regex: 0[xX][0-9a-fA-F]+
- name: CONTRACT_ADDRESS
tests:
- not_null
- dbt_expectations.expect_column_values_to_match_regex:
regex: 0[xX][0-9a-fA-F]+
- name: FROM_ADDRESS
tests:
- not_null:
where: BLOCK_TIMESTAMP > '2021-08-01'
- dbt_expectations.expect_column_values_to_match_regex:
regex: 0[xX][0-9a-fA-F]+
- name: TO_ADDRESS
tests:
- not_null
- dbt_expectations.expect_column_values_to_match_regex:
regex: 0[xX][0-9a-fA-F]+
- name: RAW_AMOUNT
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- NUMBER
- FLOAT
- name: _LOG_ID
tests:
- not_null
- name: ORIGIN_FUNCTION_SIGNATURE
tests:
- not_null
- name: ORIGIN_FROM_ADDRESS
tests:
- not_null
- dbt_expectations.expect_column_values_to_match_regex:
regex: 0[xX][0-9a-fA-F]+
- name: ORIGIN_TO_ADDRESS
tests:
- dbt_expectations.expect_column_values_to_match_regex:
regex: 0[xX][0-9a-fA-F]+

0 comments on commit 1b05690

Please sign in to comment.