-
Notifications
You must be signed in to change notification settings - Fork 114
Cannot run Spark 3 tests in IntelliJ IDEA #440
Comments
Thanks @andrei-ionescu for reporting this. @clee704 Could you take a look when you get a chance? It's crucial to get this running in IntelliJ since most of us use it for development/debugging. |
There is another nuisance: after setting the project according to @imback82's #434 (comment), whenever I close the IDE everything needs to set once more. I need to remove once more the |
Are you sure that the |
I'm looking into the issue. As a workaround, you can use the built-in sbt shell and type
Another workaround is right click the file, then click "Modify Run Configuration...", check "Use sbt" in the dialog, and click "OK" to close the dialog. The test will be run with sbt even if you use built-in buttons and commands. After a successful run with sbt, you can uncheck "Use sbt" and run the test without sbt, if you want. Strangely this worked for me. Also, it might help: don't forget to set "Project SDK" and "Project language level" to Java 8, as well as "Module SDK" for each module. |
@clee704, @imback82, @sezruby, @rapoth I think more time has to be invested to make it easier for developers to contribute to the project. Getting back to the issues discussed here...
After multiple days of trying out different things, the only way I found I can debug tests from IntelliJ IDEA was by:
Now that the project got a little bit complex with this support for multiple Spark versions, it is required to have some docs on how to develop (compile, run, debug, execute tests, test debugging, etc) in some of the most wide-spread IDEs. |
I tried today to get back to the "Nested fields" support in Hyperspace but I cannot get the tests green. I hava a test that seems to fail on a specific Spark version.
|
You should be able to use the sbt shell to run and debug a specific test. Set the project to |
I've tried for several hours to make IntelliJ work with our sbt build but it just didn't work however I tried. I even removed symlinks and copied the source directory for each subproject (which is mapped to a module in IntelliJ), but it did not solve the test issue (it did solve other issues - without symlinks, you don't have to manually remove the Since there is a workaround - using the sbt shell - and it doesn't prevent you from developing Hyperspace with IntelliJ as long as you know how to use sbt, I'd like to close this issue as won't fix. Contributors should be familiar with sbt, as Hyperspace is mostly written in Scala and sbt is the de-facto standard build tool for Scala. Personally, I didn't have difficulty debugging in IntelliJ with the sbt shell. If you need further help please let me know. Or if you can come up with a better build that works well with IntelliJ, it would be awesome. I'll be really happy if one can make a multi-project sbt build that works well with IntelliJ, as I'm kind of disappointed with IntelliJ regarding sbt support. By the way, I've found one thing that might make things easier for IntelliJ. In the sbt window, try ignoring the |
Please, don't close this issue. Or if you close it please create another ticket for the creation of the documentation explaining the way to develop on Hyperspace and IntelliJ IDEA (is should contain the way to debug a test - some screenshots would be great also). It is not the common way of developing and because of that it should be documented. Not helping the community and letting them bang their heads for hours (or even days) to be able to debug a test it will make the community of developers grow up in reluctance against this project. If it helps, I can share my way of debugging, which I found by trying out different approaches. |
As I said already, if you use the sbt shell in IntelliJ, everything works fine, including debugging with breakpoints. It's been only two months since I started developing in Scala so it should be easy for anyone developing in Scala. I'll update the README. |
@clee704 In my case is NOT working - even if I use the sbt shell inside IntelliJ. When I add breakpoints an run the test from sbt shell it does NOT stop to the break points. If it works for you it doesn't mean it works for every one. The only way to make it work was to run sbt shell in terminal with debug ports open, then connect from IntelliJ IDEA with a remote debug configuration, then run the tests from the terminal sbt shell. There are multiple problems - development-wise - that are now present in the project and those problems are a nuisance for the community. For example, every time I close IntelliJ IDEA, I have to go through the process of removing I my have different options in IntelliJ than the ones you have and that needs also to be documented. @imback82, @sezruby, @rapoth: For me, right now, after the support of Spark 3 has been added, it is a pain to develop in Hyperspace project. What can be done to make it better? How can I help? |
I just realized that I omitted crucial information for debugging in IntelliJ. You should set
in the sbt shell. This is because with I acknowledge that the current situation is not the best. If you have any idea to improve IntelliJ experience, please share with us or make a PR. |
Describe the issue
I get the following error when trying to run the
E2EHyperspaceRulesTest
tests:To Reproduce
To setup Hyperspace project in IntelliJ IDEA I followed steps provided by @imback82 in #434 (comment).
src/main/scala
andsrc/main/scala-spark3
as sources.src/test/scala
andsrc/test/scala-spark3
as test sources.src/test/resources
as test resources.sbt clean compile
.E2EHyperspaceRulesTest
file and choseRun 'E2EHyperspaceRulesTest'...
Expected behaviour
E2EHyperspaceRulesTest
to run successfully.Environment
The text was updated successfully, but these errors were encountered: