Comments (3)
As I read the unit test, it is:
bodhi/bodhi-server/tests/services/test_updates.py
Lines 1546 to 1558 in f610256
creates three users:
bob
is a provenpackager, ralph
is a normal packager, someuser
is neither of both. (yes, the use of proventester
is odd, I assume it refers to old terminology)
bodhi/bodhi-server/tests/services/test_updates.py
Lines 1560 to 1572 in f610256
Creates an update by using user
ralph
.
bodhi/bodhi-server/tests/services/test_updates.py
Lines 1574 to 1588 in f610256
ralph
tries to submit the update to stable, but they cannot because the update has not yet reached any threshold (and it is still in pending -> testing).
bodhi/bodhi-server/tests/services/test_updates.py
Lines 1590 to 1613 in f610256
Force the update into testing and post three comments with karma so that the autopush is triggered.
bodhi/bodhi-server/tests/services/test_updates.py
Lines 1615 to 1644 in f610256
Move the update back to testing, like autokarma was not enabled, and use
bob
user to push to stable and then obsolete it. As a provenpackager they must can do that, also the Update has reached the karma threshold.
The following is just a check that bob
and ralph
can edit the update, other users can't.
from bodhi.
Yes, that's how I read it too - but my point is, none of that makes a lot of sense.
yes, the use of
proventester
is odd, I assume it refers to old terminology
well, it's both old and wrong. proventester is a real thing, separate from provenpackager, which at one point had different powers (proventester feedback was more important than regular user feedback). That's been disabled approximately forever, but some of the code is still around. So saying proventester
is very confusing.
ralph
tries to submit the update to stable, but they cannot because the update has not yet reached any threshold (and it is still in pending -> testing).
Yes. Why are we doing this? What is it testing that has anything to do with "proven packager request privileges", especially since we do not check whether bob
can submit the update in the same situation?
Force the update into testing and post three comments with karma so that the autopush is triggered.
Yes. Why? I don't know. Do you?
Move the update back to testing, like autokarma was not enabled
Well, yeah, except it doesn't do that. A normal update in testing has a request of None
or UpdateRequest.stable
. It doesn't make any sense for an update in testing to have a request of UpdateRequest.testing
. Also, it's not really "moving the update back to testing", because it doesn't change its status. Really, the test relies on the fact that the update never actually reached stable because the autopush only sets the request, and we don't run the composer. But the test doesn't make the situation at all clear. If we pretend all the other behaviour made any sense, this should be something like:
# Set the request back to None (the "autopush" only changed the request, not the status yet)
update.request = None
use
bob
user to push to stable and then obsolete it. As a provenpackager they must can do that
Right. Note this is the first part of the test, after Pete knows how many lines, where we actually assert anything about provenpackager privileges at all. But if all we wanted to do was assert that a provenpackager could submit a stable request for a package they don't own, we could do it in way less code, without involving a named user called ralph
or someuser
, and without ever touching the autopush mechanism. All we need is an update owned by someone other than bob
, and two positive comments.
also the Update has reached the karma threshold
yes. But why do we only test ralph
's capabilities before this happens, and only test bob
's capabilities after it happens? That doesn't seem to make any sense.
The following is just a check that bob and ralph can edit the update, other users can't.
Sure. In fact it's a relatively sane test! But it doesn't need any of the stuff that happened before it, and it has nothing to do with request privileges. It should be a separate test (or the test should be renamed to make it clearer it's testing provenpackager abilities in general).
So ultimately, we agree this huge long test boils down to only three assertions about 'request privileges' at all:
- A non-provenpackager packager who owns an update cannot push it stable if it hasn't reached the minimum karma or time requirements for manual push (we already have tests of this elsewhere, anyway)
- A provenpackager who does not own an update can push it stable if it has reached the minimum karma requirement for manual push (only we take an extremely over-complicated route to get here)
- A provenpackager who does not own an update can obsolete it
The first is tested elsewhere, and probably 75% of the test isn't necessary for the second. We never test the obvious comparisons: can a provenpackager push an update stable without karma? And can a non-provenpackager who does not own an update push it stable or obsolete it? We never test someuser
's capabilities regarding requests at all (only edits).
And of course, if we want this to be a test of "all provenpackager capabilities", we're missing a bunch of stuff. There are other tests for provenpackager capabilities around it, so stuffing non-request-related stuff into this test doesn't seem to make much sense. There is a test_provenpackager_edit_anything
directly above it which seems like a much more sensible place to put assertions about editing abilities.
To me, the test kinda reads like it wanted to test that provenpackagers can push updates stable without karma, only it never actually did that.
from bodhi.
Force the update into testing and post three comments with karma so that the autopush is triggered.
Yes. Why? I don't know. Do you?
I assume it was meant to reach the minimum karma threshold to be able to manually push the update, but it got confused with the autopush threshold. Probably we just need two positive comments without the need of triggering the autopush. I don't remember if it was me writing that code...
from bodhi.
Related Issues (20)
- RFE: login with kerberos HOT 1
- openid-based login broken since upgrade to 8.0.0? HOT 13
- When an auto-obsoleted update is edited with a new build, it does not go back to testing and no koji-build-group.build.complete message is published HOT 3
- RFE: ability to designate updates as addressing issues in any tracker, not just Bugzilla HOT 4
- bodhi's repo checks don't allow disabling drpms
- 8.1 release plan
- Make non-mocked message publishing fail when running tests in bcd environment HOT 1
- Notify maintainer only about actionable issues with the update
- Query timeouts HOT 2
- Changing versioning schema
- Action Required: Fix Renovate Configuration
- Update's 'test gating status' is singular, at certain times in cycle reflects policy for push to testing but allows push to stable
- fedora-ci.koji-build.rpminspect.static-analysis fails because of mixed SPDX and legacy license identifiers HOT 1
- rpminspect static-analysis test fails at annocheck incorrectly HOT 2
- psycopg2.OperationalError unable to connect HOT 2
- build with spec false: budild require python3dist(poetry-core) but not in spec BuildRequires
- bodhi server web Incorrect static resource path for httpd
- Bodhi enums implementation incompatible with Python 3.13
- fedora_messaging API change breaks Pypi tests
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bodhi.