MarathonLabs / marathon

Cross-platform test runner

Home Page:https://docs.marathonlabs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Treat sharding count 1 and "ANY SUCCESS" as if sharding was off

smugleafdev opened this issue · comments

Problem description
I was recently able to refactor several MFiles into one, thanks to using variables in place of values. The only thing stopping me from combining the last one is that even if I variablize shard count and set it to 1, I get blocked by the config checker:

Configuration is invalid: can't use complex sharding and any success execution strategy at the same time. Consult documentation for the any success execution logic

Solution example
If ANY_SUCCESS and sharding strategy is count and count is not 1, throw exception

when(configuration.executionStrategy.mode) {
            ExecutionMode.ANY_SUCCESS -> {
                if (configuration.shardingStrategy !is ShardingStrategyConfiguration.ParallelShardingStrategyConfiguration
                    && configuration.shardingStrategy.count != 1) { // <-- this

Describe alternatives you've considered
I may be missing something clever about the configuration that would allow me to do this without any changes, but I haven't been able to find it.

Thanks for submitting, should be in the next release