Skip to content
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

[WIP] TypeClassResolutionTest for code snippets (2) #103

Closed
wants to merge 4 commits into from

Conversation

rachelcarmena
Copy link
Member

@rachelcarmena rachelcarmena commented Nov 11, 2019

Changes

This pull request would discard #57. That's the reason why it's a pull request on master branch.

It has 2 commits:

The test which was added by @jansorg to help me to debug the problems in #57 is passing now but I don't have knowledge enough to change testSyntheticResolution in the same way.

Details

Initial problems like:

 * What went wrong:
Execution failed for task ':testing-plugin:compileKotlin'.
> Compilation error. See log for more details

which appear in #57 have been solved.

The problem:

e: java.lang.ClassCastException: org.jetbrains.kotlin.idea.KotlinFileType 
cannot be cast to org.jetbrains.kotlin.com.intellij.openapi.fileTypes.FileType

was solved when relocating some classes:

relocate 'org.jetbrains.kotlin.com.intellij', 'com.intellij'

That's the reason why the source code was moved to another library to be able to relocate classes before using it in idea-plugin.

Then, the problem was:

e: java.lang.IllegalStateException: @NotNull method 
com/intellij/openapi/roots/ProjectFileIndex.getInstance must not return null

because the "environment" to compile source code is created in a MockProject when using CodeInsightFixtureTestCase and it's not possible to get an instance from a MockProject:

  @NotNull
  static ProjectFileIndex getInstance(@NotNull Project project) {
    return ServiceManager.getService(project, ProjectFileIndex.class);
  }

Source: com.intellij.openapi.roots.ProjectFileIndex com.jetbrains.ideaIC

Next steps

Try to fix the ignored test TypeClassResolutionTest from these changes and research the use of CodeInsightFixtureTestCase and its effects when running compilations.

This is the "trace" with the use of CodeInsightFixtureTestCase:

  1. Load Arrow Plugin (IDEA)
  2. Start a compilation
  3. Failure

This is the "trace" without that class and with a regular test:

  1. Start a compilation
  2. Load Arrow Plugin (IDEA)
  3. Compilation
  4. Success

Note

@jansorg , please, feel free to discard/close this pull request and to continue working on heavy-testing branch. I feel happy to know that I discovered the problem and some clues to continue working on it.

@i-walker
Copy link
Member

Hi @rachelcarmena could you direct this PR towardsja-heavy-testing, so that we have a better time reviewing and accomplishing the ticket, because compiling the Source code is one among other subsequent steps we still need to accomplish for that PR to work.

@rachelcarmena
Copy link
Member Author

Hi @rachelcarmena could you direct this PR towardsja-heavy-testing, so that we have a better time reviewing and accomplishing the ticket, because compiling the Source code is one among other subsequent steps we still need to accomplish for that PR to work.

Thanks @i-walker !! It's still WIP, thanks!!

@raulraja
Copy link
Member

heads up:
Screenshot 2019-11-12 at 01 03 33

@rachelcarmena
Copy link
Member Author

heads up:
Screenshot 2019-11-12 at 01 03 33

Thanks, solved!

@rachelcarmena rachelcarmena force-pushed the heavy-testing branch 2 times, most recently from adaacc4 to 7f7c778 Compare November 13, 2019 11:40
@rachelcarmena rachelcarmena marked this pull request as ready for review November 13, 2019 11:44
@rachelcarmena rachelcarmena force-pushed the heavy-testing branch 3 times, most recently from 2de902c to e50d131 Compare November 14, 2019 20:47
@rachelcarmena
Copy link
Member Author

@jansorg, I've added 2 more commits:

  • Solving conflicts with master branch
  • Add PreviousLightTestSyntax for keep it working with the new commits on master branch:

@rachelcarmena
Copy link
Member Author

Documentation was failing with the last merge because of removing:

compile project(':compiler-plugin')

from docs/build.gradle.

Reason: the new build.gradle for idea-plugin excludes Kotlin stdlib for all the dependencies:

exclude group: "org.jetbrains.kotlin", module: "kotlin-stdlib"

So it was solved adding Kotlin stdlib as dependency in docs/build.gradle.

@raulraja
Copy link
Member

Outdated

@raulraja raulraja closed this Dec 20, 2019
@rachelcarmena rachelcarmena deleted the heavy-testing branch January 7, 2020 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants