auth-ui: add e2e tests
Change-Id: Ic8f2f9e032d24eed2d4fd824dcfc26c59d7d915e
diff --git a/core/installer/Makefile b/core/installer/Makefile
index 1655ac0..d2e8068 100644
--- a/core/installer/Makefile
+++ b/core/installer/Makefile
@@ -14,20 +14,24 @@
$(podman) build --file=Dockerfile.flux --tag=$(repo_name)/flux:latest . --platform=linux/arm64
docker push $(repo_name)/flux:latest
+format-check:
+ gofmt -d -l .
+ go run cuelang.org/go/cmd/cue fmt app_configs/*.cue --check
+
format:
go run cuelang.org/go/cmd/cue fmt app_configs/*.cue
build: export CGO_ENABLED=0
build: clean
- /usr/local/go/bin/go build -o pcloud cmd/*.go
+ go build -o pcloud cmd/*.go
test: export CGO_ENABLED=0
test:
- /usr/local/go/bin/go test ./...
+ go test ./...
test: export CGO_ENABLED=0
testv:
- /usr/local/go/bin/go test -v ./...
+ go test -v ./...
bootstrap:
./pcloud --kubeconfig=../../priv/kubeconfig-hetzner bootstrap --env-name=dodo --charts-dir=../../charts --admin-pub-key=/Users/lekva/.ssh/id_rsa.pub --from-ip=192.168.100.210 --to-ip=192.168.100.240 --storage-dir=/pcloud-storage/longhorn --public-ip=135.181.48.180,65.108.39.172
@@ -59,14 +63,14 @@
build_arm64: export GOOS=linux
build_arm64: export GOARCH=arm64
build_arm64:
- /usr/local/go/bin/go build -o server_arm64 cmd/*.go
+ go build -o server_arm64 cmd/*.go
build_amd64: export CGO_ENABLED=0
build_amd64: export GO111MODULE=on
build_amd64: export GOOS=linux
build_amd64: export GOARCH=amd64
build_amd64:
- /usr/local/go/bin/go build -o server_amd64 cmd/*.go
+ go build -o server_amd64 cmd/*.go
push_arm64: clean build_arm64
mkdir tmp
diff --git a/core/installer/app.go b/core/installer/app.go
index 656b992..e42a9df 100644
--- a/core/installer/app.go
+++ b/core/installer/app.go
@@ -4,6 +4,7 @@
"bytes"
_ "embed"
"encoding/json"
+ "errors"
"fmt"
template "html/template"
"net"
@@ -13,7 +14,7 @@
"cuelang.org/go/cue"
"cuelang.org/go/cue/build"
"cuelang.org/go/cue/cuecontext"
- "cuelang.org/go/cue/errors"
+ cueerrors "cuelang.org/go/cue/errors"
"cuelang.org/go/cue/load"
cueyaml "cuelang.org/go/encoding/yaml"
helmv2 "github.com/fluxcd/helm-controller/api/v2"
@@ -419,10 +420,10 @@
func ParseAndCreateNewCueApp(data CueAppData) (cueApp, error) {
config, err := ParseCueAppConfig(data)
if err != nil {
- return cueApp{}, fmt.Errorf(errors.Details(err, nil))
+ return cueApp{}, errors.New(cueerrors.Details(err, nil))
}
if err := config.Err(); err != nil {
- return cueApp{}, fmt.Errorf(errors.Details(err, nil))
+ return cueApp{}, errors.New(cueerrors.Details(err, nil))
}
return newCueApp(config, data)
}
@@ -470,7 +471,7 @@
d := ctx.CompileBytes(buf.Bytes())
res := a.cfg.Unify(d).Eval()
if err := res.Err(); err != nil {
- return rendered{}, fmt.Errorf(errors.Details(err, nil))
+ return rendered{}, errors.New(cueerrors.Details(err, nil))
}
if err := res.Validate(); err != nil {
return rendered{}, err
@@ -708,7 +709,7 @@
ret := []Access{}
for i.Next() {
if a, err := extractAccessInternal(i.Value()); err != nil {
- return nil, fmt.Errorf(errors.Details(err, nil))
+ return nil, errors.New(cueerrors.Details(err, nil))
} else {
ret = append(ret, a...)
}
diff --git a/core/installer/cluster.go b/core/installer/cluster.go
index a51435f..284e393 100644
--- a/core/installer/cluster.go
+++ b/core/installer/cluster.go
@@ -3,6 +3,7 @@
import (
"bytes"
"encoding/json"
+ "errors"
"fmt"
"io"
"net"
@@ -57,7 +58,7 @@
if resp.StatusCode != http.StatusOK {
var buf bytes.Buffer
io.Copy(&buf, resp.Body)
- return fmt.Errorf(buf.String())
+ return errors.New(buf.String())
}
return nil
}
@@ -78,7 +79,7 @@
if resp.StatusCode != http.StatusOK {
var buf bytes.Buffer
io.Copy(&buf, resp.Body)
- return fmt.Errorf(buf.String())
+ return errors.New(buf.String())
}
return nil
}
diff --git a/core/installer/cmd/dodo_app.go b/core/installer/cmd/dodo_app.go
index 9b5da30..7f1957d 100644
--- a/core/installer/cmd/dodo_app.go
+++ b/core/installer/cmd/dodo_app.go
@@ -4,6 +4,7 @@
"bytes"
"database/sql"
"encoding/json"
+ "errors"
"fmt"
"io"
"log"
@@ -276,7 +277,7 @@
if resp.StatusCode != http.StatusOK {
var buf bytes.Buffer
io.Copy(&buf, resp.Body)
- return fmt.Errorf(buf.String())
+ return errors.New(buf.String())
}
return nil
}
@@ -303,7 +304,7 @@
if resp.StatusCode != http.StatusOK {
var buf bytes.Buffer
io.Copy(&buf, resp.Body)
- return fmt.Errorf(buf.String())
+ return errors.New(buf.String())
}
return nil
}
diff --git a/core/installer/server/env/server.go b/core/installer/server/env/server.go
index d6e9eac..44d178a 100644
--- a/core/installer/server/env/server.go
+++ b/core/installer/server/env/server.go
@@ -99,7 +99,7 @@
envInfo map[string]template.HTML
dns map[string]installer.EnvDNS
dnsPublished map[string]struct{}
- allowNewEnvs bool
+ allowNewEnvs bool
}
func NewEnvServer(