Open phillxnet opened 6 months ago
All faulty tests are from: rockstor.smart_manager.tests.test_task_scheduler
And all fail as there is no pre-existing (on host) /etc/cron.d/rockstortab
FileNotFoundError: [Errno 2] No such file or directory: '/etc/cron.d/rockstortab'
Looks like this was my doing... feel stupid for not thinking of mocking that :-\ Sorry for the additional work it creates now.
@FroggyFlox No worries on that front. I was actually going to look at your more recent (and our first) proper file mocking in testing to fix this as it goes. Given we are now on new-enough Python. I think it was a more recent addition, from memory.
Maybe this was it: https://github.com/rockstor/rockstor-core/pull/2718
To probe for any other outlier unit tests:
# for the missing dir - owned by the following rpm dependency:
zypper in --no-recommends cronie
# for the inadvertently sensitive file, created in a prior rockstor-run/unit-test-run:
touch /etc/cron.d/rockstortab
We have, on the same 'clean' system:
Found 279 test(s).
Creating test database for alias 'smart_manager'...
System check identified no issues (0 silenced).
.......................................................................................................................................................................................................................................................................................
----------------------------------------------------------------------
Ran 279 tests in 87.304s
OK
@FroggyFlox from the above these look to be the last of their kind (hopefully) and all within a single test.
I'll not tend to these for now as I've got a significant backlog currently. But just wanted to issue this while I had the reproducer here. If anyone fancies looking at these failure they should be reproducible via the sensitive file's removal (the one that shouldn't yet exist on a clean system :) ). If this one takes any-ones fancy just assign yourself so we don't duplicate effort.
When running rpmbuild for the first time on a 'clean' TW 20240205 host, we have 3 remaining tests that are 'sensitive' to prior host conditions.