Gradle running tests from another subproject

Hi,

I have a gradle project with 4 subprojects: client, proto, server, & actions. Currently, the server project is the only one with tests but when I run gradle build I get the following error reported from the actions project for each test in the server project:

java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:132
        Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException at ConstructorResolver.java:797
            Caused by: org.springframework.beans.factory.BeanCreationException at BeanDefinitionValueResolver.java:342
                Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException at ConstructorResolver.java:797
                    Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException at ConstructorResolver.java:797
                        Caused by: org.springframework.beans.factory.BeanCreationException at ConstructorResolver.java:655
                            Caused by: org.springframework.beans.BeanInstantiationException at SimpleInstantiationStrategy.java:185
                                Caused by: java.lang.NoClassDefFoundError at ManagedChannelBuilder.java:39

These tests all run successfully when run from IntelliJ. Furthermore, the grpc dependency it is complaining about is provided in the root build and supplied to all projects via the subprojects configuration so even though the tests are in the wrong module I would still expect the tests to pass. Please help me understand why this is happening:

settings.gradle:

rootProject.name = "my-project"
include ":proto", ":client", ":server", ":actions"

project(":proto").projectDir = file("src/proto")
project(":client").projectDir = file("src/client")
project(":server").projectDir = file("src/server")
project(":actions").projectDir = file("src/actions")

build.gradle:

plugins {
    id "org.springframework.boot" version "2.3.3.RELEASE" apply false
    id "com.google.protobuf" version "0.8.13" apply false
}

ext {
    lombokVersion = "1.18.8"
    grpcVersion = "1.32.1" //Same version as spring-cloud-gcp-starter-data-spanner
}

subprojects {
    apply plugin: "io.spring.dependency-management"
    apply plugin: "java"
    apply plugin: "idea"

    repositories {
        mavenCentral()
        mavenLocal()
    }

    dependencyManagement {
        imports {
            mavenBom "org.springframework.boot:spring-boot-dependencies:2.3.3.RELEASE"
        }
    }

    dependencies {
        //gRPC Dependencies
        implementation "io.grpc:grpc-services:${grpcVersion}"

        //Lombok
        compileOnly "org.projectlombok:lombok:${lombokVersion}"
        annotationProcessor "org.projectlombok:lombok:${lombokVersion}"
        testImplementation "org.projectlombok:lombok:${lombokVersion}"
        testAnnotationProcessor "org.projectlombok:lombok:${lombokVersion}"

        //Test Dependencies
        testRuntime "org.junit.jupiter:junit-jupiter-engine"
        testImplementation "org.junit.jupiter:junit-jupiter-api"
        testImplementation "org.junit.jupiter:junit-jupiter-params"
        testImplementation("org.springframework.boot:spring-boot-starter-test") {
            exclude group: "junit", module: "junit"
            exclude group: "org.junit.vintage"
        }
    }

    test {
        useJUnitPlatform()
    }

    buildDir = new File(rootProject.projectDir, "build/")
}

server build.gradle:

apply plugin: "org.springframework.boot"

dependencies {
    implementation project(":proto")
    implementation project(":actions")

    //Spring Dependencies
    implementation "org.springframework.boot:spring-boot-starter-web"
    implementation "org.springframework.boot:spring-boot-starter-actuator"
    implementation "org.springframework.boot:spring-boot-starter-validation"
    implementation 'org.springframework.cloud:spring-cloud-gcp-starter-data-spanner:1.2.6.RELEASE'
    implementation "io.github.lognet:grpc-spring-boot-starter:4.2.2"
}

actions build.gradle:

dependencies {
    implementation project(":proto")
}

build output:

37 tests completed, 37 failed

> Task :actions:test FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':actions:test'.
> There were failing tests. See the report at: file:///Users/brabinowitz/workspace/my-project/build/reports/tests/test/index.html

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.8/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 27s
23 actionable tasks: 21 executed, 2 up-to-date