-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AN-4129/fix-long-running-daily-tests (#97)
* transfer tests * add missing test
- Loading branch information
1 parent
05eb6a2
commit 1b05690
Showing
4 changed files
with
107 additions
and
2 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
models/silver/core/tests/transfers/test_silver__transfers_full.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
models/silver/core/tests/transfers/test_silver__transfers_recent.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
) |
67 changes: 67 additions & 0 deletions
67
models/silver/core/tests/transfers/test_silver__transfers_recent.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]+ |