port over marketplace tests

This commit is contained in:
shah 2025-02-24 14:15:48 -08:00
parent 2ae5fbfb7e
commit 5c88c475b1
18 changed files with 97 additions and 31 deletions

View File

@ -25,6 +25,10 @@ on:
schedule:
# Runs “Daily at midnight GMT” (see https://crontab.guru)
- cron: '0 0 * * *'
pull_request:
paths:
- 'models/deploy/marketplace/**'
- 'macros/marketplace/**'
concurrency:
group: ${{ github.workflow }}
@ -46,4 +50,13 @@ jobs:
with:
warehouse: ${{ inputs.warehouse }}
environment: ${{ inputs.environment }}
command: dbt test --selector test_udfs --threads 24
command: dbt test --selector test_udfs --threads 24
pull_request:
uses: ./.github/workflows/dbt.yml
if: github.event_name == 'pull_request'
secrets: inherit
with:
warehouse: ${{ vars.WAREHOUSE }}
environment: dev
command: dbt test --selector test_udfs --threads 24

View File

@ -86,7 +86,7 @@
'GET',
url,
{},
{},
NULL,
_utils.UDF_WHOAMI(),
''
)

View File

@ -2,10 +2,14 @@
SELECT {{ schema_name -}}.nfts_get(NETWORK, '/{{api_path}}', QUERY_ARGS) as response
{% endmacro %}
{% macro alchemy_nft_get_api_call_version(schema_name, api_path, version) %}
SELECT {{ schema_name -}}.nfts_get(NETWORK, '{{version}}', '/{{api_path}}', QUERY_ARGS) as response
{% endmacro %}
{% macro alchemy_nft_post_api_call(schema_name, api_path) %}
SELECT {{ schema_name -}}.nfts_post(NETWORK, '/{{api_path}}', BODY) as response
{% endmacro %}
{% macro alchemy_rpc_call(schema_name, method) %}
SELECT {{ schema_name -}}.rpc(NETWORK, '{{method}}', PARAMS) as response
{% endmacro %}
{% endmacro %}

View File

@ -22,6 +22,26 @@
'_FSC_SYS/ALCHEMY'
) as response
- name: {{ schema -}}.nfts_get
signature:
- [NETWORK, STRING, The blockchain/network]
- [VERSION, STRING, The version of the API to use]
- [PATH, STRING, The path starting with '/']
- [QUERY_ARGS, OBJECT, The query arguments]
return_type:
- "VARIANT"
options: |
COMMENT = $$Used to issue a 'GET' request to the Alchemy NFT API.$$
sql: |
SELECT
live.udf_api(
concat(
'https://', NETWORK,'.g.alchemy.com/nft/', VERSION, '/{',NETWORK,'}', PATH, '?',
utils.udf_object_to_url_query_string(QUERY_ARGS)
),
'_FSC_SYS/ALCHEMY'
) as response
- name: {{ schema -}}.nfts_post
signature:
- [NETWORK, STRING, The blockchain/network]
@ -57,4 +77,4 @@
{},
{'id': 1,'jsonrpc': '2.0','method': METHOD,'params': PARAMS},
'_FSC_SYS/ALCHEMY') as response
{% endmacro %}
{% endmacro %}

View File

@ -17,7 +17,7 @@
'GET',
concat('https://api.apilayer.com', PATH, '?', utils.udf_object_to_url_query_string(QUERY_ARGS)),
{'apikey': '{API_KEY}'},
{},
NULL,
'_FSC_SYS/APILAYER'
) as response
@ -39,4 +39,4 @@
'_FSC_SYS/APILAYER'
) as response
{% endmacro %}
{% endmacro %}

View File

@ -17,7 +17,7 @@
'GET',
concat('https://pro-api.coinmarketcap.com', PATH, '?', utils.udf_object_to_url_query_string(QUERY_ARGS)),
{'X-CMC_PRO_API_KEY': '{API_KEY}'},
{},
NULL,
'_FSC_SYS/CMC'
) as response
@ -39,4 +39,4 @@
'_FSC_SYS/CMC'
) as response
{% endmacro %}
{% endmacro %}

View File

@ -15,8 +15,8 @@
SELECT
live.udf_api(
'GET',
concat('https://api.dappradar.com', PATH, '?', utils.udf_object_to_url_query_string(QUERY_ARGS)),
{'X-BLOBR-KEY': '{API_KEY}'},
concat('https://apis.dappradar.com', PATH, '?', utils.udf_object_to_url_query_string(QUERY_ARGS)),
{'X-API-KEY': '{API_KEY}'},
{},
'_FSC_SYS/DAPPRADAR'
) as response
@ -33,10 +33,10 @@
SELECT
live.udf_api(
'POST',
CONCAT('https://api.dappradar.com', PATH),
{'X-BLOBR-KEY': '{API_KEY}'},
CONCAT('https://apis.dappradar.com', PATH),
{'X-API-KEY': '{API_KEY}'},
BODY,
'_FSC_SYS/DAPPRADAR'
) as response
{% endmacro %}
{% endmacro %}

