-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Integration test project #3307
Integration test project #3307
Conversation
Don't know the specifics here, so no idea if I'm saying something useful, and if I'm not, just disregard this. Maybe a cleaner approach would be to create a source-set in the |
@@ -0,0 +1,9 @@ | |||
import kotlinx.coroutines.* | |||
|
|||
suspend fun doWorld() = coroutineScope { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add it as @Test
, so this code will be ran as well
@dkhalanskyjb it is possible to do so, but such an approach may be not robust enough -- it's easy to have some dependency slipped into subproject via all our Taking it into account, could you please also take a look at this PR? |
Pros of having a separate subproject:
Cons:
Another consideration is that this problem is not limited to the coroutines library. For example, we encountered a similar issue with the datetime, where the project itself behaved just fine, but projects using it, but not the serialization plugin, did not. Maybe this is a sign that we need a more general solution for this issue, like the ability to have subprojects that run the Kotlin compiler only with the stock arguments, which would allow us to have all the pros without any of the cons. Do we maybe have such an ability already? If so, we should employ that. If not, let's at least reduce the complexity of the file structure. I see these solutions:
|
I am not sure about stock arguments and "some default behaviour". At the end of the day, every project, whether its coroutines, datetime or serialization itself, has its own constraints. What we are basically doing here is a tailored integration test, incorporated into the same repository for the sake of simplicity. And especially I don't think it's worth relying on Gradle which is on its own complex enough and have enough moving parts to have a loophole to let any non-trivial mistake slip in. In my experience, almost every plugin or non-trivial configuration in our Gradle breaks, and breaks more often than it is reasonably expected to.
I would prefer to stick to this approach, @mvicsokolova could you please change the PR accordingly? Also, please note that there is no |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.
In general, sure, but they all need a way to be used from an out-of-the-box Kotlin project with only minimal configuration.
Looking at the gradle configuration, I don't see anything tailored. On the contrary, it looks like it just came out from the project creation wizard.
I don't have enough knowledge about how the Kotlin gradle plugins work, but I expect us to control most of that, probably except the dependency resolution. Likewise, all the compiler-argument-changing behavior is surely not implemented by calling |
Also, my continuing the discussion is not a sign that I'm against us going forward with the current solution. We do need to publish something quickly, and the maintenance burden is not high, so a more clean solution can wait. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rebase on top of develop
, so that git is not confused.
dependsOn(project(':kotlinx-coroutines-debug').shadowJar) | ||
jvmArgs ('-javaagent:' + project(':kotlinx-coroutines-debug').shadowJar.outputs.files.getFiles()[0]) | ||
def coroutinesDebugJar = sourceSet.runtimeClasspath.filter {it.name == "kotlinx-coroutines-debug-${coroutines_version}.jar" }.singleFile | ||
jvmArgs ('-javaagent:' + coroutinesDebugJar) | ||
testClassesDirs = sourceSet.output.classesDirs | ||
classpath = sourceSet.runtimeClasspath | ||
systemProperties project.properties.subMap(["overwrite.probes"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now, that's an issue.
This flag control the functionality in integration-testing/src/debugAgentTest/kotlin/PrecompiledDebugProbesTest.kt
that allows us to replace DebugProbesKt.bin
, a file in the repository, with a new version. I'm sure this functionality is now broken. We should either fix this or adapt in some other way. @qwwdfsad, do we still need -Poverwrite.probes
? Does anyone rely but us on this, or can we provide a more fitting interface? Also, is the comment below still relevant (from the file with the test)?
ensure that classfile has major version equal to 50 (Java 6 compliance)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment is indeed redundant.
We should either fix this or adapt in some other way
Right. @mvicsokolova please ensure that ./gradlew debugAgentTest -Poverwrite.probes=true
properly works. For now it fails with FileNotFoundException
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from that, ./gradlew publishToMavenLocal
+ cd integration-testing
+ ./gradlew debugAgentTest
fails locally at PrecompiledDebugProbesTest
. It shouldn't be be the case, please investigate
3dcca74
to
d8bc9e4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dkhalanskyjb could you please take a look if general Gradle project structure looks good to you?
dependsOn(project(':kotlinx-coroutines-debug').shadowJar) | ||
jvmArgs ('-javaagent:' + project(':kotlinx-coroutines-debug').shadowJar.outputs.files.getFiles()[0]) | ||
def coroutinesDebugJar = sourceSet.runtimeClasspath.filter {it.name == "kotlinx-coroutines-debug-${coroutines_version}.jar" }.singleFile | ||
jvmArgs ('-javaagent:' + coroutinesDebugJar) | ||
testClassesDirs = sourceSet.output.classesDirs | ||
classpath = sourceSet.runtimeClasspath | ||
systemProperties project.properties.subMap(["overwrite.probes"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment is indeed redundant.
We should either fix this or adapt in some other way
Right. @mvicsokolova please ensure that ./gradlew debugAgentTest -Poverwrite.probes=true
properly works. For now it fails with FileNotFoundException
dependsOn(project(':kotlinx-coroutines-debug').shadowJar) | ||
jvmArgs ('-javaagent:' + project(':kotlinx-coroutines-debug').shadowJar.outputs.files.getFiles()[0]) | ||
def coroutinesDebugJar = sourceSet.runtimeClasspath.filter {it.name == "kotlinx-coroutines-debug-${coroutines_version}.jar" }.singleFile | ||
jvmArgs ('-javaagent:' + coroutinesDebugJar) | ||
testClassesDirs = sourceSet.output.classesDirs | ||
classpath = sourceSet.runtimeClasspath | ||
systemProperties project.properties.subMap(["overwrite.probes"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from that, ./gradlew publishToMavenLocal
+ cd integration-testing
+ ./gradlew debugAgentTest
fails locally at PrecompiledDebugProbesTest
. It shouldn't be be the case, please investigate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, Maria and I discussed the structure already, I don't think we can do much better than that here.
integration-testing/src/debugAgentTest/kotlin/PrecompiledDebugProbesTest.kt
Outdated
Show resolved
Hide resolved
integration-testing/src/debugAgentTest/kotlin/PrecompiledDebugProbesTest.kt
Outdated
Show resolved
Hide resolved
Co-authored-by: dkhalanskyjb <52952525+dkhalanskyjb@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, integration-testing/README.md
is now inaccurate.
Updated the README 🙂 |
Test for Kotlin#3305 Co-authored-by: Vsevolod Tolstopyatov <qwwdfsad@gmail.com> Co-authored-by: dkhalanskyjb <52952525+dkhalanskyjb@users.noreply.github.com>
No description provided.