mirror of
https://github.com/jpawlowski/hass.tibber_prices.git
synced 2026-03-30 05:13:40 +00:00
1 line
No EOL
3.6 KiB
JavaScript
1 line
No EOL
3.6 KiB
JavaScript
"use strict";(globalThis.webpackChunkdocs_split_developer=globalThis.webpackChunkdocs_split_developer||[]).push([[1133],{3504:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>o,contentTitle:()=>a,default:()=>h,frontMatter:()=>r,metadata:()=>i,toc:()=>d});const i=JSON.parse('{"id":"testing","title":"Testing","description":"Note: This guide is under construction.","source":"@site/docs/testing.md","sourceDirName":".","slug":"/testing","permalink":"/hass.tibber_prices/developer/testing","draft":false,"unlisted":false,"editUrl":"https://github.com/jpawlowski/hass.tibber_prices/tree/main/docs/developer/docs/testing.md","tags":[],"version":"current","lastUpdatedAt":1764985026000,"frontMatter":{},"sidebar":"tutorialSidebar","previous":{"title":"Release Notes Generation","permalink":"/hass.tibber_prices/developer/release-management"}}');var t=s(4848),l=s(8453);const r={},a="Testing",o={},d=[{value:"Integration Validation",id:"integration-validation",level:2},{value:"Running Tests",id:"running-tests",level:2},{value:"Manual Testing",id:"manual-testing",level:2},{value:"Test Guidelines",id:"test-guidelines",level:2}];function c(e){const n={blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,l.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.header,{children:(0,t.jsx)(n.h1,{id:"testing",children:"Testing"})}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"Note:"})," This guide is under construction."]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"integration-validation",children:"Integration Validation"}),"\n",(0,t.jsx)(n.p,{children:"Before running tests or committing changes, validate the integration structure:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"# Run local validation (JSON syntax, Python syntax, required files)\n./scripts/release/hassfest\n"})}),"\n",(0,t.jsx)(n.p,{children:"This lightweight script checks:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["\u2713 ",(0,t.jsx)(n.code,{children:"config_flow.py"})," exists"]}),"\n",(0,t.jsxs)(n.li,{children:["\u2713 ",(0,t.jsx)(n.code,{children:"manifest.json"})," is valid JSON with required fields"]}),"\n",(0,t.jsx)(n.li,{children:"\u2713 Translation files have valid JSON syntax"}),"\n",(0,t.jsx)(n.li,{children:"\u2713 All Python files compile without syntax errors"}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"Note:"})," Full hassfest validation runs in GitHub Actions on push."]}),"\n",(0,t.jsx)(n.h2,{id:"running-tests",children:"Running Tests"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"# Run all tests\npytest tests/\n\n# Run specific test file\npytest tests/test_coordinator.py\n\n# Run with coverage\npytest --cov=custom_components.tibber_prices tests/\n"})}),"\n",(0,t.jsx)(n.h2,{id:"manual-testing",children:"Manual Testing"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"# Start development environment\n./scripts/develop\n"})}),"\n",(0,t.jsx)(n.p,{children:"Then test in Home Assistant UI:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"Configuration flow"}),"\n",(0,t.jsx)(n.li,{children:"Sensor states and attributes"}),"\n",(0,t.jsx)(n.li,{children:"Services"}),"\n",(0,t.jsx)(n.li,{children:"Translation strings"}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"test-guidelines",children:"Test Guidelines"}),"\n",(0,t.jsx)(n.p,{children:"Coming soon..."})]})}function h(e={}){const{wrapper:n}={...(0,l.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(c,{...e})}):c(e)}}}]); |