IdeaGinkgo / Intellij-Ginkgo

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

IllegalArgumentException when trying to debug ginkgo runconfig #76

Closed vmallet closed 1 year ago

vmallet commented 1 year ago

Ginkgo v0.8.0, IntelliJ 2023.3.1 Build #IU-223.8214.52 Tried to press "Debug" on an otherwise working run config for a test, got an IllegalArgumentException.

Stacktrace ``` java.lang.IllegalArgumentException: Argument for @NotNull parameter 'name' of com/intellij/openapi/util/io/FileUtil.sanitizeFileName must not be null at com.intellij.openapi.util.io.FileUtil.$$$reportNull$$$0(FileUtil.java) at com.intellij.openapi.util.io.FileUtil.sanitizeFileName(FileUtil.java) at com.github.idea.ginkgo.execution.testing.GinkgoBuildRunningState.getOutputFile(GinkgoBuildRunningState.java:99) at com.github.idea.ginkgo.execution.testing.GinkgoBuildRunningState.createBuildCommandLine(GinkgoBuildRunningState.java:145) at com.github.idea.ginkgo.execution.testing.GinkgoBuildRunningState.startBuildProcess(GinkgoBuildRunningState.java:69) at com.github.idea.ginkgo.execution.testing.GinkgoBuildRunningState.execute(GinkgoBuildRunningState.java:59) at com.github.idea.ginkgo.execution.GinkgoRunner$1.lambda$run$0(GinkgoRunner.java:84) at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:209) at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:21) at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:191) at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:813) at com.intellij.openapi.application.impl.ApplicationImpl$3.run(ApplicationImpl.java:429) at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:74) at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:114) at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:36) at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:779) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:730) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:724) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:749) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:909) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:756) at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$5(IdeEventQueue.java:437) at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:772) at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:436) at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:105) at com.intellij.ide.IdeEventQueue.performActivity(IdeEventQueue.java:615) at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:434) at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:813) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:480) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92) ```
TaylorOno commented 1 year ago

I can recreate this error by changing an All Test to a Focus Tests. Debuging a focus tests requires the package name which is only automatically set if you created a focused test from the gutter. I hope that matches your use case.

I'm going to update this to follow the pattern of standard go tests use and throw an exception in the run config if package is not set in a focused expression. I'll also need to update the run config form to make the package config visible.