[KT-84822] add directive and skipper for tests whenever Java depends on Kotlin#5890
[KT-84822] add directive and skipper for tests whenever Java depends on Kotlin#5890
Conversation
Code Owners
|
… depends on java Restore unchanged tests, remove ignore backend on test that has java depends on
7438e38 to
9542ad8
Compare
… depends on java Add missing tests where java depends on kotlin
|
Keeping it as a draft to prioritize jetbrains reviewing of #5892 |
|
Not sure about the added value of an extra directive here. You are just replacing a directive by another one. That being said, what is the purpose to have Java code depending on Kotlin for ixText test ? That does not change the produced IR right ? |
|
@jDramaix With the IGNORE directive. I only need a way to filter them out, |
Not yet ready for review, just want your input on this decision @demiurg906 |
|
Based on my understanding, JKlibIrTextTest is designed to verify the generated Kotlin IR against 'golden' files. Since Java code depending on Kotlin shouldn't alter the generated Kotlin IR, these tests should conceptually pass regardless of the Java compilation state. What is the specific cause of the failures when running these tests in the jklib environment? |
Yes, but in our current setup, before running any tests We compile the java code separately with javac, to pass it as a dependency. Without any kotlin on it this compilation fails. We could silently fail it and not include the java dependencies and see if the compilation delivers IR results. That would require changes to the current setup which we can do if we see value in that. |
|
What does Kotlin/JVM do ? How do they decide if Java compilation result needs to be a dependency or Kotlin code needs to be a dependency ? |
|
There is a
It's decided based on which module the java file belongs. In the same module kotlin code is always getting compiled first, so inside one module we analyze java sources as sources. If java files are declared in the dependency module, then the compiler consumes the compiled |
|
That definetely works @demiurg906 thanks! |
… depends on java Change custom JAVA_DEPENDS_ON_KOTLIN for standard SKIP directive
Problem
Currently we target all
TARGET_BACKEND: JVM tests for jklib
Some of these are fully incompatible,
Jklib uses dependency jars of java source for compiling kotlin source and cannot have kotlin depending on java.
Currently we use
IGNORE_BACKEND: JKLIB
for almost all tests from JVM that fail
This is not quite correct when using gradle
as these don't show in the skipped count
and these are executed in the background checking if they can be unmuted
Solution
Adding a directive
// JAVA_DEPENDS_ON_KOTLIN
documents the reason they are being skipped
and allows the JKLIB test suite to ignore these without adding
TARGET_BACKEND: JKLIB to all old and new JVM tests
Unrelated changes
Removing
in tests with