IDE Integration
We don’t require or recommend any specific IDE to develop for K8up. Here’s just some documentation to help you setting-up K8up in some specific IDEs that are in use by the K8up developers.
JetBrains GoLand
You can basically just open the root directory in GoLand and you’ll be mostly ready. Just in order to run the integration tests you will need to do some extra configuration:
-
Before you can run an integration test from GoLand, you need to run
make integration-test
. -
Then try to run a specific integration test. You must either run the tests of a single directory or file – or run a specific test method. The execution will fail at first – that’s expected.
-
Now go to Run – Edit Configurations… and find the automatically created run configuration for the test.
-
Edit the Working directory: field. Set it to the same directory as the integration test lies which you want to test.
-
Edit the Go tools arguments: field. It should contain
-tags=integration
.
Now try to re-run the test. It should now succeed. You will see test results in your IDE and be able to use the integrated debugger as well.
Remember that you need to re-run |
If you’re in doubt about your configuration, check whether |
Visual Studio Code
Example VSCode run configuration:
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/main.go",
"env": {
"BACKUP_IMAGE": "quay.io/vshn/wrestic:latest",
"BACKUP_GLOBALS3ENDPOINT": "http://somewhere.example.org",
"BACKUP_GLOBALS3BUCKET": "somebucket",
"BACKUP_GLOBALSECRETACCESSKEY": "replacewithaccesskey",
"BACKUP_GLOBALACCESSKEYID": "replacewithkeyid",
"BACKUP_GLOBALREPOPASSWORD": "somepassword"
},
"args": []
}
]
}
json