IdeaGinkgo / Intellij-Ginkgo

Idea plugin for running and viewing ginkgo tests
GNU General Public License v3.0
34 stars 13 forks source link

Setting additional options does not work #45

Closed zostay closed 2 years ago

zostay commented 2 years ago

I would like to only run a subset of packages in my test. However, if I try to set those by adding options or add any command-line at all, it appears that they get sent to ginkgo as a single string.

For example, setting the following in the test configuration's Ginkgo additional options:

--fail-fast --randomize-all pkg/ install/ test/bugs/

and then running results in the following error message followed by the ginkgo usage message:

/Users/sterling/go/bin/ginkgo -v "--fail-fast --randomize-all pkg/ install/ test/bugs/" -r
ginkgo run failed
  flag provided but not defined: -fail-fast --randomize-all pkg/ install/ test/bugs/

Those extra options just need to be processed as command-line options and split up.

zostay commented 2 years ago

I can identify the code that has the bug, but I don't know enough about the IntelliJ plugin SDK to know how best fix it. But basically, the code here:

https://github.com/IdeaGinkgo/Intellij-Ginkgo/blob/3929387fd86b5e526463156b74e15f33c3a0871d/src/main/java/com/github/idea/ginkgo/execution/testing/GinkgoRunningState.java#L190,L225

Needs to be modified so that each:

commandList.add(runOptions.getGinkgoAdditionalOptions());

becomes something more like:

for (String option : splitOptions(runOptions.getGinkgoAdditionalOptions())) {
    commandList.add(option)
}

The current solution only works if there's a single option in that configuration field.

TaylorOno commented 2 years ago

Thank you for doing the leg work I should be able to release a fix for this shortly

TaylorOno commented 2 years ago

This should be fixed in 0.5

zostay commented 2 years ago

Confirmed, though, there's a new bug with it.