View File

@ -17,7 +17,7 @@
'GET',
concat('https://api.reservoir.tools', PATH, '?', utils.udf_object_to_url_query_string(QUERY_ARGS)),
{'x-api-key': '{API_KEY}'},
{},
NULL,
'_FSC_SYS/RESERVOIR'
) as response
@ -39,4 +39,4 @@
'_FSC_SYS/RESERVOIR'
) as response
{% endmacro %}
{% endmacro %}

View File

@ -42,4 +42,4 @@
'_FSC_SYS/STRANGELOVE'
) as response
{% endmacro %}
{% endmacro %}

View File

@ -19,4 +19,4 @@
QUERY
) as response
{% endmacro %}
{% endmacro %}

View File

@ -8,7 +8,7 @@ models:
name: test_apilayer__get_status_200
args: >
'/odds/sports'
, {}
, {'all': 'true'}
assertions:
- result:status_code = 200
- result:error IS NULL

View File

@ -8,7 +8,7 @@ models:
name: test_cmc__get_status_200
args: >
'/v2/cryptocurrency/ohlcv/historical'
, {'interval': 'hourly', 'time_period': 'hourly', 'time_start': 1691524740, 'time_end': 1691528400, 'id': '15478,15479'}
, {'interval': 'hourly', 'time_period': 'hourly', 'time_start': DATE_PART('EPOCH_SECOND', DATEADD('hour', -2, CURRENT_TIMESTAMP())), 'time_end': DATE_PART('EPOCH_SECOND', DATEADD('hour', -1, CURRENT_TIMESTAMP())), 'id': '15478,15479'}
assertions:
- result:status_code = 200
- result:error IS NULL

View File

@ -7,7 +7,7 @@ models:
- test_udf:
name: test_dappradar__get_status_200
args: >
'/4tsxo4vuhotaojtl/defi/chains'
'/v2/defi/chains'
, {}
assertions:
- result:status_code = 200

View File

@ -7,13 +7,13 @@ models:
- test_udf:
name: test_footprint_utils__get_status_200_v2_protocol_info
args: >
'/v2/protocol/info'
'/v3/protocol/getProtocolStatsHistory'
, {
'chain': 'Ethereum',
'protocol_slug': 'the-sandbox',
'limit': 10,
'offset': 0
}
'chain': 'Polygon',
'protocol_slug': 'planet-ix',
'start_time': '2023-07-01',
'end_time': '2023-07-25'
}
assertions:
- result:status_code = 200
- result:error IS NULL

View File

@ -7,8 +7,8 @@ models:
- test_udf:
name: test_solscan_public_api_get__get_status_200
args: >
'/block/last'
, {'limit': 10}
'/chaininfo'
, {}
assertions:
- result:status_code = 200
- result:error IS NULL

View File

@ -7,8 +7,23 @@ models:
- test_udf:
name: test_subquery__graphql_status_200
args: >
'kepler-network'
, {'query':'query { _mmrs (first: 5) { nodes { key } } }'}
'subquery-mainnet',
{
'query': '{
_pois(first: 5) {
nodes {
id
chainBlockHash
hash
parentHash
createdAt
operationHashRoot
nodeId
updatedAt
}
}
}'
}
assertions:
- result:status_code = 200
- result:error IS NULL

8
package-lock.yml Normal file
View File

@ -0,0 +1,8 @@
packages:
- package: calogica/dbt_expectations
version: 0.8.5
- package: dbt-labs/dbt_utils
version: 1.0.0
- package: calogica/dbt_date
version: 0.7.2
sha1_hash: beca0ae13045be0399683f2d9a36c07e1674880d

View File

@ -6,4 +6,10 @@ selectors:
value: livequery_models
- exclude:
- livequery_models.deploy.marketplace.quicknode.test_quicknode_solana*
- livequery_models.deploy.marketplace.quicknode.test_quicknode_polygon*
- livequery_models.deploy.marketplace.quicknode.test_quicknode_polygon*
- livequery_models.deploy.marketplace.bitquery.* # API Credits not enough
- livequery_models.deploy.marketplace.covalent.* # API Credits not enough
- livequery_models.deploy.marketplace.coingecko.* # API Credits not enough
- livequery_models.deploy.marketplace.allday.* # GraphQL API not working
- livequery_models.deploy.marketplace.playgrounds.* # API Endpoints not working
- livequery_models.deploy.marketplace.strangelove.* # API Endpoints not working