Skip to content

Commit

Permalink
docs: improve a bit the onboarding
Browse files Browse the repository at this point in the history
  • Loading branch information
PrettyWood committed Dec 13, 2023
1 parent 5f9cac3 commit c138881
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ slow-timeout = { period = "2s", terminate-after = 4 }

[test-groups.test-dbs]
# test-dbs runs database setup when the connection is established,
# and becuase nextest runs test in separate processes, this happens on every test.
# To prevent mutliple setups running at once, we set max-threads to 1.
# and because nextest runs test in separate processes, this happens on every test.
# To prevent multiple setups running at once, we set max-threads to 1.
# Ideally, we could run tests in parallel and they would use a locking mechanism to see if
# the database has already been setup. For now, we can use cargo test instead.
max-threads = 1
Expand Down
4 changes: 2 additions & 2 deletions prqlc/prql-compiler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ strum_macros = "0.25.3"
serde_yaml = {version = "0.9", optional = true}

[target.'cfg(not(target_family="wasm"))'.dependencies]
# For integration tests. These are gated by the `test-dbs` feature, rather than
# dev-dependencies, because dev-dependencies can't be optional.
# For integration tests. These are gated by the `test-dbs` and `test-dbs-external` features,
# rather than dev-dependencies, because dev-dependencies can't be optional.
chrono = {version = "0.4", optional = true, features = [], default-features = false}
duckdb = {version = "0.9.2", optional = true, features = ["bundled", "chrono"]}
glob = {version = "0.3.1", optional = true}
Expand Down
12 changes: 9 additions & 3 deletions prqlc/prql-compiler/tests/integration/dbs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ cargo test --features=test-dbs

## External DBs

To run tests against external databases — currently Postgres, MySQL, SQL Server
and ClickHouse are tested — we use `docker compose`:
To run tests against external databases — currently Postgres, MySQL, SQL Server,
ClickHouse and GlareDB are tested — we use `docker compose`:

1. Run `docker compose up` (may take a while on the first time):

Expand All @@ -26,15 +26,21 @@ and ClickHouse are tested — we use `docker compose`:
2. Run the tests:

```sh
cargo test --features=test-dbs-external
cargo test --features=test-dbs-external --no-capture
```

The `--no-capture` option is definitely not required but is practical to see
all the dialects tested per query.

3. After you're done, stop the containers and remove local images and volumes:
```sh
docker compose down -v --rmi local
```
Note: if you're on an M1 and your MSSQL docker container doesn't run, refer to
[this comment](https://github.com/microsoft/mssql-docker/issues/668#issuecomment-1436802153)
## Data
Columns are renamed to `snake_case`, so Postgres and DuckDb don't struggle with
Expand Down
1 change: 1 addition & 0 deletions prqlc/prql-compiler/tests/integration/queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ mod results {

let dialect = con.cfg.dialect;

println!("Executing {test_name} for {dialect}");
let rows = con
.run_query(&prql)
.context(format!("Executing {test_name} for {dialect}"))
Expand Down

0 comments on commit c138881

Please sign in to comment.