Before running the unit tests, ensure the following steps are completed:
- Start Docker on Your Machine:
Ensure that Docker is running. You can verify this by executing
docker infoin your terminal. If Docker is not running, start it using your system's preferred method (e.g., using the Docker desktop application or by runningsystemctl start dockeron Linux).
To facilitate efficient testing, you can choose from several commands based on your testing needs:
- Running all unit tests:
./mill -i -w "__.test"
- 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:
./mill -i -w "__.test scalasql.sqlite"
- Re-generating docs:
./mill -ij1 "__.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.
- Fix all auto-generating and auto-formatting issues at once via
./mill -i -w __.fix + mill.scalalib.scalafmt.ScalafmtModule/reformatAll __.sources + "__.test" + generateTutorial + generateReference
- You can run ad-hoc benchmarks using any test case via the
SCALASQL_RUN_BENCHMARKenvironment variable, e.g.SCALASQL_RUN_BENCHMARK=5000 ./mill -i -w __.test scalasql.sqlite.SubQueryTests.deeplyNested
-
ScalaSql comprises 4 main submodules:
scalasql.core: the core functionality of evaluatingSqlStrqueries, but without any typed helpers to construct themscalasql.operations: extension methods onExpr[T]values representing operations on typed SQL expressions, likeLOWER(str)ora || b/CONCAT(a, b)scalasql.query: builders for entire SQL queries,INSERT,SELECT,UPDATE,DELETE.scalasql: the main user-facing ScalaSql module, contains thepackage objectdefining what a user sees when they doimport scalasql._, as well as the various database*Dialects that provide the relevant set ofquerys andoperationsfor each respective database
-
ScalaSql's tests are concentrated within a single
scalasql.testmodule, with subfolders corresponding to the various ScalaSql sub-modules they are intended to cover
scalasql.core
| |
+-----+ +-----+
| |
scalasql.operations scalasql.query
| |
+------+ +------+
| |
scalasql
|
+------+
|
scalasql.test