Skip to content

Separate extensions from integration tests #3443

@bric3

Description

@bric3

Currently, the subprojects host both Mockito extensions and integration-tests.
Both should be separated in their own hierarchy to improve the visual understanding of what is what. This would also help improve to apply different Gradle configurations for each kind of project.

There are other improvements trickling down

  • This structure led to a programmatic setup in settings.gradle.kts, that injects the location of the project, this should be avoided by using the parent, e.g. mockito-integration-tests:inline-mocks-tests :

    - rootProject.children.forEach { project ->
    -     val projectDirName = "subprojects/${project.name}"
    -     project.projectDir = File(settingsDir, projectDirName)
    -     project.buildFileName = "${project.name}.gradle"
    -     require(project.projectDir.isDirectory) {
    -         "Project directory ${project.projectDir} for project ${project.name} does not exist."
    -     }
    -     require(project.buildFile.isFile) {
    -         "Build file ${project.buildFile} for project ${project.name} does not exist."
    -     }
    - }
  • The bom project needs to filter which project has to figure out be included. Right now it uses a heuristic based on whether the project name ends with test. This can be simplified:

    - project.rootProject.subprojects.forEach { subproject ->
    -     if (!subproject.name.endsWith("Test") &&
    -         !subproject.name.endsWith("-test") &&
    -         subproject.name != "bom") {
    -         api(subproject)
    -     }
    + project(":mockito-extensions").subprojects.forEach {
    +     api(it)
      }
  • Moreover the subproject build scripts have a non conventional name, e.g. androidTest.gradle, rather than build.gradle. This needs to be changed.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions