fix: removerepo and LC_ALL=C for info command
This commit is contained in:
@ -19,33 +19,52 @@
|
||||
package e2etests_test
|
||||
|
||||
import (
|
||||
"regexp"
|
||||
"bytes"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/efficientgo/e2e"
|
||||
expect "github.com/tailscale/goexpect"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestE2EAlrAddRepo(t *testing.T) {
|
||||
dockerMultipleRun(
|
||||
t,
|
||||
"add-repo",
|
||||
"add-repo-remove-repo",
|
||||
COMMON_SYSTEMS,
|
||||
func(t *testing.T, r e2e.Runnable) {
|
||||
runTestCommands(t, r, time.Second*10, []expect.Batcher{
|
||||
&expect.BSnd{S: "alr addrepo --name alr-repo --url https://gitea.plemya-x.ru/Plemya-x/alr-repo.git ; echo ALR-ADD-REPO-RETURN-CODE $?\n"},
|
||||
&expect.BCas{C: []expect.Caser{
|
||||
&expect.Case{
|
||||
R: regexp.MustCompile(`ALR-ADD-REPO-RETURN-CODE 0\n$`),
|
||||
T: expect.OK(),
|
||||
},
|
||||
&expect.Case{
|
||||
R: regexp.MustCompile(`ALR-ADD-REPO-RETURN-CODE \d\n$`),
|
||||
T: expect.Fail(expect.NewStatus(expect.Internal, "Unexpected return code!")),
|
||||
},
|
||||
}},
|
||||
})
|
||||
err := r.Exec(e2e.NewCommand(
|
||||
"alr",
|
||||
"addrepo",
|
||||
"--name",
|
||||
"alr-repo",
|
||||
"--url",
|
||||
"https://gitea.plemya-x.ru/Plemya-x/alr-repo.git",
|
||||
))
|
||||
assert.NoError(t, err)
|
||||
|
||||
err = r.Exec(e2e.NewCommand(
|
||||
"bash",
|
||||
"-c",
|
||||
"cat $HOME/.config/alr/alr.toml",
|
||||
))
|
||||
assert.NoError(t, err)
|
||||
|
||||
err = r.Exec(e2e.NewCommand(
|
||||
"alr",
|
||||
"removerepo",
|
||||
"--name",
|
||||
"alr-repo",
|
||||
))
|
||||
assert.NoError(t, err)
|
||||
|
||||
var buf bytes.Buffer
|
||||
err = r.Exec(e2e.NewCommand(
|
||||
"bash",
|
||||
"-c",
|
||||
"cat $HOME/.config/alr/alr.toml",
|
||||
), e2e.WithExecOptionStdout(&buf))
|
||||
assert.NoError(t, err)
|
||||
assert.Contains(t, buf.String(), "rootCmd")
|
||||
},
|
||||
)
|
||||
}
|
||||
|
Reference in New Issue
Block a user