mirror of
https://github.com/ddworken/hishtory.git
synced 2025-06-24 22:11:40 +02:00
optimize test execution time by only building the client once + add Makefile target for action tests
This commit is contained in:
parent
682a063e95
commit
5b59141c3a
4
Makefile
4
Makefile
@ -1,9 +1,13 @@
|
||||
forcetest:
|
||||
go clean -testcache
|
||||
HISHTORY_TEST=1 go test -p 1 ./...
|
||||
|
||||
test:
|
||||
HISHTORY_TEST=1 go test -p 1 ./...
|
||||
|
||||
acttest:
|
||||
act push -j test
|
||||
|
||||
release:
|
||||
expr `cat VERSION` + 1 > VERSION
|
||||
git add VERSION
|
||||
|
@ -23,6 +23,11 @@ import (
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
defer shared.RunTestServer()()
|
||||
cmd := exec.Command("go", "build", "-o", "/tmp/client")
|
||||
err := cmd.Run()
|
||||
if err != nil {
|
||||
panic(fmt.Sprintf("failed to build client: %v", err))
|
||||
}
|
||||
m.Run()
|
||||
}
|
||||
|
||||
@ -163,8 +168,7 @@ func TestIntegrationWithNewDevice(t *testing.T) {
|
||||
}
|
||||
|
||||
func installHishtory(t *testing.T, userSecret string) string {
|
||||
out := RunInteractiveBashCommands(t, `go build -o /tmp/client
|
||||
/tmp/client install `+userSecret)
|
||||
out := RunInteractiveBashCommands(t, `/tmp/client install `+userSecret)
|
||||
r := regexp.MustCompile(`Setting secret hishtory key to (.*)`)
|
||||
matches := r.FindStringSubmatch(out)
|
||||
if len(matches) != 2 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user