Skip to content

Commit

Permalink
Merge pull request #1801 from evidence-dev/test-speedup-v2
Browse files Browse the repository at this point in the history
Test speedup v2
  • Loading branch information
archiewood committed Mar 28, 2024
2 parents cb7b45a + d8ce804 commit ef3aaac
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 42 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,8 @@ jobs:
SQLITE_FILENAME: ':memory:'

DUCKDB_FILENAME: ':memory:'

- name: Test the CLI via test-env for merges to main
if: ${{ github.base_ref == 'main' }}
run: |
pnpm run sources:test-env && pnpm run build:test-env
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@
"serve:docs": "pnpm --filter ./sites/docs serve",
"release": "run-s package:core-components build:tailwind build:evidence build:plugin-connector && pnpm changeset publish",
"release:next": "VERSION=$(git rev-parse --short HEAD) && pnpm -r exec npm pkg set version=0.0.0-\"$VERSION\" && pnpm install --frozen-lockfile && pnpm -r publish --tag next --no-git-checks",
"test": "run-s package:core-components build:tailwind build:evidence && pnpm i --frozen-lockfile && pnpm -r test",
"test": "pnpm -r test",
"test:ui": "pnpm -r test:ui",
"postinstall": "run-s build:plugin-connector build:preprocess build:tailwind build:query-store package:core-components build:evidence && pnpm install --ignore-scripts",
"postinstall": "run-s build:plugin-connector build:preprocess build:tailwind build:query-store package:core-components build:evidence",
"docs": "pnpm --filter ./sites/docs start",
"lint": "prettier --plugin-search-dir . --check . && eslint .",
"format": "prettier --plugin-search-dir . --write .",
Expand Down
1 change: 0 additions & 1 deletion sites/test-env/evidence.plugins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ datasources:
@evidence-dev/csv: { }
@evidence-dev/postgres: { }
@evidence-dev/sqlite: { }
@evidence-dev/connector-gsheets: { }
@evidence-dev/snowflake: { }
5 changes: 2 additions & 3 deletions sites/test-env/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
"version": "3.0.22",
"private": true,
"scripts": {
"build": "evidence build",
"build:strict": "evidence build:strict",
"build": "cross-env NODE_OPTIONS=--max-old-space-size=8192 evidence build",
"build:strict": "cross-env NODE_OPTIONS=--max-old-space-size=8192 evidence build:strict",
"dev": "evidence dev",
"test": "evidence sources && cross-env NODE_OPTIONS=--max-old-space-size=8192 evidence build",
"sources": "evidence sources",
"preview": "evidence preview"
},
Expand Down
1 change: 1 addition & 0 deletions sites/test-env/pages/categories/[category]/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ SELECT DISTINCT(order_month) FROM orders

```items
SELECT * FROM orders WHERE category = '${params.category}' AND order_month BETWEEN '${inputs.range.start}'::DATE AND '${inputs.range.end}'::DATE - INTERVAL 7 DAY
limit 1000
```

```total
Expand Down
4 changes: 3 additions & 1 deletion sites/test-env/pages/daterange.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
## Universal SQL min/max dates

```orders
select * from orders
select * from orders limit 1000
```

<DateRange data={orders} dates="order_datetime" name="order_range" />

```range_of_orders
select * from orders where order_datetime between '${inputs.order_range.start}' and '${inputs.order_range.end}'
limit 1000
```

<DataTable data={range_of_orders} />
Expand All @@ -24,6 +25,7 @@ select * from orders where order_datetime between '${inputs.order_range.start}'

```range_of_orders_2
select * from orders where order_datetime between '${inputs.order_range_2.start}' and '${inputs.order_range_2.end}'
limit 1000
```

<DataTable data={range_of_orders_2} />
4 changes: 2 additions & 2 deletions sites/test-env/pages/dropdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ select * from orders limit 100
```

```orders
select * from orders
select * from orders limit 1000
```


Expand Down Expand Up @@ -75,7 +75,7 @@ Orders of {inputs.multiple_selected_order_ids.label}
<DateRange name="range" dates="order_datetime" data="orders" />

```selected_items
SELECT * FROM orders WHERE item in ${inputs.item.value} AND order_datetime BETWEEN '${inputs.range.start}' AND '${inputs.range.end}'
SELECT * FROM orders WHERE item in ${inputs.item.value} AND order_datetime BETWEEN '${inputs.range.start}' AND '${inputs.range.end}' limit 100
```

<DataTable data={selected_items} />
13 changes: 0 additions & 13 deletions sites/test-env/pages/orders/[order_month]/[item]/index.md

This file was deleted.

11 changes: 0 additions & 11 deletions sites/test-env/pages/orders/[order_month]/index.md

This file was deleted.

10 changes: 1 addition & 9 deletions sites/test-env/pages/orders/index.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
```months
SELECT strftime(order_month, '%Y-%m-%d') as order_month, count(*) as order_count FROM orders
GROUP BY ALL
```

<ul>
{#each months as { order_month, order_count }}
<li>
<a href="/orders/{order_month}">{order_month} {order_count}</a>
</li>
{/each}
</ul>
```

0 comments on commit ef3aaac

Please sign in to comment.