|
| 1 | +# Robot Framework |
| 2 | + |
| 3 | +## Faster Iterations |
| 4 | + |
| 5 | +As we already know, `./mvnw verify` runs all the integration tests. But let's |
| 6 | +suppose that we are working on a single test and we need to run it many times |
| 7 | +until it will work as desired. In this case, we would like to iterate faster |
| 8 | +and at least don't run all the tests, but the only one that we are working on. |
| 9 | + |
| 10 | +In this case we can (temporary) mark the test with a unique tag, let’s say |
| 11 | +`testme`, and ask `robotframework-maven-plugin` to execute only tests with such |
| 12 | +a tag: |
| 13 | +```console |
| 14 | +./mvnw verify -Dincludes=testme |
| 15 | +``` |
| 16 | + |
| 17 | +Now we run much less tests but could we make the execution even faster? Sure, |
| 18 | +we can! Let's look on what exactly `./mvnw verify` does: |
| 19 | +1) it runs the application (this in turn includes many steps, like code |
| 20 | + compilation, preparation of the resources, running unit tests and so on) |
| 21 | +2) it runs [Wiremock server](wiremock.md) that is required by some tests |
| 22 | +3) it executes the integration tests |
| 23 | + |
| 24 | +As we modify only one (or more) of the integration tests, we don't need to |
| 25 | +re-run the whole application every time. Also, if our test doesn't use |
| 26 | +Wiremock, we might also skip this part entirely. To do so, we should manually |
| 27 | +execute all the steps that we need: |
| 28 | + |
| 29 | +1) run the application: |
| 30 | + ```console |
| 31 | + ./mvnw spring-boot:run` |
| 32 | + ``` |
| 33 | +2) in another terminal, run Wiremock server, only if your test need it: |
| 34 | + ```console |
| 35 | + ./mvnw wiremock:run -DkeepRunning=true` |
| 36 | + ``` |
| 37 | +3) in another terminal, run integration tests as many times as you need: |
| 38 | + ```console |
| 39 | + ./mwnw robotframework:run -Dincludes=testme` |
| 40 | + ``` |
| 41 | + |
0 commit comments