mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-08-24 10:13:41 -05:00
Go's default 10-minute timeout was enough for running integration tests normally (both locally and on CI), but with race detection turned on they can take much longer to run. Increase the timeout unconditionally to 30 minutes; we don't bother making a distinction between race vs. normal, because a longer timeout doesn't hurt (I can't recall having hit the global timeout ever; and we still have the per-test watchdog that kills an individual test after 40s).
79 lines
1.9 KiB
Makefile
79 lines
1.9 KiB
Makefile
default:
|
|
just --list
|
|
|
|
# Build lazygit with optimizations disabled (to make debugging easier).
|
|
build:
|
|
go build -gcflags='all=-N -l'
|
|
|
|
install:
|
|
go install
|
|
|
|
run: build
|
|
./lazygit
|
|
|
|
# Run `just debug` in one terminal tab and `just print-log` in another to view the program and its log output side by side
|
|
debug: build
|
|
./lazygit -debug
|
|
|
|
print-log: build
|
|
./lazygit --logs
|
|
|
|
unit-test:
|
|
go test ./... -short
|
|
|
|
# Run both unit tests and integration tests.
|
|
[unix]
|
|
test: unit-test e2e
|
|
|
|
# On Windows, integration tests are not supported right now
|
|
[windows]
|
|
test: unit-test
|
|
|
|
# Generate all our auto-generated files (test list, cheatsheets, json schema, maybe other things in the future)
|
|
generate:
|
|
go generate ./...
|
|
|
|
format:
|
|
go tool gofumpt -l -w .
|
|
|
|
lint:
|
|
./scripts/gofumpt-check.sh
|
|
./scripts/golangci-lint-shim.sh run
|
|
|
|
e2e-test-command := "go test -timeout 30m pkg/integration/clients/*.go"
|
|
|
|
# Run integration tests headlessly: no args runs all tests, a test name (or path) runs just that one. Use e2e-cli for a visible UI.
|
|
e2e *args:
|
|
{{ if args == "" { e2e-test-command } else { \
|
|
e2e-test-command + " -run 'TestIntegration/" + \
|
|
replace( \
|
|
replace_regex( \
|
|
replace_regex(args, '\S*pkg/integration/tests/', ''), \
|
|
'\.go( |$)', '${1}' \
|
|
), \
|
|
" ", "$' && " + e2e-test-command + " -run 'TestIntegration/" \
|
|
) + "$'" \
|
|
} }}
|
|
|
|
# Run a single integration test with a visible UI; most useful with --sandbox or --slow.
|
|
e2e-cli *args:
|
|
go run cmd/integration_test/main.go cli {{ args }}
|
|
|
|
# Open the TUI for running integration tests.
|
|
e2e-tui *args:
|
|
go run cmd/integration_test/main.go tui {{ args }}
|
|
|
|
# Run some tests on the current commit, similar to what CI does.
|
|
check:
|
|
./scripts/check_commit.sh
|
|
|
|
bump-gocui:
|
|
scripts/bump_gocui.sh
|
|
|
|
# Record a demo
|
|
demo *args:
|
|
demo/record_demo.sh {{ args }}
|
|
|
|
vendor:
|
|
go mod tidy && go mod vendor
|