|
1 | 1 | # scala-tutorials
|
2 | 2 |
|
| 3 | +In this repository, we have classified the tests in 4 categories. |
| 4 | + |
| 5 | +| Category | Description | |
| 6 | +| -- |---------------------------------------------------------------------------------------------------------------------------------------------------------------| |
| 7 | +| Unit Tests | Smallest unit of testing, that are not dependent on external tools or services | |
| 8 | +| Integration Tests | IntegrationTests means those tests that use some automatic setup within our environment like in-memory Mongo, h2 database etc which don't need explicit setup | |
| 9 | +| Live Tests | Tests that depends on some external services (like httpbin.org, or some internet-based links) | |
| 10 | +| Manual Tests | The tests where we need to set up an environment explicitly(for e.g. docker), without which the tests can't be run | |
| 11 | + |
| 12 | + |
| 13 | +Here is a table describing about the different categories of tests and how they can be executed in this project. |
| 14 | + |
| 15 | +| Category | Sbt command | Test class location | Test class name format | |
| 16 | +|-------------------------|-------------------|----------------------------------------|-------------------------------------------------------------------------------------------------------------------------| |
| 17 | +| Unit Tests | `sbt ci` | `src/test/scala` or `src/test/scala-2` | No particular format restriction, but as a standard, filename ends with `Test` | |
| 18 | +| Integration Test (Only) | `sbt integrationTests` | `src/it/scala` or `src/it/scala-2` | No format restriction, but as a standard, filename ends with `IntegrationTest` | |
| 19 | +| Unit & Integration Test | `sbt ciFull` | `src/it/scala` or `src/it/scala-2` | No format restriction, but as a standard, filename ends with `IntegrationTest`. These exclude manual and live tests | |
| 20 | +| Live Test | `sbt liveTests` | `src/it/scala` or `src/it/scala-2` | Test class name must end with `LiveTest` | |
| 21 | +| Manual Test | `sbt manualTests` | `src/it/scala` or `src/it/scala-2` | Test class name must end with `ManualTest` | |
| 22 | + |
3 | 23 | # Code fomatting
|
4 | 24 |
|
5 | 25 | Before creating a PR, make sure the code is correctly formatted running `sbt scalafmt`.
|
0 commit comments