Skip to content
Snippets Groups Projects
Commit 0dfc9627 authored by Fabian Seidl's avatar Fabian Seidl
Browse files

revert ci test changes

parent ee6f30b3
No related branches found
No related tags found
1 merge request!691Resolve "Implement integration tests for applications"
Pipeline #178319 failed
This commit is part of merge request !691. Comments created here will be created in the context of that merge request.
...@@ -6,7 +6,6 @@ import ( ...@@ -6,7 +6,6 @@ import (
"os/signal" "os/signal"
"strings" "strings"
"syscall" "syscall"
"time"
"code.fbi.h-da.de/danet/gosdn/application-framework/event" "code.fbi.h-da.de/danet/gosdn/application-framework/event"
"code.fbi.h-da.de/danet/gosdn/application-framework/registration" "code.fbi.h-da.de/danet/gosdn/application-framework/registration"
...@@ -56,7 +55,6 @@ func NewApplication(ctx context.Context, grpcClientConn *grpc.ClientConn, contro ...@@ -56,7 +55,6 @@ func NewApplication(ctx context.Context, grpcClientConn *grpc.ClientConn, contro
func (a *Application) Run(eventTypeCallbackTuples []event.TypeToCallbackTuple) { func (a *Application) Run(eventTypeCallbackTuples []event.TypeToCallbackTuple) {
signal.Notify(a.stopChannel, os.Interrupt, syscall.SIGTERM) signal.Notify(a.stopChannel, os.Interrupt, syscall.SIGTERM)
time.Sleep(5 * time.Second)
a.eventService.SubscribeToEventType(eventTypeCallbackTuples) a.eventService.SubscribeToEventType(eventTypeCallbackTuples)
a.eventService.SetupEventReciever(a.stopChannel) a.eventService.SetupEventReciever(a.stopChannel)
......
...@@ -99,8 +99,6 @@ func TestMain(m *testing.M) { ...@@ -99,8 +99,6 @@ func TestMain(m *testing.M) {
if os.Getenv("RABBITMQ") == "" { if os.Getenv("RABBITMQ") == "" {
_ = <-application.eventChannel _ = <-application.eventChannel
_ = <-application.eventChannel _ = <-application.eventChannel
} else {
integration_test_utils.ClearRabbitMQQueues()
} }
m.Run() m.Run()
......
...@@ -4,7 +4,6 @@ import ( ...@@ -4,7 +4,6 @@ import (
"context" "context"
"fmt" "fmt"
"os" "os"
"os/exec"
"time" "time"
configMgmtPb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/configurationmanagement" configMgmtPb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/configurationmanagement"
...@@ -193,38 +192,3 @@ func cleanRolesExceptAdmin(resp *apb.GetRolesResponse, roleService apb.RoleServi ...@@ -193,38 +192,3 @@ func cleanRolesExceptAdmin(resp *apb.GetRolesResponse, roleService apb.RoleServi
return nil return nil
} }
func ClearRabbitMQQueues() {
rabbitMQAddress := "localhost"
envVarRabbitmq := os.Getenv("RABBITMQ")
if envVarRabbitmq != "" {
rabbitMQAddress = envVarRabbitmq
}
// add more queue names if necessary
queues := []string{
"user",
"role",
"managedNetworkElement",
}
for _, queue := range queues {
args := []string{
"-i",
"-u", "guest:guest",
"-H", "\"content-type:application/json\"",
"-X", "POST",
"http://" + rabbitMQAddress + ":15672/api/queues/%2f/" + queue + "/get",
"-d", "{\"count\":10,\"encoding\":\"auto\",\"truncate\":50000,\"ackmode\":\"ack_requeue_false\"}",
}
cmd := exec.Command("curl", args...)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
err := cmd.Run()
if err != nil {
logrus.Info(err)
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment