Commit Graph

9781 Commits

Author SHA1 Message Date
Igor Laevsky 22c161bcee [Wasm] Run unit tests for the wasm stdlib (fail on verifier for now) 2021-11-03 16:23:02 +03:00
Igor Laevsky 36d9001d54 [Wasm] Teach gradle plugin to run wasm unit tests for nodejs and Mocha 2021-11-03 16:23:02 +03:00
Igor Laevsky 46b56c7642 [Wasm] Improve string constructor in stdlib 2021-11-03 16:23:01 +03:00
Igor Laevsky cb10bd3a95 [Wasm] Port stdlib and kotlin.test build to wasm gradle plugin 2021-11-03 16:23:01 +03:00
Yahor Berdnikau 5a11446c79 Migrate KotlinDaemonIT tests to new test dsl.
^KT-45745 In Progress
2021-11-03 13:34:52 +01:00
Yahor Berdnikau a6436adc17 Add KGPDaemonsBaseTest class as test base for daemons test.
This class will stop Gradle and Kotlin daemons after each test
execution.

^KT-45745 In Progress
2021-11-03 13:34:48 +01:00
Ilya Goncharov 540419a5d7 [Gradle, JS] Do not force dukat in separate dukat task
^KT-34014 fixed
^KT-49505 fixed
2021-11-03 09:53:54 +00:00
Ilya Goncharov 9c4aa8fe84 [Gradle, JS] Fix unit test after changes of test infrastructure 2021-11-03 09:53:54 +00:00
Ilya Goncharov 99f686af39 [Gradle, JS] Fix according to recently Gradle test ifrastructure changes
^KT-34014 fixed
^KT-49505 fixed
2021-11-03 09:53:53 +00:00
Ilya Goncharov ce57826ed3 [Gradle, JS] Configure requires NPM dependencies inside rootPackageJson
^KT-34014 fixed
^KT-49505 fixed
2021-11-03 09:53:53 +00:00
Ilya Goncharov 4bf6e6d722 [Gradle, JS] Use node_modules dir existence as marker of up-to-date
^KT-34014 fixed
^KT-49505 fixed
2021-11-03 09:53:52 +00:00
Ilya Goncharov 21249a1dcb [Gradle, JS] Use separate task class for good configuration caching
^KT-34014 fixed
^KT-49505 fixed
2021-11-03 09:53:52 +00:00
Ilya Goncharov 4caa3ad562 [Gradle, JS] Configure tasks in after evaluate block
^KT-34014 fixed
^KT-49505 fixed
2021-11-03 09:53:52 +00:00
Ilya Goncharov e496c638ad [Gradle, JS] Ignore scripts by default
^KT-34014 fixed
^KT-49505 fixed
2021-11-03 09:53:51 +00:00
Ilya Goncharov a03f346296 [Gradle, JS] Persist yarn lock by default
^KT-34014 fixed
^KT-49505 fixed
2021-11-03 09:53:51 +00:00
Ilya Goncharov c34884b0b6 [Gradle, JS] Update Node.JS onto 16.13.0 and Yarn onto 1.22.17
^KT-49530 fixed
2021-11-03 11:33:24 +03:00
Yahor Berdnikau 21d208341e Move few kapt tests into daemon tests.
This tests does assertion that require having fresh Gradle daemon.

^KT-45745 In Progress
2021-11-03 08:59:35 +01:00
Yahor Berdnikau 8991c78ae6 Migrate only Kapt tests to new test dsl.
^KT-45745 In Progress
2021-11-03 08:59:35 +01:00
Yahor Berdnikau 550287105a Add additional file assertions.
File does not exist, file exists in the tree, file does not exist in
the tree.

