Skip to content

Commit

Permalink
build: Allow vscode to setup and use envtest
Browse files Browse the repository at this point in the history
  • Loading branch information
dlipovetsky committed Feb 8, 2023
1 parent 2ae779f commit 4202349
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ test/e2e/data/test-extension/deployment.yaml
*.iml

# VSCode
.vscode/
# Settings and tasks allow vscode to setup and use envtest for integration tests.
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
*.code-workspace

# kubeconfigs
Expand Down
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"go.testEnvFile": "${workspaceFolder}/.vscode/test.env"
}
29 changes: 29 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"tasks": [
{
"type": "shell",
"problemMatcher": [],
"label": "Prepare vscode to run envtest-based tests",
"group": {
"kind": "test",
"isDefault": true
},
"command": [
"make setup-envtest"
],
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared",
"showReuseMessage": true,
"clear": false
},
"runOptions": {
// NOTE: To automatically run this task whenever you open
// the workspace folder, uncomment the following line.
// "runOn": "folderOpen"
},
}
]
}

0 comments on commit 4202349

Please sign in to comment.