Skip to content

Commit

Permalink
#382 remove no_sort from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kbudde committed Mar 17, 2024
1 parent 0f84817 commit daca780
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ probalby best solution is to use both exporters:

This exporter expects capabilities from rabbitmq 3.6.8 or newer by default.
If you are running older than 3.6.8 you must disable bert and no_sort with the setting RABBIT_CAPABILITIES=compat.
If you are running 3.13.0 or newer you must disable no_sort with the setting RABBIT_CAPABILITIES=no_sort.

### missing data in graphs

Expand Down
2 changes: 1 addition & 1 deletion integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func TestQueueCount(t *testing.T) {
exporterURL = fmt.Sprintf("http://localhost:%s/metrics", defaultConfig.PublishPort)
rabbitManagementURL = env.ManagementURL()
os.Setenv("RABBIT_URL", rabbitManagementURL)
os.Setenv("RABBIT_CAPABILITIES", "bert,no_sort")
os.Setenv("RABBIT_CAPABILITIES", "bert") // no_sort not supported in rabbitmq 3.13+
defer os.Unsetenv("RABBIT_URL")
defer os.Unsetenv("RABBIT_CAPABILITIES")

Expand Down
4 changes: 2 additions & 2 deletions testenv/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
FROM rabbitmq:3.12-management-alpine
RUN rabbitmq-plugins enable --offline rabbitmq_shovel rabbitmq_shovel_management
FROM rabbitmq:3.13-management-alpine
RUN rabbitmq-plugins enable --offline rabbitmq_shovel rabbitmq_shovel_management
10 changes: 5 additions & 5 deletions testenv/testenv.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,23 @@ import (
dockertest "github.com/ory/dockertest/v3"
)

//list of docker tags with rabbitmq versions
// list of docker tags with rabbitmq versions
const (
RabbitMQ3Latest = "3-management-alpine"
)

// MaxWait is time before the docker setup will fail with timeout
var MaxWait = 20 * time.Second

//TestEnvironment contains all necessars
// TestEnvironment contains all necessars
type TestEnvironment struct {
t *testing.T
docker *dockertest.Pool
resource *dockertest.Resource
Rabbit rabbit
}

//NewEnvironment sets up a new environment. It will nlog fatal if something goes wrong
// NewEnvironment sets up a new environment. It will nlog fatal if something goes wrong
func NewEnvironment(t *testing.T, dockerTag string) TestEnvironment {
t.Helper()
tenv := TestEnvironment{t: t}
Expand Down Expand Up @@ -91,13 +91,13 @@ func (tenv *TestEnvironment) CleanUp() {
}
}

//ManagementURL returns the full http url including username/password to the management api in the docker environment.
// ManagementURL returns the full http url including username/password to the management api in the docker environment.
// e.g. http://guest:guest@localhost:15672
func (tenv *TestEnvironment) ManagementURL() string {
return fmt.Sprintf("http://guest:guest@%s:%s", tenv.getHost(), tenv.resource.GetPort("15672/tcp"))
}

//AmqpURL returns the url to the rabbitmq server
// AmqpURL returns the url to the rabbitmq server
// e.g. amqp://localhost:5672
func (tenv *TestEnvironment) AmqpURL(withCred bool) string {
return fmt.Sprintf("amqp://%s:%s", tenv.getHost(), tenv.resource.GetPort("5672/tcp"))
Expand Down

0 comments on commit daca780

Please sign in to comment.