don't try to create dirs under the test suite
ClosedPublic

Authored by kparal on Apr 11 2014, 8:21 AM.

Details

Summary

And also:

  • config: remove cachedir and lockdir, they are not needed ATM
  • config: simplify an error message

This is after discussion in D35#8 with @jskladan and @tflink.

Test Plan

You will no longer see warnings about missing directories when running the test suite, even if you don't have them.

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped

Is "don't try to create dirs under the test suite" useful for something else than just so unittests don't touch the disk? If not, wouldn't it be better to just monkeypatch config values in unittests and don't create additional logic (not) to touch the disk?

Is "don't try to create dirs under the test suite" useful for something else than just so unittests don't touch the disk? If not, wouldn't it be better to just monkeypatch config values in unittests and don't create additional logic (not) to touch the disk?

Yes, we could do that. But we would have to monkeypatch it in every single unit test (a new fixture for every test_* file). This way it's transparent for all tests and you don't need to do anything about it. I mean, that's what TestingConfig is for, isn't it? Also, direct support in TestingConfig seems cleaner to me than monkeypatching (it's basically just two returns). But maybe I'm missing some even simpler solution?

jskladan accepted this revision.Apr 15 2014, 1:51 PM

Makes sense to me, and the code looks fine.

mkrizek accepted this revision.Apr 15 2014, 1:53 PM

ok, makes sense

kparal closed this revision.Apr 15 2014, 2:06 PM

Closed by commit rLTRN28370f12ba01 (authored by @kparal).