-
Notifications
You must be signed in to change notification settings - Fork 29
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
Refs #32917 - Don't deploy or configure Redis with new tasking system #207
Conversation
23950c2
to
760d795
Compare
rebased and added logic to handle content caching |
Please rebase now that #203 is merged. |
This I can fix, but what I want to point out is, we only don't see similar results in some of the enable/disable rq tasking tests, because of the order in which those tests are running.... once redis gets installed once, the failure won't occur. |
760d795
to
274cf1c
Compare
That sounds like Pulp has a hard dependency on Redis and something we should take upstream. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can also consider a line in init.pp
like $uses_redis = $use_rq_tasking_system or $cache_enabled
and use that variable in database.pp
and settings.py
.
That isn't how I interpreted it. If you look closely at what happens:
I'll update that test. Additionally, I'm going to move the 'enable content caching' test out of basic_spec.rb where we have multiple top-level describe blocks. I'd like to move the reducing worker count test out into its own test as well, but there is already a PR open for it (#209 ) |
Probably a good idea to consolidate the logic in this way. Thanks I was actually taking a similar approach with #206 and I'm not sure the reason I didn't follow it here. Probably a simple oversight |
6612b0f
to
0933244
Compare
is_expected.to contain_concat__fragment('base') | ||
.without_content(/CACHE_ENABLED = True/) | ||
.without_content(%r{CACHE_SETTINGS = \{\n 'EXPIRES_TTL': 60,\n\}}) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch, thank you.
is_expected.to contain_concat__fragment('base') | ||
.with_content(/USE_NEW_WORKER_TYPE = True/) | ||
is_expected.to contain_systemd__unit_file('pulpcore-resource-manager.service').with_ensure('absent') | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This are OK here, but they feel better up here https://github.com/theforeman/puppet-pulpcore/pull/207/files#diff-257fe3136ecfdbfcb123b6445ff2de6c21d1fe08b0d6af54c08dde40637d2594R19 for me as it connects all of the configuration file together.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I started to think that it makes sense to structure the tests around the real world use case rather than the specific object being tested..
So instead of having all tests for the configuration file in the same place, have a test for 'content caching is disabled', 'postgresql tasking system is used', and so on.
I see two primary benefits: 1. This feels more maintainable in the longer term (when we make modifications to a specific feature, the tests for that feature are all located in that block, rather than spread out across different components the feature touches). 2. This should lead to more readable test output, and particularly failures. So instead of getting a failure like default parameters - it configures pulpcore - it is expected to contain a file with (lots of stuff, including all kinds of things that aren't relevant to the specific thing you broke)
you would instead see something more like default parameters - it uses new tasking system - it is expected to contain a configuration file with specific things that are relevant to the tasking system
I want to pursue this idea more consistently in my planned refactoring. For this PR I thought, it makes sense to write the net-new tests using this style, to minimize the amount of re-writing I have to do later.
0933244
to
1d948d3
Compare
Thanks for feedback @ehelms ! I pushed an update to address these items. In particular I use Regarding the overall structure of the tests, I did opt to keep for now the change of moving some tests of the configuration file contents out of the With that said, if any of those changes are really controversial, I can revert them and tackle them later. The goal in not writing the same code twice is to save time. If it's not actually saving me (rather us, since review time is part of the equation too) time in the end, I'll go ahead and do what is asked of me here, and re-write it the way I think it really should be in the other PR. |
If you are curious where I got the using https://github.com/voxpupuli/voxpupuli-test/blob/master/rubocop.yml#L467-L470 Thus, they have chosen to enforce the use of |
Looks like we're running into this now: https://community.theforeman.org/t/katello-nightly-rpm-pipeline-1027-failed/24403 |
This is a more gradual alternative to #206
In particular, it doesn't include the ability to enable or disable management of Redis, nor does it consider the content caching feature.
it simply includes the redis class and configures Pulpcore for Redis, based on the value of
use_rq_tasking_system