Skip to content

Commit

Permalink
resolving errors
Browse files Browse the repository at this point in the history
Signed-off-by: ntishchauhan0022 <nitishchauhan0022@gmail.com>
  • Loading branch information
nitishchauhan0022 committed Jul 23, 2023
1 parent 7d7003e commit 73f3fd9
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build_goreleaser/loadtester/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ARG BASE_IMAGE=alpine:3.17.0
FROM ${BASE_IMAGE}
LABEL org.opencontainers.image.title=loadtester
LABEL org.opencontainers.image.description="Load Tester"
LABEL org.opencontainers.image.url=https://hub.docker.com/r/gresearch/armada-loadtester
LABEL org.opencontainers.image.url=https://hub.docker.com/r/gresearch/loadtester

RUN addgroup -S -g 2000 armada && adduser -S -u 1000 armada -G armada
USER armada
Expand Down
36 changes: 30 additions & 6 deletions magefiles/tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ func Teste2eSetup() error {
mg.Deps(StartComponents)

if err := dockerRun("run", "-d", "--name", "lookout-ingester-migrate", "--network=kind", "-v", "${PWD}/e2e:/e2e",
"gresearch/lookoutingester", "--config", "/e2e/setup/lookout-ingester-config.yaml", "--migrateDatabase"); err != nil {
"gresearch/armada-lookout-ingester", "--config", "/e2e/setup/lookout-ingester-config.yaml", "--migrateDatabase"); err != nil {
return err
}

Expand All @@ -230,7 +230,7 @@ func Teste2eSetup() error {
return err
}
createQueue := func(queueName string) error {
cmd := append(go_cmd, "run", "cmd/armadactl/main.go", "create", "queue", queueName)
cmd := append(go_cmd, "go", "run", "cmd/armadactl/main.go", "create", "queue", queueName)
if err = dockerRun(cmd...); err != nil {
return err
}
Expand Down Expand Up @@ -266,11 +266,35 @@ func Teste2eSetup() error {

LocalDevStop()

if err := sh.Run("rm", ".kube/config"); err != nil {
fmt.Println("Error removing .kube/config:", err)
// Check if .kube/config file exists
if _, err := os.Stat(".kube/config"); err == nil {
if err := sh.Run("rm", ".kube/config"); err != nil {
fmt.Println("Error removing .kube/config:", err)
}
} else if os.IsNotExist(err) {
fmt.Println(".kube/config does not exist")
} else {
fmt.Println("Error retrieving stats for .kube/config:", err)
}
if err := sh.Run("rmdir", ".kube"); err != nil {
fmt.Println("Error removing .kube directory:", err)

// Check if .kube directory exists
if _, err := os.Stat(".kube"); err == nil {
entries, err := os.ReadDir(".kube")
if err != nil {
fmt.Println("Error reading .kube directory:", err)
}
// Checking if directory is empty
if len(entries) == 0 {
if err := sh.Run("rmdir", ".kube"); err != nil {
fmt.Println("Error removing .kube directory:", err)
}
} else {
fmt.Println(".kube directory is not empty")
}
} else if os.IsNotExist(err) {
fmt.Println(".kube directory does not exist")
} else {
fmt.Println("Error retrieving stats for .kube directory:", err)
}
}()

Expand Down

0 comments on commit 73f3fd9

Please sign in to comment.