Skip to content

Commit

Permalink
Enhanced Developer Documentation. Docker Setup and Readability Impro…
Browse files Browse the repository at this point in the history
…vements (#10)

👀 
I noticed that the developer documentation section lacked explicit
instructions on setting up **Docker**, a crucial step for running unit
tests and ensuring a seamless development environment. Recognizing the
importance of this step for new and existing developers, I have added
Docker setup instructions to the "Precondition" section of the README.

🆙 💅🏻 
In addition to integrating Docker setup instructions, I took the
opportunity to improve the overall readability of the README file. These
improvements include better formatting, clearer descriptions of commands
and modules, and a more organized presentation of content. This should
make the documentation more **accessible and easier** to follow,
especially for developers who are new to the project.

Co-authored-by: haskiindahouse <>
  • Loading branch information
haskiindahouse authored Apr 25, 2024
1 parent faefc41 commit 7318f00
Showing 1 changed file with 35 additions and 12 deletions.
47 changes: 35 additions & 12 deletions docs/developer.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,51 @@

# Developer Docs

* Running all unit tests: `./mill -i -w "__.test"`.
## Precondition
Before running the unit tests, ensure the following steps are completed:

* Running all unit tests on one database: `./mill -i -w "__.test scalasql.sqlite"`. This
1. **Start Docker on Your Machine:**
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).

## Running Unit Tests
To facilitate efficient testing, you can choose from several commands based on your testing needs:

### Run all Tests
* Running all unit tests:
```bash
./mill -i -w "__.test"
```

### Quick Database-Specific Tests
* Running all unit tests on one database. This
is much faster than running all tests, and useful for quick iteration for changes that
are not database specific.
are not database specific:
```bash
./mill -i -w "__.test scalasql.sqlite"
```

* Re-generating docs: `./mill -i "__.test" + generateTutorial + generateReference`
### Full Test Suite with Documentation Generation
* Re-generating docs:
```bash
./mill -i "__.test" + generateTutorial + generateReference
```
* Note that ScalaSql's reference docs are extracted from the test suite, and thus we need
to make sure to run the test suite before re-generating them.
### Code Formatting and Auto-Fixes
* Fix all auto-generating and auto-formatting issues at once via
```
./mill -i -w __.fix + mill.scalalib.scalafmt.ScalafmtModule/reformatAll __.sources + "scalasql[2.13.12].test" + generateTutorial + generateReference
```
```bash
./mill -i -w __.fix + mill.scalalib.scalafmt.ScalafmtModule/reformatAll __.sources + "scalasql[2.13.12].test" + generateTutorial + generateReference
```
## Benchmarking
* You can run ad-hoc benchmarks using any test case via the `SCALASQL_RUN_BENCHMARK`
environment variable, e.g.

```
SCALASQL_RUN_BENCHMARK=5000 ./mill -i -w __.test scalasql.sqlite.SubQueryTests.deeplyNested
```
environment variable, e.g.
```bash
SCALASQL_RUN_BENCHMARK=5000 ./mill -i -w __.test scalasql.sqlite.SubQueryTests.deeplyNested
```
## ScalaSql Modules Overview
* ScalaSql comprises 4 main submodules:
* `scalasql.core`: the core functionality of evaluating `SqlStr` queries, but without any typed
helpers to construct them
Expand Down

0 comments on commit 7318f00

Please sign in to comment.