Quote from another thread:
Quote:
At the moment, NCrunch's prioritisation system works as follows:
High priority (targeted by UI) +10000
Failing test +100
Impacted test +300
Test never run before +200
Test is pinned +200
There are then modifications of these values as the tests are grouped together (averaging) and sliced into different execution brackets to eventually create tasks. This includes a logarithmic adjustment that accounts for test execution time. The modifications are too complex to easily summarise here, but of interest is that the engine will assign more priority to larger groups of tests if they are in one task. This would mean that if you have a large number of fast passing tests all landing in the same task, the engine would put more priority on executing this task since it probably contains 5000 tests, whereas the other tasks only contain 8.
Is there anything (attribute? Ncrunch Config setting?) that I can use to permanently boost the priority weighting of a particular test or class of tests?
<hr>
Context:
I have one particularly slow test class. It's testing the DI framework config, and regretably it seems to take ~30 seconds to bootstrap the DI kernel :(
There are 14 tests in the class, with the bootstrapping in a OneTimeSetup method, so the class takes 30 secs to initialise, and then completes all 14 tests in <1 second
The rest of the Solutions' tests run in ~25 seconds (It has a bunch of other integration tests too), and the slow tests are completely parallelisable with the others, so if it always started those tests first then it wouldn't be too much of an issue.
But I feel like that isn't normally what happens - I normally see lots of tests running for ~20 second and then those last 14 tests spinning for at least
another 20 seconds.
I'd like to tell NCrunch that it should (almost?) always start those tests first before starting anything else, and then start running the others in parallel. (In the above weighting, I'd probably choose to assign +600 to all tests in the class). It soudns like pinning it will help some, but I'd prefer it to be part of the actual code or project config, if possible?
Is this A Thing?