Skip to content

Minor: Don't use Mnesia in rabbitmq_mqtt/test/processor_SUITE #14210

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 11, 2025

Conversation

gomoripeti
Copy link
Contributor

Proposed Changes

Soon Mnesia will be gone from RabbitMQ, so better make the test suite metadata store agnostic. (The suite contains unit tests so mocking on a higher level seemed acceptable)

Also refactored mqtt_processor get_vhost functions, in order to clarify preference of different methods. This commit does
not change functionality. (I wanted to prepare an actual change in this area but abandoned the idea. But I think this refactoring makes the code a bit more readable

This highlighted some differences (which I initially thought as inconsistencies, but after digging the history they seem to be intentional and the behaviour is documented in the processor_SUITE)

  • If both User/Password and SslLogin are provided, in
    check_credentials User/Password takes precedence while in
    get_vhost SslLogin

  • If SslLogin is provided (but no mapping is found) vhost from port
    mapping has precedence over vhost from UserName, while in case of
    no ssl it is the other way around.

Types of Changes

What types of changes does your code introduce to this project?
Put an x in the boxes that apply

  • Bug fix (non-breaking change which fixes issue #NNNN)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause an observable behavior change in existing systems)
  • Documentation improvements (corrections, new content, etc)
  • Cosmetic change (whitespace, formatting, etc)
  • Build system and/or CI

Checklist

Put an x in the boxes that apply.
You can also fill these out after creating the PR.
If you're unsure about any of them, don't hesitate to ask on the mailing list.
We're here to help!
This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING.md document
  • I have signed the CA (see https://cla.pivotal.io/sign/rabbitmq)
  • I have added tests that prove my fix is effective or that my feature works
  • All tests pass locally with my changes
  • If relevant, I have added necessary documentation to https://github.com/rabbitmq/rabbitmq-website
  • If relevant, I have added this change to the first version(s) in release-notes that I expect to introduce it

Further Comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution
you did and what alternatives you considered, etc.

Soon Mnesia will be gone from RabbitMQ, so better make the test suite
metadata store agnostic.
Copy link
Collaborator

@michaelklishin michaelklishin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using Mnesia less in the suites where we do not test a Mnesia-specific behavior or Mnesia compatibility per se — and here we don't — makes sense to me, even though I am generally not a fan of mocks.

In order to clarify preference of different methods. This commit oes
not change functionality.

This highlights some inconsistences:

- If both User/Password and SslLogin are provided, in
  `check_credentials` User/Password takes precedence while in
  `get_vhost` SslLogin

- If SslLogin is provided (but no mapping is found) vhost from port
  mapping has precedence over vhost from UserName, while in case of
  no ssl it is the other way around.
@gomoripeti gomoripeti force-pushed the mqtt_processor_SUITE_no_mnesia branch from ae4be12 to 7d4ecb5 Compare July 11, 2025 07:16
@ansd
Copy link
Member

ansd commented Jul 11, 2025

Thank you @gomoripeti, the code is simpler to read now after your refactor!

@ansd ansd merged commit 37cb595 into rabbitmq:main Jul 11, 2025
553 of 561 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants