-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Add GoLand configuration in hacking on gitea #16843
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
and prevents gitea from loading dynamic resources (eg: templates) in a development environment. | ||
|
||
To run unit tests with SQLite in GoLand, set `-tags sqlite,sqlite_unlock_notify` | ||
in `Go tool arguments` of `Run/Debug Configuration`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could GoLand be made to just call make test-backend
? I don't like having these tags in documentation as sooner or later, they will change and then this document will be outdated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In vscode I also have to add these tags.
The main benefit is that you can just get editor to run the test individually without having to run through the entire source code tree looking for the matching test name.
It's much much faster
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add that if you're debugging or otherwise running code you will need to set the appropriate build tags anyway. For example if you're debugging gogit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm yeah I guess i agree. Maybe we should at least reference that these default tags come from the Makefile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@silverwind Yes, GoLand can call make test-backend
, just add an entry in Run/Debug Configuration
. This guide can run a single unit test, which is very handy and efficient.
The `Output Directory` in `Run/Debug Configuration` MUST be set to the | ||
gitea project directory (which contains `main.go` and `go.mod`), | ||
otherwise, the started instance's working directory is a GoLand's temporary directory | ||
and prevents gitea from loading dynamic resources (eg: templates) in a development environment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah if that's the only problem then you could consider setting one of the custom_dir or other environment variables. But this sounds easier overall.
As discussed in
#develop
channel, GoLand users need a guide how to develop gitea.