Running tests of included builds sequent

I am running my tests from a parent directory which includes all the sub builds with includeBuild.
I cannot figure out a way to avoid they run in parallel. I have all sorts of resource conflicts like ports etc… and I cannot run them in parallel. Is there a way to run each and everyone sequentially but still using the nice * notation?

task test {
    dependsOn gradle.includedBuilds*.task(":test")
}

I tried this but no luck, it would not compile.
Apparently TaskReference is not a Task.

task test {
    dependsOn gradle.includedBuilds*.task(":test")
    for (int i = 0; i < gradle.includedBuilds.size() - 1; i++) {
        def nextTask = gradle.includedBuilds[i + 1].task(":test")
        def currentTask = gradle.includedBuilds[i].task(":test")
        nextTask.mustRunAfter currentTask
    }
}

Figured it out: