tests: cache dir creation on demand