Integrate fake logger with test configuration.#473
Conversation
3ef3f7f to
a63356d
Compare
|
@jonasbardino This is the branch I referenced earlier - battening down this particular hatch is surfacing some otherwise silent errors, and I could use second eyes in assessing whether behavioural issues are being highlighted. There are some issues with a common cause being highlighted - my suggestion is using The first one I'm seeing that looks decidedly suspect is in grid_events, where banning error logs is catching the following: |
jonasbardino
left a comment
There was a problem hiding this comment.
Looks fine but I'll take a look at the tests as suggested before approving.
|
@jonasbardino are you sure about that diagnoses wrt the grid events tests? I don’t know the code very well, but reading it I did see it appears to be calling id with multiple arguments in the text formatting case. I’ll add the fabrication empty settings files here and see what the situation is, but I don’t immediately see how text formatting would be changed. Could I ask you to read over that again? |
I'll look into it. I already identified and fixed some issues in |
Great and thanks. Can see bits and pieces trickling in (though haven’t had a chance to look deeply at them yet for transparency) which is great - think this tightening will serve us well going forward! I’ll obviously contribute to straightening out the machinery and patching things wherever I can, so let me know what I can handle as part of the joint exercise :) |
AFAICT the failing |
|
I've added a detailed description that explains the context and the changes being made here. |
Cool - do yo want me to do something there or shall I leave that to you now you're looking at it? |
…bly a copy/paste error from doing the same for `main`. Sync `main` init to use `None` as well like in the cron runner. This should fix a number of errors uncovered in #473, too.
Alright, it turned out to be only slightly similar cases of ending up with |
…bly a copy/paste error from doing the same for `main`. Sync `main` init to use `None` as well like in the cron runner. This should fix a number of errors uncovered in #473, too.
ce8b7d0 to
d7073fb
Compare
`TEST_USER_DN` user with a TODO about integrating that bit in usersupp instead.
|
I think we finally covered all the silently failing issues this change revealed and CI succeeds again. Please note that in order to get a few last failing |
#467 is open to address this and was updated to line up with he outcomes of the discussion referenced above. |
…d unit tests and use the `vgrid_set_X` variants instead og `vgrid_add_X` in set up to make sure missing pickles don't cause log noise, which will now cause trouble.
… they cause log verification errors otherwise. Sort import with `isort` for consistency.
…pply isort for consistency.
…s now that they include log analysis. Apply isort for consistency.
…ests now that log analysis will otherwise raise it as errors. Apply isort for consistency.
…sis. Apply isort and comments to address the review feedback about marking imports.
…nt to avoid breakage even on cosmetical changes. Use the same msg matching as other unit tests in the test suite. Mark imports according to review feedback.
Removed a stale try/except wrap of imports to avoid autopep8 interference. We should not need it anymore.
…sis. Apply isort and comment on import order in line with review feedback. Various style cleanups to align with PEP8, max line length and mandatory class docstrings.
…that the updates to default test user provisioning solves missing settings pickle. Basically replaces most of the custom DUMMY_X with TEST_X to sue that default test user for most tests. Obsoletes most ID collision test set up now included.
`TEST_USER_DN` user with a TODO about integrating that bit in usersupp instead.
… a local SMTP will fail when trying to notify users about various things with send_email so we adjust janitor tests to silently ignore that until we have a proper implementation of skip email in tests.
…nd_email errors from various janitor tests until we integrate a skip email fix.
…n peers test of accountreq until we have implemented a fix to disable mail notification in unit tests.
…e of by test isolation and clean up as pointed out in review (thanks @albu-diku).
1c0d611 to
9eefe3d
Compare
9eefe3d to
01422f2
Compare
Removed a stale try/except wrap of imports to avoid autopep8 interference. We should not need it anymore.
automatic init of settings file. Requires temporary adjustments to forgive errors and allow the request files to remain because send_email fails.
…bout duplicate method implementation.
Early in the introduction of the supporting libraries, the notion of a FakeLogger was introduced. This is an object that is usable as a substitute
.loggerproperty on the MiG configuration and will capture anything output for each channel for the purposes of being able to assert against later.Almost all codepaths which handle internal error conditions send messages to the error channel. Thus, we can use the presence of messages in the error channel (or lack thereof) as a proxy for whether anything internal went wrong. The wiring to assert no errors were recorded has been there since the initial introduction of FakeLogger, but in order for it to kick in we must be using the instance for the duration of each test case.
The missing piece was ensuring that when we request the
"testconfig"via a_provide_configuration()call that we assign the test logger. This commit does that and hence integrates them correctly. Doing so catches a number of cases where we either fail to account for error messages or had conditions causing unexpected errors to be generated - these are repaired here as well.