Skip to content
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

Tests for rabbitmq-plugins list: --silent and --quiet options #10875

Merged
merged 1 commit into from Mar 28, 2024

Conversation

Ayanda-D
Copy link
Contributor

Proposed Changes

Follow up to #10865 and #10870. I just tried looking more into the tests (probably a bit of overkill 😅 ), and this works, all tests passing:

deps/rabbitmq_cli $ make tests TEST_FILE=test/plugins/list_plugins_command_test.exs

Using hard_write=true to allow writing missing plugins in enabled plugins file for test purpose only.

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.

@michaelklishin
Copy link
Member

Thank you. I'm all for adding this test if the plugin manipulations it does are safe. This is one of the worst examples of inherent shared state in our test suites, unfortunately.

@Ayanda-D
Copy link
Contributor Author

Ayanda-D commented Mar 28, 2024

thats a good point, but all shared state concerns are put to rest by using async:false in list_plugins tests (and other tests that pose this concern):

use ExUnit.Case, async: false

The test suite already alters the enabled_plugins file with different plugins for some unique tests. & on_exit we restore the file. Its a very common problem which the Elixir folks have already taken care of with the async:false option, in ExUnit implementation: https://hexdocs.pm/ex_unit/1.13.4/ExUnit.Case.html

The enabled_plugins file will never be accessed concurrently across tests. Should be OK 👍

@michaelklishin
Copy link
Member

@Ayanda-D with make, there's also a shared node running for all CLI tests, so inter-suite interference is an issue.

@michaelklishin michaelklishin merged commit 6e7b8d8 into rabbitmq:main Mar 28, 2024
9 checks passed
michaelklishin added a commit that referenced this pull request Mar 29, 2024
Tests for rabbitmq-plugins list: --silent and --quiet options (backport #10875)
@Ayanda-D Ayanda-D deleted the test-server-10865-and-10870 branch April 2, 2024 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants