-
-
Notifications
You must be signed in to change notification settings - Fork 481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support using other JUnit @Disabled.. annotations #1844
base: master
Are you sure you want to change the base?
Support using other JUnit @Disabled.. annotations #1844
Conversation
I tried to run ╰─ ./gradlew --no-daemon -p core clean check && ./gradlew --no-daemon -p consumer clean check
To honour the JVM settings for this build a single-use Daemon process will be forked. See https://docs.gradle.org/7.6.3/userguide/gradle_daemon.html#sec:disabling_the_daemon.
Daemon will be stopped at the end of the build
> Task :consumer:compileKotlin FAILED
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:13:11 Unresolved reference: ktor
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:14:11 Unresolved reference: ktor
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:15:11 Unresolved reference: ktor
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:16:11 Unresolved reference: ktor
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:17:11 Unresolved reference: ktor
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:18:11 Unresolved reference: ktor
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:19:11 Unresolved reference: ktor
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:20:11 Unresolved reference: ktor
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:21:11 Unresolved reference: ktor
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:22:11 Unresolved reference: ktor
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:23:11 Unresolved reference: ktor
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:24:11 Unresolved reference: ktor
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:25:11 Unresolved reference: ktor
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:26:11 Unresolved reference: ktor
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:27:11 Unresolved reference: ktor
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:28:11 Unresolved reference: ktor
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:29:11 Unresolved reference: ktor
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:30:11 Unresolved reference: ktor
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:31:11 Unresolved reference: ktor
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:32:11 Unresolved reference: ktor
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:34:8 Unresolved reference: kotlinx
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:35:8 Unresolved reference: kotlinx
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:47:21 Unresolved reference: applicationEngineEnvironment
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:49:7 Unresolved reference: sslConnector
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:52:9 Unresolved reference: host
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:53:9 Unresolved reference: port
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:56:7 Unresolved reference: connector
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:57:9 Unresolved reference: host
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:58:9 Unresolved reference: port
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:62:5 Unresolved reference: module
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:63:7 Unresolved reference: install
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:63:15 Unresolved reference: CallLogging
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:64:7 Unresolved reference: intercept
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:64:17 Unresolved reference: ApplicationCallPipeline
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:65:13 Unresolved reference: context
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:65:43 Unresolved reference: HttpMethod
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:65:65 Unresolved reference: context
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:66:11 Unresolved reference: context
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:67:11 Unresolved reference: context
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:67:27 Unresolved reference: HttpStatusCode
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:70:27 Suspend function 'toPactRequest' should be called only from a coroutine or another suspend function
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:70:41 Unresolved reference: context
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:74:13 Suspend function 'pactResponseToKTorResponse' should be called only from a coroutine or another suspend function
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:74:50 Unresolved reference: context
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:77:13 Suspend function 'pactResponseToKTorResponse' should be called only from a coroutine or another suspend function
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:78:96 Unresolved reference: context
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:85:23 Unresolved reference: NettyApplicationEngine
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:85:48 Unresolved reference: embeddedServer
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:85:63 Unresolved reference: Netty
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:87:77 Unresolved reference: ApplicationCall
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:96:34 Unresolved reference: HttpStatusCode
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:98:20 Unresolved reference: HttpStatusCode
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:102:43 Unresolved reference: ApplicationCall
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:105:24 Unresolved reference: withContext
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:105:36 Unresolved reference: Dispatchers
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:116:20 Overload resolution ambiguity:
public final fun body(body: ByteArray?, contentType: ContentType): OptionalBody defined in au.com.dius.pact.core.model.OptionalBody.Companion
public final fun body(body: String?, contentType: ContentType = ...): OptionalBody defined in au.com.dius.pact.core.model.OptionalBody.Companion
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:119:53 Unresolved reference: it
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:120:37 Unresolved reference: it
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:127:30 Unresolved reference: hostname
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:130:17 Unresolved reference: hostname
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:132:43 Unresolved reference: port
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:141:11 Variable expected
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/KTorMockServer.kt:146:45 Unresolved reference: port
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/MockHttpServer.kt:28:11 Unresolved reference: ktor
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/dsl/HttpPartBuilder.kt:10:11 Unresolved reference: ktor
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/dsl/HttpPartBuilder.kt:11:11 Unresolved reference: ktor
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/dsl/HttpPartBuilder.kt:49:9 Unresolved reference: parseHeaderValue
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/dsl/HttpPartBuilder.kt:49:65 Unresolved reference: it
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/dsl/HttpPartBuilder.kt:71:7 Unresolved reference: parseHeaderValue
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/dsl/HttpPartBuilder.kt:71:52 Unresolved reference: it
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/dsl/HttpPartBuilder.kt:78:9 Unresolved reference: parseHeaderValue
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/dsl/HttpPartBuilder.kt:78:58 Unresolved reference: it
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/dsl/HttpPartBuilder.kt:115:9 Unresolved reference: parseHeaderValue
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/dsl/HttpPartBuilder.kt:115:72 Unresolved reference: it
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/dsl/HttpPartBuilder.kt:169:9 Unresolved reference: parseHeaderValue
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/dsl/HttpPartBuilder.kt:169:71 Unresolved reference: it
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/dsl/HttpPartBuilder.kt:306:43 Unresolved reference: HeaderValue
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/dsl/HttpPartBuilder.kt:308:62 Unresolved reference: it
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/dsl/HttpPartBuilder.kt:308:73 Unresolved reference: it
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/model/MockHttpsProviderConfig.kt:68:25 Unresolved reference: ktor
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/model/MockProviderConfig.kt:7:11 Unresolved reference: ktor
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/model/MockProviderConfig.kt:61:28 Unresolved reference: hostname
e: file:///Users/edeandre/workspaces/IntelliJ/pact-jvm/consumer/src/main/kotlin/au/com/dius/pact/consumer/model/MockProviderConfig.kt:64:15 Unresolved reference: hostname
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':consumer:compileKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
> Compilation error. See log for more details
* 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
BUILD FAILED in 7s
32 actionable tasks: 1 executed, 31 up-to-date
|
This will only disregard the method if the annotation is present, but will not validate the condition. I.e., in the test, changing boolean shouldBeDisabled() {
false
} will still consider it disabled. |
Ooooh you are very right! I totally overlooked that! I'll take a look in the morning and see how to run the validation. I'm not too familiar with JUnit's API, so if you have any hints or pointers I'm open :) |
I don't know it that well either. I'm also looking at the JUnit 5 API to see if there is a way to use them correctly. |
The use case I'm trying to solve is if I have an |
I understand the need for this. Unfortunately, there is nothing in the Jupiter APIs to work with those annotations. I found where they are invoked, but it is in the Jupiter engine and not usable from the Pact extension. So there are two ways to achieve this:
|
Looks like the only way I can find to determine if a test was disabled would be to implement |
Support for more than just JUnit's
@Disabled
annotation...