refactor: migrate e2e tests from efficientgo/e2e to capytest

This commit is contained in:
2025-07-05 20:50:20 +03:00
parent 5e24940ef8
commit 67a6cb31de
23 changed files with 130 additions and 318 deletions

View File

@ -20,25 +20,16 @@ package e2etests_test
import (
"testing"
"time"
"github.com/efficientgo/e2e"
expect "github.com/tailscale/goexpect"
"go.alt-gnome.ru/capytest"
)
func TestE2EAlrVersion(t *testing.T) {
dockerMultipleRun(
t,
"check-version",
COMMON_SYSTEMS,
func(t *testing.T, r e2e.Runnable) {
runTestCommands(t, r, time.Second*10, []expect.Batcher{
&expect.BSnd{S: "alr version\n"},
&expect.BExp{R: `^v\d+\.\d+\.\d+(?:-\d+-g[a-f0-9]+)?\n$`},
&expect.BSnd{S: "echo $?\n"},
&expect.BExp{R: `^0\n$`},
})
},
)
runMatrixSuite(t, "version", COMMON_SYSTEMS, func(t *testing.T, r capytest.Runner) {
r.Command("alr", "version").
ExpectStderrRegex(`^v\d+\.\d+\.\d+(?:-\d+-g[a-f0-9]+)?\n$`).
ExpectStdoutEmpty().
ExpectSuccess().
Run(t)
})
}