Uh oh!
There was an error while loading. Please reload this page.
Remove redundant temp folder and unused imports - #1224
Conversation
joshuagl
left a comment
There was a problem hiding this comment.
Thank you for taking the time to clean this up. I have a few minor comments, mostly on not adding semi-redundant comments to the code.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
MVrachev
commented
Nov 26, 2020
Addressed all of @joshuagl comments and:
|
It seems like because we are supporting |
joshuagl
commented
Dec 3, 2020
Ah, yes. The syntax changed for |
joshuagl
commented
Jan 8, 2021
Would be good to get this cleanup landed. @MVrachev could you revert back to |
jku
commented
Jan 15, 2021
I'm a bit worried about
So I wonder if this should only be done if we also start creating the temp dirs somewhere more reasonable? Does anyone know when the temp dirs are not being removed? |
Besides the expected case when |
sechkova
commented
Jan 18, 2021
I would vote for that if possible. Polluting the tests source code dir on a failure is not particularly harmful but ... unpleasant |
MVrachev
commented
Jan 18, 2021
Yes, the side effect is that it will create one temp dir per class instance.
As I understand it, the idea is to have those temp files available for you on test failure for analysis.
The doc says: Again from the doc for tearDownClass: Also again in the doc |
joshuagl
commented
Jan 18, 2021
Python has a function to get an OS appropriate, administrator configurable, temporary directory |
sechkova
commented
Jan 18, 2021
Sorry for giving you a bit random hints and not direct answers but in the Windows case temporary files created by But this is a Windows VM so it can be something specific to this case ... |
MVrachev
commented
Mar 1, 2021
Blocked, until we remove Python2 from our tests as Joshua has mentioned. |
In many of the tests classes, we are creating two temporary directories: one with the name "temp_<random_string>" and inside it, we generate a new directory for each test with the name "Test<Class_Name>_<random_string>". I think we don't need the "temp_<random_string>" directory. The only benefit I can think of is that it could contain multiple temp folders from failing tests from a particular test run. But even then, this is not a big bonus because the name "temp_<random_string>" is not really descriptive from which test run this directory was created. Also, fixed the way we import "unittest_toolbox" and replace "unittest_toolbox.Modified_TestCase.function(self)" with "super().function()". PS: Thanks to Jussi Kukkonen who noticed we are using two temp folders per class in our tests. Signed-off-by: Martin Vrachev <mvrachev@vmware.com>
After the removal of python2 test cases in 13b0857 I rebased and updated this pr. |
MVrachev
commented
Mar 4, 2021
Honestly, I am wondering about this change. |
jku
commented
Apr 13, 2021
I might have broken this PR quite badly with a recent bug fix (moved chained up teardown calls to the correct place in #1346 to fix issues found in another PR). Sorry about that -- I did not remember this one. I think that PR also makes this one a bit less needed: at least in the tests that I touched I made sure that we only try to remove the "topmost" directory (because that will remove every other directory inside it). In some cases there might still be unneeded temp directories. Let's discuss when you are back. |
MVrachev
commented
Apr 19, 2021
As I said before, I don't feel so confident about this change anymore. |
Description of the changes being introduced by the pull request:
In many of the tests classes, we are creating two
temporary directories: one with the name "temp_<random_string>"
and inside it, we generate a new directory for each test with the name
Test<Class_Name>_<random_string>.I think we don't need the "temp_<random_string>" directory.
The only benefit I can think of is that it could contain multiple
temp folders from failing tests from a particular test run.
But even then, this is not a big bonus because the name
temp_<random_string>is not really descriptive from which testrun this directory was created.
PS: Thanks to Jussi Kukkonen who noticed we are using two temp
folders per class in our tests.
Signed-off-by: Martin Vrachev mvrachev@vmware.com
Please verify and check that the pull request fulfills the following
requirements: