Potential documentation issue with developer guide -> setup
okkhoy opened this issue ยท 12 comments
OS: Ubuntu Linux 14.04
JDK: 1.8.0_144
IntelliJ: Community edition
To reproduce:
- Follow Step 11 for setting up the project.
- Run configuration:
- Tests still fail:
- Notice that when we select "Run all tests" a new configuration is created by IntelliJ
- Selecting "All in test" configuration passes the tests:
EDIT:
Inserted the correct image for run configuration
I wonder if this is a better way to set the working directory for testing. @yamgent any ideas?
I wonder if this is a better way to set the working directory for testing. @yamgent any ideas?
I couldn't get that to work. The test cases still fail when I set the project as Test Sources Root (also tried Test Resources Root, didn't work either).
However, I found better alternative to our current solution in the dev guide. Our current solution only modifies the working directory for one configuration, so if a new configuration is spawned (which is what is happening with this issue when you press Run All Test
), then the settings are different again.
The better solution would be to just modify the Defaults\JUnit
configuration's working directory instead, so that new configurations created will inherit the values from the default configuration and use the correct working directory.
I tested it out and it works. Also, the Defaults
here only affects the default settings for the current project, not all projects that IntelliJ is handling, in case you are worried about that.
However, I found better alternative to our current solution in the dev guide.
Nice. ๐ PR when you can.
The better solution would be to just modify the Defaults\JUnit configuration's working directory instead, so that new configurations created will inherit the values from the default configuration and use the correct working directory.
On MacOS, this results in a new test config being generated everytime a test is run.
However if I run the config directly with Run>Run 'All in test'
from the menu bar rather than right-clicking the 'test' folder and selecting Run 'All Tests'
it does not generate additional configs
More students are facing this issue. Shall we update the instructions? @yamgent @Zhiyuan-Amos Might be applicable to level3 as well.
On MacOS, this results in a new test config being generated everytime a test is run.
@yamgent this issue isn't resolved yet. It's ok that we don't resolve (cos nothing breaks), but it's still an issue. :/
On MacOS, this results in a new test config being generated everytime a test is run.
I think it's the same in Windows. But now, it shouldn't matter because all test configurations inherit the default JUnit settings?
I think it's the same in Windows. But now, it shouldn't matter because all test configurations inherit the default JUnit settings?
Yup it doesn't matter, just that it's still an unintended behaviour. I tried searching up for solutions but can't find any (I think I'm not that good at configuring stuffs haha). Shall I record this as an issue?
Shall I record this as an issue?
What's the issue? My understanding is that it is no longer an issue because having multiple configurations doesn't affect the dev's work.
On MacOS, this results in a new test config being generated everytime a test is run.
This problem had always happened in all of my Java projects in IntelliJ in the past (and even till today). Regardless of whether you change any configuration settings, sometimes a new config will get generated anyway.
I don't see a need for further intervention on our side atm as a result.