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:
|
forcetest:
|
||||||
go clean -testcache
|
go clean -testcache
|
||||||
HISHTORY_TEST=1 go test -p 1 ./...
|
HISHTORY_TEST=1 go test -p 1 ./...
|
||||||
|
|
||||||
test:
|
test:
|
||||||
HISHTORY_TEST=1 go test -p 1 ./...
|
HISHTORY_TEST=1 go test -p 1 ./...
|
||||||
|
|
||||||
|
acttest:
|
||||||
|
act push -j test
|
||||||
|
|
||||||
release:
|
release:
|
||||||
expr `cat VERSION` + 1 > VERSION
|
expr `cat VERSION` + 1 > VERSION
|
||||||
git add VERSION
|
git add VERSION
|
||||||
|
@ -23,6 +23,11 @@ import (
|
|||||||
|
|
||||||
func TestMain(m *testing.M) {
|
func TestMain(m *testing.M) {
|
||||||
defer shared.RunTestServer()()
|
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()
|
m.Run()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -163,8 +168,7 @@ func TestIntegrationWithNewDevice(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func installHishtory(t *testing.T, userSecret string) string {
|
func installHishtory(t *testing.T, userSecret string) string {
|
||||||
out := RunInteractiveBashCommands(t, `go build -o /tmp/client
|
out := RunInteractiveBashCommands(t, `/tmp/client install `+userSecret)
|
||||||
/tmp/client install `+userSecret)
|
|
||||||
r := regexp.MustCompile(`Setting secret hishtory key to (.*)`)
|
r := regexp.MustCompile(`Setting secret hishtory key to (.*)`)
|
||||||
matches := r.FindStringSubmatch(out)
|
matches := r.FindStringSubmatch(out)
|
||||||
if len(matches) != 2 {
|
if len(matches) != 2 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user