Support parallel test runs
Several users have asked and/or submitted forks/PRs to make deep.Equal thread-safe. The problem being solved is that go-test/deep uses package-level vars/settings, like deep.CompareUnexportedFields. So if two tests want different options, they can't (or, they can't run in parallel).
The fix is, of course, to remove package-level vars/settings (something like the relatively new flags). But there are two challenges:
This package is widely used, so the v1 API can't be broken. Either a new function needs to be added (deep.EqualP for "parallel'?) or a v2 needs to be created so v1 users won't be affected (they'll have to explicitly change their package/path/import).
The fewer the internal changes the better. Some PRs modify a lot, which makes it very difficult to verify that nothing has been broken. The internals of this package are necessarily very complicated, and even with 100% test cover, it's difficult to make doubly certain that comparisons are done correctly.
I'm very busy, so I'm not sure if I'll ever have time to do this. If someone else does, please start small with a minimal implementation that fixes the "problem #1": not being able to run in parallel with different vars/settings.
@acorello Here's the issue I mentioned. Looking at https://github.com/go-test/deep/compare/master...acorello:deef:deef, that's probably going to be too many changes at once.
@acorello Here's the issue I mentioned. Looking at https://github.com/go-test/deep/compare/master...acorello:deef:deef, that's probably going to be too many changes at once.
Yes, too many breaking changes there: I went in fork mindset while waiting to hear from you. But I'm happy to offer a PR with a backward compatible improvement. Let me get back to this issue with a proposal.
@daniel-nichter I've created a PR 68 with a minimal set of changes. It's based on a new fork (pls ignore the previous one).
See PR description for details.