-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
ParameterSet: Use python3 to run tests #34477
Conversation
please test |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-34477/23931
|
A new Pull Request was created by @smuzaffar (Malik Shahzad Muzaffar) for master. It involves the following packages:
@makortel, @smuzaffar, @Dr15Jones can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
I suppose this means it is time to "fix" the unit test that fails in |
-1 Failed Tests: UnitTests Unit TestsI found errors in the following unit tests: ---> test TestFWCoreParameterSetDriver had ERRORS Comparison SummarySummary:
|
Ok, this turned out to be more complicated than I thought (I was expecting to fix #28703 but the shell script stops at first error, and the first failure hid many others) I got to 1aacba4cb61, but there are still two failures that I couldn't figure out quickly what to do
Here I don't understand how
i.e. the cmssw/FWCore/ParameterSet/python/Types.py Line 1983 in 1aacba4
should fail but it doesn't. Same occurs with python2, in master this "test failure" gets ignored because the setattr() is called by the testAllowed() function body instead of the self.assertRaises() function. @Dr15Jones, could you take a look?
How should we proceed in general? Fixing these errors by many people on top of this PR plus my commit starts to become cumbersome. There are also bunch of deprecation warnings, but I'd leave those to be addressed a little bit later time (e.g. I'd be tempted to not care if the fixes work with py2), but still for 12_0_0. |
specifically for @makortel question on random unhashable stuff - tasks are supposed to be of type Task. So, put a check for that (just as there is a check for appending to self._tasks)
|
about the setattr I see that
seems not to throw a ValueError but rather a RuntimeError. and second, that reseting aValue as a PSet removes the original requirement
Both of these look to be true also in python2. (eg, in pre3) -- A potentially better test
|
fixing that I"m still left with testTaskPlaceholder and testTask errors that I would have thought @makortel 's commit fixes - but perhaps we have another set non reproducibility issue to find? |
Thanks @davidlange6, that would indeed work. I'm still confused though why Ah, now I found the reason.
If there is not need to make |
|
Good point, thanks @davidlange6, so the attempted test is flawed. The test should really use some native type in the assignment instead of |
When playing around with the test, I tried |
String was an allowed type for aValue, no?
… On Jul 14, 2021, at 3:51 PM, Chris Jones ***@***.***> wrote:
When playing around with the test, I tried lambda : setattr(p1, 'aValue', "foo") and that didn't raise the exception! Looks like python happily convert a string to an int? Doing lambda : setattr(p1, 'aValue', 1.3) did raise the exception.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Ooops, I missed that. Thanks. |
This commit dd717c3 makes all of these tests work for me with python 3 in CMSSW_12_0_X_2021-07-12-2300. It does make |
@Dr15Jones found out a problem in the previous commit (see discussion there), here is a new one that resolves that issue: 737634e8118 |
Seems that @Dr15Jones and I have converged that 737634e8118 is ok. @smuzaffar Do you want to cherry-pick it here, or how should we proceed? |
Certainly |
Done in #34493. |
closing in favor of #34493 |
This is needed in order to drop the next set of python2 based modules ( cms-sw/cmsdist#7112 ).
These are technical changes and should not break any thing as unit tests are working in PY3 IBs where python is python3.