forked from jesseduffield/lazygit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feat/detect-bare-repo
- Loading branch information
Showing
336 changed files
with
7,998 additions
and
1,271 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
- **PR Description** | ||
|
||
- **Please check if the PR fulfills these requirements** | ||
|
||
* [ ] Cheatsheets are up-to-date (run `go run scripts/cheatsheet/main.go generate`) | ||
* [ ] Code has been formatted (run `go install mvdan.cc/gofumpt@latest && gofumpt -l -w .`) | ||
* [ ] Tests have been added/updated (see [here](https://github.com/jesseduffield/lazygit/blob/master/pkg/integration/README.md) for the integration test guide) | ||
* [ ] Docs (specifically `docs/Config.md`) have been updated if necessary |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,14 +46,14 @@ jobs: | |
# we're passing -short so that we skip the integration tests, which will be run in parallel below | ||
run: | | ||
go test ./... -short | ||
integration-tests: | ||
integration-tests-old: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
parallelism: [5] | ||
index: [0,1,2,3,4] | ||
name: "Integration Tests (${{ matrix.index }}/${{ matrix.parallelism }})" | ||
name: "Integration Tests (Old pattern) (${{ matrix.index }}/${{ matrix.parallelism }})" | ||
env: | ||
GOFLAGS: -mod=vendor | ||
steps: | ||
|
@@ -74,7 +74,31 @@ jobs: | |
${{runner.os}}-go- | ||
- name: Test code | ||
run: | | ||
PARALLEL_TOTAL=${{ matrix.parallelism }} PARALLEL_INDEX=${{ matrix.index }} go test pkg/gui/gui_test.go | ||
PARALLEL_TOTAL=${{ matrix.parallelism }} PARALLEL_INDEX=${{ matrix.index }} go test pkg/integration/deprecated/*.go | ||
integration-tests: | ||
runs-on: ubuntu-latest | ||
name: "Integration Tests" | ||
env: | ||
GOFLAGS: -mod=vendor | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Setup Go | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.18.x | ||
- name: Cache build | ||
uses: actions/cache@v1 | ||
with: | ||
path: | | ||
~/.cache/go-build | ||
~/go/pkg/mod | ||
key: ${{runner.os}}-go-${{hashFiles('**/go.sum')}}-test | ||
restore-keys: | | ||
${{runner.os}}-go- | ||
- name: Test code | ||
run: | | ||
go test pkg/integration/clients/*.go | ||
build: | ||
runs-on: ubuntu-latest | ||
env: | ||
|
@@ -105,7 +129,13 @@ jobs: | |
- name: Build darwin binary | ||
run: | | ||
GOOS=darwin go build | ||
check-cheatsheet: | ||
- name: Build integration test binary | ||
run: | | ||
GOOS=linux go build cmd/integration_test/main.go | ||
- name: Build integration test injector | ||
run: | | ||
GOOS=linux go build pkg/integration/clients/injector/main.go | ||
check-codebase: | ||
runs-on: ubuntu-latest | ||
env: | ||
GOFLAGS: -mod=vendor | ||
|
@@ -129,6 +159,10 @@ jobs: | |
- name: Check Cheatsheet | ||
run: | | ||
go run scripts/cheatsheet/main.go check | ||
- name: Check Vendor Directory | ||
# ensure our vendor directory matches up with our go modules | ||
run: | | ||
go mod vendor && git diff --exit-code || (echo "Unexpected change to vendor directory. Run 'go mod vendor' locally and commit the changes" && exit 1) | ||
lint: | ||
runs-on: ubuntu-latest | ||
env: | ||
|
@@ -153,12 +187,6 @@ jobs: | |
uses: golangci/[email protected] | ||
with: | ||
version: latest | ||
- name: Format code | ||
run: | | ||
if [ $(find . ! -path "./vendor/*" -name "*.go" -exec gofmt -s -d {} \;|wc -l) -gt 0 ]; then | ||
find . ! -path "./vendor/*" -name "*.go" -exec gofmt -s -d {} \; | ||
exit 1 | ||
fi | ||
- name: errors | ||
run: golangci-lint run | ||
if: ${{ failure() }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"log" | ||
"os" | ||
|
||
"github.com/jesseduffield/lazygit/pkg/integration/clients" | ||
) | ||
|
||
var usage = ` | ||
Usage: | ||
See https://github.com/jesseduffield/lazygit/tree/master/pkg/integration/README.md | ||
CLI mode: | ||
> go run cmd/integration_test/main.go cli [--slow] <test1> <test2> ... | ||
If you pass no test names, it runs all tests | ||
Accepted environment variables: | ||
KEY_PRESS_DELAY (e.g. 200): the number of milliseconds to wait between keypresses | ||
MODE: | ||
* ask (default): if a snapshot test fails, asks if you want to update the snapshot | ||
* check: if a snapshot test fails, exits with an error | ||
* update: if a snapshot test fails, updates the snapshot | ||
* sandbox: uses the test's setup step to run the test in a sandbox where you can do whatever you want | ||
TUI mode: | ||
> go run cmd/integration_test/main.go tui | ||
This will open up a terminal UI where you can run tests | ||
Help: | ||
> go run cmd/integration_test/main.go help | ||
` | ||
|
||
func main() { | ||
if len(os.Args) < 2 { | ||
log.Fatal(usage) | ||
} | ||
|
||
switch os.Args[1] { | ||
case "help": | ||
fmt.Println(usage) | ||
case "cli": | ||
testNames := os.Args[2:] | ||
slow := false | ||
// get the next arg if it's --slow | ||
if len(os.Args) > 2 && (os.Args[2] == "--slow" || os.Args[2] == "-slow") { | ||
testNames = os.Args[3:] | ||
slow = true | ||
} | ||
clients.RunCLI(testNames, slow) | ||
case "tui": | ||
clients.RunTUI() | ||
default: | ||
log.Fatal(usage) | ||
} | ||
} |
Oops, something went wrong.