|
1 | 1 |
|
2 | 2 | # Developer Docs
|
3 | 3 |
|
4 |
| -* Running all unit tests: `./mill -i -w "__.test"`. |
| 4 | +## Precondition |
| 5 | +Before running the unit tests, ensure the following steps are completed: |
5 | 6 |
|
6 |
| -* Running all unit tests on one database: `./mill -i -w "__.test scalasql.sqlite"`. This |
| 7 | +1. **Start Docker on Your Machine:** |
| 8 | + Ensure that Docker is running. You can verify this by executing `docker info` in your terminal. If Docker is not running, start it using your system's preferred method (e.g., using the Docker desktop application or by running `systemctl start docker` on Linux). |
| 9 | + |
| 10 | +## Running Unit Tests |
| 11 | +To facilitate efficient testing, you can choose from several commands based on your testing needs: |
| 12 | + |
| 13 | +### Run all Tests |
| 14 | +* Running all unit tests: |
| 15 | + ```bash |
| 16 | + ./mill -i -w "__.test" |
| 17 | + ``` |
| 18 | + |
| 19 | +### Quick Database-Specific Tests |
| 20 | +* Running all unit tests on one database. This |
7 | 21 | is much faster than running all tests, and useful for quick iteration for changes that
|
8 |
| - are not database specific. |
| 22 | + are not database specific: |
| 23 | + ```bash |
| 24 | + ./mill -i -w "__.test scalasql.sqlite" |
| 25 | + ``` |
9 | 26 |
|
10 |
| -* Re-generating docs: `./mill -i "__.test" + generateTutorial + generateReference` |
| 27 | +### Full Test Suite with Documentation Generation |
| 28 | +* Re-generating docs: |
| 29 | + ```bash |
| 30 | + ./mill -i "__.test" + generateTutorial + generateReference |
| 31 | + ``` |
11 | 32 | * Note that ScalaSql's reference docs are extracted from the test suite, and thus we need
|
12 | 33 | to make sure to run the test suite before re-generating them.
|
13 | 34 |
|
| 35 | +### Code Formatting and Auto-Fixes |
14 | 36 | * Fix all auto-generating and auto-formatting issues at once via
|
15 |
| -``` |
16 |
| -./mill -i -w __.fix + mill.scalalib.scalafmt.ScalafmtModule/reformatAll __.sources + "scalasql[2.13.12].test" + generateTutorial + generateReference |
17 |
| -``` |
| 37 | + ```bash |
| 38 | + ./mill -i -w __.fix + mill.scalalib.scalafmt.ScalafmtModule/reformatAll __.sources + "scalasql[2.13.12].test" + generateTutorial + generateReference |
| 39 | + ``` |
18 | 40 |
|
| 41 | +## Benchmarking |
19 | 42 | * You can run ad-hoc benchmarks using any test case via the `SCALASQL_RUN_BENCHMARK`
|
20 |
| - environment variable, e.g. |
21 |
| - |
22 |
| -``` |
23 |
| -SCALASQL_RUN_BENCHMARK=5000 ./mill -i -w __.test scalasql.sqlite.SubQueryTests.deeplyNested |
24 |
| -``` |
| 43 | +environment variable, e.g. |
| 44 | + ```bash |
| 45 | + SCALASQL_RUN_BENCHMARK=5000 ./mill -i -w __.test scalasql.sqlite.SubQueryTests.deeplyNested |
| 46 | + ``` |
25 | 47 |
|
| 48 | +## ScalaSql Modules Overview |
26 | 49 | * ScalaSql comprises 4 main submodules:
|
27 | 50 | * `scalasql.core`: the core functionality of evaluating `SqlStr` queries, but without any typed
|
28 | 51 | helpers to construct them
|
|
0 commit comments