Skip to content

Commit

Permalink
added some initial configs and settings to run pytests in vscode
Browse files Browse the repository at this point in the history
  • Loading branch information
JJ-Author committed Oct 25, 2024
1 parent 57f5f2d commit 9b2d808
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 1 deletion.
14 changes: 13 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"type": "debugpy",
"request": "launch",
"name": "Launch Custom Proxy (manual virtual env selection)",
"name": "Run Time-Machine (manual virtual env selection)",
"program": "${workspaceFolder}/ontologytimemachine/custom_proxy.py",
"args": [
"--ontoFormat","ntriples",
Expand All @@ -15,6 +15,18 @@
"--port","8877"
]
},
{
"name": "Run pytest module (manual virtual env selection)",
"type": "debugpy",
"request": "launch",
"cwd": "${workspaceFolder}",
"module": "pytest",
"args": [
],
"console": "integratedTerminal",
// "preLaunchTask":"Wait for Poetry Run Time-Machine-Proxy",
"justMyCode": true,
},
{ //untested
"type": "debugpy",
"request": "launch",
Expand Down
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"python.testing.pytestArgs": [
"tests"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
}
49 changes: 49 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,55 @@
"kind": "build",
"isDefault": true
}
},
{
"label": "Wait for Poetry Run Time-Machine-Proxy",
"type": "shell",
"command": "poetry run python ontologytimemachine/custom_proxy.py",
"isBackground": true, // Runs the task in the background so VS Code can proceed to other tasks.
"problemMatcher": {
"pattern": [
{
"regexp": ".", // Matches any output line. Used to capture log lines for monitoring task progress.
"file": 1, // Placeholder; not capturing a specific file path here.
"location": 2, // Placeholder; not capturing specific location info (line/column).
"message": 3 // Placeholder; not capturing specific error messages.
}
],
"background": {
// "activeOnStart": true, // Marks the task as active immediately upon starting.
"beginsPattern": ".*Starting.*", // Detects the start of the task by matching "Starting proxy" in logs.
"endsPattern": ".*Loaded plugin __main__.OntologyTimeMachinePlugin.*" // Marks task readiness by matching "Loaded plugin" in logs.
}
},
"group": {
"kind": "test", // Groups the task as a test so it won’t interfere with build tasks.
"isDefault": false
},
"options": {
"shell": {
"executable": "/usr/bin/sh",
"args": [
"-c"
]
}
},
// "presentation": {
// "reveal": "never", // Hides the task’s terminal output
// "close": true // Closes the task automatically when tests complete
// }
},
{
"label": "Sleep for Time-Machine-Proxy startup",
"type": "shell",
"command": "sleep 5", // Adjust delay as needed
"dependsOn": [
"Poetry Run Time-Machine-Proxy"
],
"group": {
"kind": "test",
"isDefault": false
}
}
]
}

0 comments on commit 9b2d808

Please sign in to comment.