From e5f0301c669198f510a3a711daa6b817df535495 Mon Sep 17 00:00:00 2001 From: Francisco Miamoto Date: Sun, 12 Sep 2021 15:33:24 -0300 Subject: [PATCH] update docs on integration tests The instructions provided were not working as expected. --- docs/Integration_Tests.md | 16 +++++++++------- 1 file 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 / +go test ./pkg/gui -run / +# 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 / +SPEED=2 go test ./pkg/gui -run / ``` To update a snapshot ``` -UPDATE_SNAPSHOTS=true go test pkg/gui/gui_test.go -run / +UPDATE_SNAPSHOTS=true go test ./pkg/gui -run / ``` ## 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 / +RECORD_EVENTS=true go test ./pkg/gui -run / ``` 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.