Skip to content

Instantly share code, notes, and snippets.

@jfrancoa
Created April 19, 2022 13:39
Show Gist options
  • Save jfrancoa/50a3d6326e946c621a5e1965857dcbce to your computer and use it in GitHub Desktop.
Save jfrancoa/50a3d6326e946c621a5e1965857dcbce to your computer and use it in GitHub Desktop.
Launch and Tasks file to debug Ginkgo openshift-private-tests in VS Code
{
// REQUIRES EXTENSION: "Command Variable" (https://marketplace.visualstudio.com/items?itemName=rioj7.command-variable)
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Debug Ginkgo test",
"type": "go",
"preLaunchTask": "Get test name",
"postDebugTask": "Remove test name file",
"request": "launch",
"mode": "auto",
"env": {
"KUBECONFIG": "${env:HOME}/kubeconfigs/kubeconfig"
},
"program": "${workspaceFolder}/cmd/extended-platform-tests",
"args": [
"run-test",
"${input:testNameFormatted}",
],
//"showLog": true,
//"trace": "verbose",
}
],
"inputs": [
{
"id": "testNameFormatted",
"type": "command",
"command": "extension.commandvariable.transform",
"args": {
"text": "${command:fileContent}",
// Remove return carriage and quotest from test
"find": "[\n\"]",
"flags": "g",
"replace": "",
"command": {
"fileContent": {
"command": "extension.commandvariable.file.content",
"args": {"fileName": "${workspaceFolder}/tests.txt"}
}
}
}
}
]
}
{
"version": "2.0.0",
"tasks": [
{
"label": "Get test name",
"type": "shell",
"command": "${workspaceFolder}/bin/extended-platform-tests run all --dry-run | grep ${input:testId} > ${workspaceFolder}/tests.txt",
"options": {
"env": {
"KUBECONFIG": "${env:HOME}/kubeconfigs/kubeconfig"
}
}
},
{
"label": "Remove test name file",
"type": "shell",
"command": "rm ${workspaceFolder}/tests.txt",
}
],
"inputs": [
{
"id": "testId",
"type": "promptString",
"description": "Test case ID (Should match only one test case)",
"default": "Smoke"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment