Commit Graph

1235 Commits

Author SHA1 Message Date
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 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 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 a03f346296 [Gradle, JS] Persist yarn lock by default
^KT-34014 fixed
^KT-49505 fixed
2021-11-03 09:53:51 +00: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 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 2adf19c2bb Move Gradle/Js tests into Js platform test tag.
^KT-45745 In Progress
2021-11-02 23:39:53 +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
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 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
Alexander Dudinsky f8dd1b3512 Fix Gradle Integration Tests MPP and Android on MacOS 2021-10-28 11:34:06 +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
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
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 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
Alexander Likhachev e9c8135dfa [Gradle] Add Gradle & task property to set compiler execution strategy
#KT-49299 Fixed
2021-10-22 09:57:54 +00:00
Alexander Likhachev 6a6cc1db77 [Gradle, JS] Add custom package json into configuration cache IT
#KT-49061 In Progress
2021-10-22 09:57:53 +00:00
Yahor Berdnikau 2b53965f11 Add tasks and annotations for Gradle/Jvm and Gradle/Js tests.
We will split our tests into supported platforms, like JVM, Js, etc...
Tests for supported Gradle features should be added per platform.

To run any test (except daemons) also "all" task was added.

^KT-45745 In Progress
2021-10-22 07:18:43 +00:00
Sergey Igushkin 8868738ac8 KT-48709: Fix CInterop configurations ambiguity with user variants
* Introduce a new org.gradle.usage value: kotlin-cinterop

* Add compatibility+disambiguation rules to ensure that kotlin-cinterop
  consumers can also fall back to ordinary (kotlin-api) published
  variants, but not vice versa

  * This ensures that ordinary kotlin-api consumers don't encounter
    equally-compatible candidates where one is the normal API elements
    and the other is C interop API elements

* Set org.gradle.usage = kotlin-cinterop in the C interop API elements
  configurations and dependency-consuming configurations

Issue #KT-48709
2021-10-21 10:17:52 +00:00
Sergey Igushkin a474e8a00b KT-49189: fix project(...) dependencies on MPP from pure-Java consumers
* Don't set the localToProject attribute anymore, as it prevents proper
  disambiguation if not set properly on all configurations, while all
  the intentionally-public configurations
  should already have the same value.

* Disambiguate o.j.k.platform.type Android vs JVM preferring JVM, as
  Android should have other attributes which make pure-Android consumers
  match the Android MPP variants.

* With Gradle 7.0+, set the attribute
  `org.gradle.api.attributes.java.TargetJvmEnvironment` on the JVM &
  Android elements configurations, which helps pure-Android consumers
  to match the Android, not JVM variants. This fixes KT-30961 for
  Gradle 7.0+ and AGP 7.0+

Issues: KT-49189, KT-30961
2021-10-21 10:17:52 +00:00
Yahor Berdnikau afb68d15d6 Migrate DeterministicBuildIT tests into new test dsl.
^KT-45745 In Progress
2021-10-15 15:04:24 +02:00
Yahor Berdnikau a487e91124 Migrate BuildCacheRelocationIT test to new test DSL.
^KT-45745 In Progress
2021-10-15 15:11:23 +03:00
Yahor Berdnikau 031c5f47d9 Populate default settings even when 'build.gradle' file is missing.
^KT-45745 In Progress
2021-10-15 15:11:22 +03:00
Svyatoslav Kuzmich 90dd0c6150 [JS] Fix and mute failed tests on TC 2021-10-13 01:26:27 +03:00
Yahor Berdnikau 4339671457 Migrate configuration cache tests to new test DSL.
^KT-45745 In Progress
2021-10-12 19:22:15 +03:00
Yahor Berdnikau 208422d2ec Populate settings also for buildSrc module.
^KT-45745 In Progress
2021-10-12 19:22:14 +03:00
Yahor Berdnikau 38849b7be4 Add helper to create temp directory.
This directory will be cleaned up on successful test, but will be left
on test error.

^KT-45745 In Progress
2021-10-12 19:22:13 +03:00
Yahor Berdnikau 6c747d33f7 Add Js and MPP plugins to default setup.
^KT-45745 In Progress
2021-10-12 19:22:12 +03:00
Yahor Berdnikau 9e21bda307 Also setup default settings values for 'settings.gradle.kts'.
^KT-45745 In Progress
2021-10-12 19:22:10 +03:00
Yahor Berdnikau 5d07eb77f2 Allow declaring @GradleTestVersions for the whole test suite.
^KT-45745 In Progress
2021-10-12 19:22:09 +03:00
Alexander Likhachev 5db4ec15d2 [Gradle, JS] Add test for KT-35640 2021-10-12 09:31:09 +00:00
Alexander Likhachev a0e6fb03f0 [Gradle] Do not register compilation outputs in clean task
Calculations of compilation outputs implicitly requires compile task configuration to execute `clean` task. This implicit configuration works unstable in parallel builds. We probably fine with the fact that outputs that are configured to be outside of build directory will not be cleaned by `clean` task
#KT-48046 Fixed
2021-10-12 09:29:57 +00:00
Viacheslav Kormushkin 57ce178bb3 Build with CocoaPods plugin fails if CONFIGRATION contains spaces
#KT-48771

Merge-request: KT-MR-4724
2021-10-11 12:03:51 +00:00
Andrey Uskov 4a99f04b41 Add simple test of KAPT working under JDK 16 2021-10-10 16:40:35 +03:00
Yahor Berdnikau 5d2739e6f0 Extract BuildOptions into separate file.
^KT-45745 In Progress
2021-10-07 14:55:57 +02:00
Yahor Berdnikau fc00d0dc18 Introduce GradleProject class.
This allows to split concepts of TestProject(whole build and options)
and actual Gradle project, which could be one of the main project
subprojects.

^KT-45745 In Progress
2021-10-07 14:55:57 +02:00
Yahor Berdnikau 82d947d3a4 Migrate ConfigurationAvoidanceIT tests into new DSL.
^KT-45745 In Progress
2021-10-07 12:41:08 +02:00
Yahor Berdnikau 2f87c28634 Better test setup for Android projects.
^KT-45745 In Progress
2021-10-07 12:41:03 +02:00
Viacheslav Kormushkin cd9d74b029 Generate podspec for XCFramework suitable for publishing
#KT-47812
#KT-47633
#KT-43815
#KT-42630
#KT-42105
#KT-48808

Merge-request: KT-MR-4483
2021-10-07 08:14:57 +00:00
Yahor Berdnikau e30b11fc05 Unify build cache debug approach.
^KT-45745 In Progress
2021-10-06 13:53:03 +02:00
Yahor Berdnikau 862d46f58b Enable publishing test build build-scan.
^KT-45745 In Progress
2021-10-06 13:53:03 +02:00