^KT-45745 In Progress
2021-11-03 08:59:35 +01:00
Yahor Berdnikau a5ff409c11 Also provide for tests JDK 1.8 as a parameter.
^KT-45745 In Progress
2021-11-03 08:59:35 +01:00
Yahor Berdnikau adbf075a68 Add method to include other test project as module.
^KT-45745 In Progress
2021-11-03 08:59:35 +01:00
Yahor Berdnikau 7cda2e9859 Add 'testResolveAllConfigurations' assertion for new test DSL.
^KT-45745 In Progress
2021-11-03 08:59:35 +01:00
Yahor Berdnikau 5989e0936f Add helper methods to find all Kotlin or Java source files.
^KT-45745 In Progress
2021-11-03 08:59:35 +01:00
Yahor Berdnikau 7583d4d74e Add KGP tests task dependency on sample annotation processor install.
Kapt tests expected it to be available in maven local.

^KT-45745 In Progress
2021-11-03 08:59:31 +01:00
Yahor Berdnikau 2adf19c2bb Move Gradle/Js tests into Js platform test tag.
^KT-45745 In Progress
2021-11-02 23:39:53 +01:00
konstantin.tskhovrebov b0c34e217b FatFrameworkTask: Fix dSYM extension check. 2021-11-02 21:08:16 +00:00
Ivan Gavrilovic 0ee4e386be KGP - Fix flaky tests invoking javac through JDK APIs
Tests invoking javac APIs were flaky because ClasspathAnalyzerTest
was using Gradle's ProjectBuilder, which appends tools.jar to
the system class loader. Other tests do not do that, and they
invoke javac APIs directly.

In some executions, this causes some javac classes to be loaded
from the system class loader (the one patched by Gradle), while
some of them will be loaded by UrlClassLoader which points to tools.jar
in java.home. Having javac classes from different class loaders causes
java.lang.IllegalAccessError as package private access across class loaders
is not allowed. https://bugs.openjdk.java.net/browse/JDK-8068152 has more
information on this issue.

This change fixes the issue by fully removing usage of ProjectBuilder.

Test: ClasspathAnalyzerTest
2021-11-02 18:03:34 +01:00
Ivan Gavrilovic 4d208b529d Kotlin Gradle plugin - Remove assertions from integration tests
This is because AGP 3.4 and 3.6 have version of R8 that is unable
to handle kotlin-stdlib 1.6+. Issue https://issuetracker.google.com/148661132
has more details on this.

Instead of adding logic to remove assertions based on the AGP version,
this change fully removes them to keep things simple. Also, running with
assertions enabled may be too much for the integration tests.
2021-11-02 17:53:30 +01:00
Yahor Berdnikau a29dfb3b48 Disable finalizing by 'cleanTestKitDir' for 'kgpDaemonTests' task.
Seems jna dependency file descriptor is leaking on Windows agents,
leading to '.testKitDir' directory remove error.
2021-11-02 15:13:26 +01:00
Konstantin Tskhovrebov a9f850dac0 Refactor FatFrameworkTask: use FrameworkDescriptor instead Framework.
for independence from module compilation.
2021-11-02 06:18:25 +00:00
Sergey Igushkin 05822c59b5 Fix Android Lint dependency resolution issues (KT-49483)
Android Gradle plugin resolves the *Classpath configurations in an
artifact view with an artifactType attribute set, which should
give a resolved variant with a different `org.gradle.category`
attribute. With `org.gradle.category=library` set by the Kotlin
Gradle plugin, that couldn't work.

To fix this, don't set the `org.gradle.category` attribute on the
Android resolvable configurations.

TODO: Add integration tests!
2021-11-01 14:57:50 +00:00
Yahor Berdnikau d7ae7ca911 Ensure all test tasks is finalized by 'cleanTestKitCacheTask' on CI.
^KT-45745 In Progress
2021-10-29 17:34:00 +02:00
Yahor Berdnikau c25d243111 Add 'kgpOtherTests' task.
This will run tests for all support plugins, such kapt, allopen, etc...

