From 4a42af45d776de17ced5516dce5229dd9b0a4cc2 Mon Sep 17 00:00:00 2001 From: mib1185 Date: Fri, 30 Jul 2021 11:51:51 +0000 Subject: [PATCH 1/2] Add vscode task code coverage --- .vscode/tasks.json | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 24d643b96bc3b..56d261f55a394 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -60,6 +60,21 @@ }, "problemMatcher": [] }, + { + "label": "Code Coverage", + "detail": "Generate code coverage report for given component.", + "type": "shell", + "command": "pytest ./tests/components/${input:componentName}/ --cov=homeassistant.components.${input:componentName} --cov-report term-missing", + "group": { + "kind": "test", + "isDefault": true + }, + "presentation": { + "reveal": "always", + "panel": "new" + }, + "problemMatcher": [] + }, { "label": "Generate Requirements", "type": "shell", @@ -102,5 +117,12 @@ }, "problemMatcher": [] } + ], + "inputs": [ + { + "id": "componentName", + "type": "promptString", + "description": "For which component should the task run?" + } ] } From c846806e0f6561d333920d460a0945a825a7dc11 Mon Sep 17 00:00:00 2001 From: Michael <35783820+mib1185@users.noreply.github.com> Date: Thu, 5 Aug 2021 11:39:55 +0200 Subject: [PATCH 2/2] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Joakim Sørensen --- .vscode/tasks.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 56d261f55a394..5488c3472de64 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -62,9 +62,9 @@ }, { "label": "Code Coverage", - "detail": "Generate code coverage report for given component.", + "detail": "Generate code coverage report for a given integration.", "type": "shell", - "command": "pytest ./tests/components/${input:componentName}/ --cov=homeassistant.components.${input:componentName} --cov-report term-missing", + "command": "pytest ./tests/components/${input:integrationName}/ --cov=homeassistant.components.${input:integrationName} --cov-report term-missing", "group": { "kind": "test", "isDefault": true @@ -120,9 +120,9 @@ ], "inputs": [ { - "id": "componentName", + "id": "integrationName", "type": "promptString", - "description": "For which component should the task run?" + "description": "For which integration should the task run?" } ] }