Skip to content

Commit

Permalink
run sqlmesh tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ravenac95 committed Nov 3, 2024
1 parent 0dad444 commit 84f7dec
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/ci-default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
component: ["node", "python", "dbt"]
component: ["node", "python", "dbt", "sqlmesh"]
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down Expand Up @@ -176,5 +176,10 @@ jobs:
run: |
poetry run pytest
if: ${{ always() && matrix.component == 'python' }}

- name: Test SQLMesh
run: |
cd warehouse/metrics_mesh && sqlmesh test
if: ${{ always() && matrix.component == 'sqlmesh' }}


84 changes: 84 additions & 0 deletions warehouse/metrics_mesh/tests/test_events_daily_to_artifact.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@

test_events_daily_to_artifact:
model: metrics.events_daily_to_artifact
vars:
start: 2024-01-01
end: 2024-02-01
inputs:
sources.timeseries_events_by_artifact_v0:
rows:
- to_artifact_id: contract_0
from_artifact_id: user_0
event_source: BLOCKCHAIN
event_type: CONTRACT_INVOCATION_SUCCESS_DAILY_COUNT
time: 2024-01-01T00:00:00Z
amount: 10
- to_artifact_id: contract_1
from_artifact_id: user_0
event_source: BLOCKCHAIN
event_type: CONTRACT_INVOCATION_SUCCESS_DAILY_COUNT
time: 2024-01-01T00:00:00Z
amount: 10
- to_artifact_id: repo_0
from_artifact_id: dev_0
event_source: SOURCE_PROVIDER
event_type: COMMIT_CODE
time: 2024-01-01T02:00:00Z
amount: 1
- to_artifact_id: repo_0
from_artifact_id: dev_0
event_source: SOURCE_PROVIDER
event_type: COMMIT_CODE
time: 2024-01-01T03:00:00Z
amount: 1
- to_artifact_id: repo_0
from_artifact_id: dev_0
event_source: SOURCE_PROVIDER
event_type: COMMIT_CODE
time: 2024-01-01T04:00:00Z
amount: 1
- to_artifact_id: repo_0
from_artifact_id: dev_1
event_source: SOURCE_PROVIDER
event_type: COMMIT_CODE
time: 2024-01-01T04:00:00Z
amount: 1
- to_artifact_id: repo_0
from_artifact_id: dev_1
event_source: SOURCE_PROVIDER
event_type: COMMIT_CODE
time: 2024-01-02T04:00:00Z
amount: 1
outputs:
query:
rows:
- to_artifact_id: contract_0
from_artifact_id: user_0
event_source: BLOCKCHAIN
event_type: CONTRACT_INVOCATION_SUCCESS_DAILY_COUNT
bucket_day: 2024-01-01
amount: 10
- to_artifact_id: contract_1
from_artifact_id: user_0
event_source: BLOCKCHAIN
event_type: CONTRACT_INVOCATION_SUCCESS_DAILY_COUNT
bucket_day: 2024-01-01
amount: 10
- to_artifact_id: repo_0
from_artifact_id: dev_0
event_source: SOURCE_PROVIDER
event_type: COMMIT_CODE
bucket_day: 2024-01-01
amount: 3
- to_artifact_id: repo_0
from_artifact_id: dev_1
event_source: SOURCE_PROVIDER
event_type: COMMIT_CODE
bucket_day: 2024-01-01
amount: 1
- to_artifact_id: repo_0
from_artifact_id: dev_1
event_source: SOURCE_PROVIDER
event_type: COMMIT_CODE
bucket_day: 2024-01-02
amount: 1

0 comments on commit 84f7dec

Please sign in to comment.