^KT-45745 In Progress
2021-10-29 17:34:00 +02:00
Svyatoslav Kuzmich 5b10396f48 [stdlib] Test that modification of the array returned by toCharArray() doesn't affect the original string 2021-10-28 15:49:00 +00:00
Svyatoslav Kuzmich 766377a041 [Wasm] Remove WasmForeign annotation
No longer needed since external interfaces are supported
2021-10-28 18:47:38 +03:00
Alexander Dudinsky f8dd1b3512 Fix Gradle Integration Tests MPP and Android on MacOS 2021-10-28 11:34:06 +03:00
Mikhail Glukhikh 8bd0b237b7 Convert EXPOSED_PROPERTY_TYPE_IN_CONSTRUCTOR into deprecation error
#KT-28078 Fixed
2021-10-27 19:43:01 +03:00
Ivan Gavrilovic 3e1cf77f54 Kotlin Gradle Plugin integration tests - ensure Android sdk...
... licenses are accepted before running the test build.
2021-10-27 16:41:51 +03:00
Dmitriy Novozhilov f26059a7d3 [FE] Add clear warning about future changes about nullability of safe call with non nullable receiver
^KT-46860
2021-10-27 16:28:37 +03:00
Nikolay Krasko 36c4938172 Add version to kotlin-reflect-stripped jar 2021-10-27 11:04:41 +03:00
Nikolay Krasko d348efa4c1 Do not pack proguard and stripped jars for kotlin-reflect into compiler zip
kotlin-reflect-proguard.jar has different timestamps and shows
difference on each build for the same sources.

The problem was introduced after migrating to Gradle 7.1 where
`libsDir` parameter was removed (https://docs.gradle.org/current/userguide/upgrading_version_6.html#removal_of_basepluginconvention_libsdir_and_basepluginconvention_distsdir).
After that the same variable started to be resolved to `dist` directory.
So this commit reverts the old behaviour.

^KTI-672 Fixed
2021-10-27 11:04:40 +03:00
Alexander Likhachev 2f19ff008f [Gradle] Migrate Kotlin/JS tests to the new test DSL
#KT-45745 In Progress
2021-10-26 20:21:15 +03:00
Starlight220 e77f72071d migrate KmValueParameter.type (KmType? -> lateinit KmType) 2021-10-26 18:21:38 +02:00
Ilya Gorbunov 4e6243c4f7 Restore useIR Gradle option as HIDDEN (KT-45504)
This will allow to KEEP binary compatibility with
the Compose plugin 1.0.1 for a bit longer

Merge-request: KT-MR-4857
2021-10-26 15:37:31 +00:00
Yahor Berdnikau 98791000bf Add @GradleWithJdkTest annotation.
Adding this annotation to the test will provide requested JDKs + Gradle
versions matrix as test parameter.

It is also possible to filter out supported by Gradle version JDKs.

^KT-45745 In Progress
2021-10-26 11:50:18 +00:00
Yahor Berdnikau ca3e1b18dc Add all supported Gradle versions.
^KT-45745 In Progress
2021-10-26 11:50:17 +00:00
nataliya.valtman eec4ac644c KT-49159 Transform KotlinGradleBuildService to BuildService 2021-10-26 09:56:15 +00:00
Anton Lakotka dbe134e8b2 [Gradle] KT-48818 Fix mpp13XFlagsSetByPlugin setter
Use mpp13XFlagsSetByPlugin to prevent false-positive "GranularMetadataTrueHasNoEffect" warning

#KT-48818 Fixed
2021-10-25 08:05:26 +00:00
Anton Lakotka 1057f24a69 [Gradle] KT-48818 Add tests for subprojects
Reuse already existing function to assert that
build log does not contain certain sub-strings
2021-10-25 08:05:26 +00:00
Anton Lakotka cb103dae75 [Gradle] Don't show false positive warning about old hmpp flags
When HMPP is enabled by default it is still printing warnings about
enableDependencyPropagation and enableGranularSourceSetsMetadata flags

#KT-48818 Fixed
2021-10-25 08:05:25 +00:00