Unfortunately, IJ API requires us to return instances of
PsiClass/PsiMethod in order to proceed with run configuration creation.
In fact, those instances will be queried only by trivial requests, like
containingFile or name. Therefore, full-blown LightClasses are not
needed and even harmful, because for some declarations we can not build
proper light classes (like for expect declarations, for example)
Previously it mostly worked because most of declarations in common
indeed have corresponding Light-instances (because common source-set can
be seen from Java through JVM-part of a project).
^KT-34503 Fixed
This allows us to check two things:
- presence of line markers (haven't been checked by old
GradleTestRunConfigurationTests, though could've been checked by
LineMarkerTests)
- some properties of run configurations which will be created from those
line markers
Old GradleTestRunConfigurationTest have been renamed to
GradleTestRunConfigurationCustomTest and slightly modified to be able
to re-use the same testdata if necessary.
Previously, GradleDaemonAnalyzer reused common IJ infrastructure for
highlighting tests (see DaemonAnalyzerTеstCase, ExpectedHighlightingData
and such).
Unfortunately, this infrastructure had several flaws,
mainly around checking expected highlighting against actual one:
- overlapping line markers lead to crash (fixed in 193+)
- no way to sanitize descriptions of line markers (important for cases
where description returns HTML-formatted text, which makes testdata
completely unreadable and also drives parser insane)
- thrown FileNotFoundException doesn't have a physical file with
expected testdata attached, which makes browsing diff a little less
convenient (no way to apply changes to expected file)
- no easy way to plug-in with additional after-highlighting checks
This commit fixes it by overriding doCheckResult and providing custom
checking of highlighting/line markers, based on TagsTestDataUtil.
Because we don't rely on IJ-checking anymore, we also remove weird hoops
with removing/adding testdata markup in checkFiles.
Also this commit adds strings sanitization in TagsTestDataUtil, removing HTML-tags
and line breaks, so that description of tag is always one-liner with
plain text.
Added metrics and their anonymization rules added. Persisted gradle
statistical information will not contain any sensitive information.
#KT-33404 Fixed
The build performance information is collected during the build
when the Kotlin Gradle plugin is applied. Only hashed values are
saved if they may contain sensitive information. Numeric metrics
obtained on the basis of user's project are saved with random seed.
Persisted information is saved in gradleUserHomeDir.
#KT-33404 Fixed