Skip to content

Allow absence of Java tests in a module #421

@alexander-yevsyukov

Description

@alexander-yevsyukov

The current configuration for Tests tasks requires that a module has Java tests. It's good, of course, because testing is important. But our configuration makes the build complain even if there are tests in Kotlin. Here's the code:

fun TaskContainer.registerTestTasks() {
    withType(Test::class.java).configureEach {
        filter {
            includeTestsMatching("*Test")
            includeTestsMatching("*Spec")
        }
    }
    register<FastTest>("fastTest").let {
        register<SlowTest>("slowTest") {
            shouldRunAfter(it)
        }
    }
}

There is a workaround for this issue. Creation of a file under test/java/ which does one dummy @Test. It looks ugly, but works.

We need to improve the extension method above so that we can write Kotlin-only tests if we want to.

Metadata

Metadata

Assignees

No one assigned

    Labels

    /BuildBuild taskstech. debtWhat made us slow in dev?

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions