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

Create mock class/data for MSPileup #11891

Closed
amaltaro opened this issue Feb 7, 2024 · 0 comments · Fixed by #11905
Closed

Create mock class/data for MSPileup #11891

amaltaro opened this issue Feb 7, 2024 · 0 comments · Fixed by #11905

Comments

@amaltaro
Copy link
Contributor

amaltaro commented Feb 7, 2024

Impact of the new feature
WMCore unit tests

Is your feature request related to a problem? Please describe.
With a general migration of pileup data location from Rucio to MSPileup - which still resolves it via Rucio - in multiple layers/services of the WMCore, we started seeing failing unit tests here and there, as the previous location was retrieved through mocked Rucio.

A few examples of those unit tests are:

WMCore_t.WorkQueue_t.WorkQueue_t.WorkQueueTest:testProcessingWithPileup changed from success to failure
WMCore_t.WorkQueue_t.Policy_t.Start_t.Block_t.BlockTestCase:testPileupData changed from success to failure
WMCore_t.WorkQueue_t.WorkQueue_t.WorkQueueTest:testPileupOnProduction changed from success to failure

Describe the solution you'd like
In order to have reliable unit tests, which provide a better code coverage, we should ideally mock calls made to MSPileup, mostly through this module:
https://github.com/dmwm/WMCore/blob/master/src/python/WMCore/Services/MSPileup/MSPileupUtils.py

This mocking setup includes:

  • have the actual data to be served within unit tests
  • instead of triggering an HTTP call to MSPileup, to use a mocked class (function?) and data

Describe alternatives you've considered
Another alternative would be to patch each required unit test, but I am not sure we can patch a sole function.

Additional context
This can be part of the meta-issue to provide partial pileup: #11537

Pull requests that can be impacting this functionality - and/or providing a transient workaround - are:
#11879
and
#11870

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
2 participants