IdeaGinkgo / Intellij-Ginkgo

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

Debug option is disabled when running kubebuilder envtests written using ginkgo on Darwin ARM64 #60

Open unmarshall opened 2 years ago

unmarshall commented 2 years ago

Hello,

Setup GOOS = darwin GOARCH = arm64 Ginkgo version: v1.16.4 controller-runtime v0.10.2 IDE: Goland version 2022.2.1

I have setup KUBEBUILDER_ASSETS as an environment variable in the run/debug configuration. The value is used by executing: setup-envtest --arch=amd64 use --use-env -p path 1.22.

Issue I am able to run the ginkgo tests from withing the IDE using this plugin but debug option has been disabled. This is not the case when we use vscode but i think this is an issue with this plugin where it just disallows debug. I have also ensured that the code is kept under $GOPATH/src (which ideally should not be required after go modules). Nothing seems to help.

TaylorOno commented 2 years ago

I'll see if I can fix this. I suspect this is a problem with how go tests determines the module to build

The run tests leverage the ginkgo cli.

The debug function is using go test and I think the nature of the project structure confuses go test when it trys to compile an external testing module

unmarshall commented 2 years ago

Thanks for accepting to fix this. I tried the same with standard go test along with kubebuilder envtest and debug option was enabled and was working as expected.

TaylorOno commented 2 years ago

When you are having trouble debugging is the does it get disable in the package level run option? image In this case controllers?

unmarshall commented 1 year ago

Apologies for the delay in responding. Yes, the debug option is disabled everywhere. This is typically seen when running controller tests that use envtest.

TaylorOno commented 1 year ago

The package level debug should go through the standard go flow unrelated my plugin. There seems to be something going on where intellij can't find any debug runners. I'll continue investigating.

unmarshall commented 1 year ago

Any updates? A fix would be of immense help.

TaylorOno commented 1 year ago

I have not been able to recreate this at all. I also don't have access to an m1 mac.

If you have the ability clone this repo and debug the only think I can think is happening is for some reason debug isn't enabled as an execute action but that's something that happens outside the scope of the plugin.

You could put a break point here. https://github.com/IdeaGinkgo/Intellij-Ginkgo/blob/f38fc2eb820b231177ca5d74d86aaba256e8141f/src/main/java/com/github/idea/ginkgo/GinkgoRunLineMarkerProvider.java#L53 Or here https://github.com/IdeaGinkgo/Intellij-Ginkgo/blob/f38fc2eb820b231177ca5d74d86aaba256e8141f/src/main/java/com/github/idea/ginkgo/execution/GinkgoRunner.java#L54