summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorFrancisco Miamoto <francisco@dorayaki.co>2021-09-12 15:33:24 -0300
committerJesse Duffield <jessedduffield@gmail.com>2021-12-26 17:08:31 +1100
commite5f0301c669198f510a3a711daa6b817df535495 (patch)
tree612ab391e20a69b16116878011ecbbebaabc0c55 /docs
parenteff6c4283b3ec88bfeacf205b8b2bc3447e62e39 (diff)
update docs on integration tests
The instructions provided were not working as expected.
Diffstat (limited to 'docs')
-rw-r--r--docs/Integration_Tests.md16
1 files changed, 9 insertions, 7 deletions
diff --git a/docs/Integration_Tests.md b/docs/Integration_Tests.md
index 9e550ece8..814e593ca 100644
--- a/docs/Integration_Tests.md
+++ b/docs/Integration_Tests.md
@@ -33,29 +33,31 @@ git commit -am "myfile1"
## Running tests
-To run all tests
+To run all tests - assuming you're at the project root:
```
-go test pkg/gui/gui_test.go
+go test ./pkg/gui/
```
To run them in parallel
```
-PARALLEL=true go test pkg/gui/gui_test.go
+PARALLEL=true go test ./pkg/gui
```
To run a single test
```
-go test pkg/gui/gui_test.go -run /<test name>
+go test ./pkg/gui -run /<test name>
+# For example, to run the `tags` test:
+go test ./pkg/gui -run /tags
```
To run a test at a certain speed
```
-SPEED=2 go test pkg/gui/gui_test.go -run /<test name>
+SPEED=2 go test ./pkg/gui -run /<test name>
```
To update a snapshot
```
-UPDATE_SNAPSHOTS=true go test pkg/gui/gui_test.go -run /<test name>
+UPDATE_SNAPSHOTS=true go test ./pkg/gui -run /<test name>
```
## Creating a new test
@@ -66,7 +68,7 @@ To create a new test:
3) If you want to have a config folder for just that test, create a `config` directory to contain a `config.yml` and optionally a `state.yml` file. Otherwise, the `test/default_test_config` directory will be used.
4) From the lazygit root directory, run:
```
-RECORD_EVENTS=true go test pkg/gui/gui_test.go -run /<test name>
+RECORD_EVENTS=true go test ./pkg/gui -run /<test name>
```
5) Feel free to re-attempt recording as many times as you like. In the absence of a proper testing framework, the more deliberate your keypresses, the better!
6) Once satisfied with the recording, stage all the newly created files: `test.json`, `setup.sh`, `recording.json` and the `expected` directory that contains a copy of the repo you created.