Files
Meshtastic-Android/main/en/developer/testing.html
T

33 lines
43 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html> <html lang="en-US"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=Edge"> <link rel="stylesheet" href="/Meshtastic-Android/main/assets/css/just-the-docs-default.css"> <link rel="stylesheet" href="/Meshtastic-Android/main/assets/css/just-the-docs-head-nav.css" id="jtd-head-nav-stylesheet"> <style id="jtd-nav-activation"> .site-nav > ul.nav-list:first-child > li > a, .site-nav > ul.nav-list:first-child > li > ul > li:not(:nth-child(7)) > a, .site-nav > ul.nav-list:first-child > li > ul > li > ul > li a { background-image: none; } .site-nav > ul.nav-list:not(:first-child) a, .site-nav li.external a { background-image: none; } .site-nav > ul.nav-list:first-child > li:nth-child(4) > ul > li:nth-child(7) > a { font-weight: 600; text-decoration: none; }.site-nav > ul.nav-list:first-child > li:nth-child(4) > button svg, .site-nav > ul.nav-list:first-child > li:nth-child(4) > ul > li:nth-child(7) > button svg { transform: rotate(-90deg); }.site-nav > ul.nav-list:first-child > li.nav-list-item:nth-child(4) > ul.nav-list, .site-nav > ul.nav-list:first-child > li.nav-list-item:nth-child(4) > ul.nav-list > li.nav-list-item:nth-child(7) > ul.nav-list { display: block; } </style> <script src="/Meshtastic-Android/main/assets/js/vendor/lunr.min.js"></script> <script src="/Meshtastic-Android/main/assets/js/just-the-docs.js"></script> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- Begin Jekyll SEO tag v2.9.0 --> <title>Testing | Meshtastic Android</title> <meta name="generator" content="Jekyll v4.4.1" /> <meta property="og:title" content="Testing" /> <meta property="og:locale" content="en_US" /> <meta name="description" content="Testing strategy for the Meshtastic KMP project — test categories, screenshot pipeline, baseline profiles, and CI integration." /> <meta name="twitter:description" property="og:description" content="Testing strategy for the Meshtastic KMP project — test categories, screenshot pipeline, baseline profiles, and CI integration." /> <link rel="canonical" href="/Meshtastic-Android/main/en/developer/testing.html" /> <meta property="og:url" content="/Meshtastic-Android/main/en/developer/testing.html" /> <meta property="og:site_name" content="Meshtastic Android" /> <meta property="og:type" content="website" /> <meta name="twitter:card" content="summary" /> <meta name="twitter:title" content="Testing" /> <script type="application/ld+json"> {"@context":"https://schema.org","@type":"WebPage","description":"Testing strategy for the Meshtastic KMP project — test categories, screenshot pipeline, baseline profiles, and CI integration.","headline":"Testing","url":"/Meshtastic-Android/main/en/developer/testing.html"}</script> <!-- End Jekyll SEO tag --> <!-- Inter font from Google Fonts --> <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet"> <style> /* M3-inspired typography */ :root { --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', ui-monospace, monospace; } body, .site-title, .search-input { font-family: var(--font-sans) !important; } code, pre, .highlight { font-family: var(--font-mono) !important; font-size: 0.875em; } /* M3 surface elevation & rounding */ .main-content table { border-radius: 12px; overflow: hidden; } .main-content blockquote { border-radius: 12px; padding: 1rem 1.25rem; border-left-width: 4px; } .main-content pre { border-radius: 12px; } .main-content code { border-radius: 6px; padding: 0.15em 0.4em; } /* Smooth transitions for theme switching */ body, .side-bar, .main, .main-content, .site-header, .search-input, .search-results, a { transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease; } /* Theme toggle button styling */ .theme-toggle { background: none; border: 1px solid var(--border-color, #D5D6E0); border-radius: 20px; padding: 6px 12px; cursor: pointer; font-family: var(--font-sans); font-size: 0.75rem; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; color: inherit; margin: 0 auto; transition: background-color 0.2s ease, border-color 0.2s ease; } .theme-toggle:hover { background-color: rgba(128, 128, 128, 0.1); } .theme-toggle-wrap { text-align: center; padding: 12px 0 4px; } /* Heading weight refinement */ h1, h2, h3, h4, h5, h6 { font-weight: 600; letter-spacing: -0.01em; } h1 { font-weight: 700; letter-spacing: -0.02em; } /* Smooth anchor scroll */ html { scroll-behavior: smooth; } /* Language switcher */ .language-switcher { display: inline-block; position: relative; margin-left: 8px; } .language-switcher-btn { cursor: pointer; font-size: 0.8rem; font-weight: 500; font-family: var(--font-sans); list-style: none; padding: 4px 10px; border: 1px solid var(--border-color, #D5D6E0); border-radius: 16px; display: inline-flex; align-items: center; gap: 4px; transition: background-color 0.2s ease; } .language-switcher-btn:hover { background-color: rgba(128, 128, 128, 0.1); } .language-switcher[open] .language-switcher-list { display: block; } .language-switcher-list { position: absolute; top: 100%; right: 0; left: auto; z-index: 100; list-style: none; padding: 8px 0; margin: 4px 0 0; min-width: 140px; background: var(--body-background-color, #fff); border: 1px solid var(--border-color, #D5D6E0); border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); } .language-switcher-list li { padding: 0; } .language-switcher-list a { display: block; padding: 6px 16px; text-decoration: none; font-size: 0.85rem; color: inherit; } .language-switcher-list a:hover { background-color: rgba(103, 234, 148, 0.15); } /* Version switcher (shares the language-switcher dropdown styling) */ .version-switcher { margin-left: 8px; } .version-switcher[hidden] { display: none; } /* Link out to the upstream meshtastic.org docs */ .upstream-docs-link { display: inline-flex; align-items: center; margin-left: 8px; padding: 4px 10px; border: 1px solid var(--border-color, #D5D6E0); border-radius: 16px; font-size: 0.8rem; font-weight: 500; font-family: var(--font-sans); text-decoration: none; color: inherit; transition: background-color 0.2s ease; } .upstream-docs-link:hover { background-color: rgba(128, 128, 128, 0.1); } </style> <script> // Respect OS preference on first visit, then remember user choice (function() { var stored = localStorage.getItem('jtd-theme'); if (stored) return; // will be applied by jtd.setTheme below if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) { localStorage.setItem('jtd-theme', 'meshtastic-dark'); } })(); </script> </head> <body> <a class="skip-to-main" href="#main-content">Skip to main content</a> <svg xmlns="http://www.w3.org/2000/svg" class="d-none"> <symbol id="svg-link" viewBox="0 0 24 24"> <title>Link</title> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-link"> <path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path> </svg> </symbol> <symbol id="svg-menu" viewBox="0 0 24 24"> <title>Menu</title> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-menu"> <line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="18" x2="21" y2="18"></line> </svg> </symbol> <symbol id="svg-arrow-right" viewBox="0 0 24 24"> <title>Expand</title> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-right"> <polyline points="9 18 15 12 9 6"></polyline> </svg> </symbol> <!-- Feather. MIT License: https://github.com/feathericons/feather/blob/master/LICENSE --> <symbol id="svg-external-link" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-external-link"> <title id="svg-external-link-title">(external link)</title> <path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1="10" y1="14" x2="21" y2="3"></line> </symbol> <symbol id="svg-doc" viewBox="0 0 24 24"> <title>Document</title> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-file"> <path d="M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"></path><polyline points="13 2 13 9 20 9"></polyline> </svg> </symbol> <symbol id="svg-search" viewBox="0 0 24 24"> <title>Search</title> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-search"> <circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line> </svg> </symbol> <!-- Bootstrap Icons. MIT License: https://github.com/twbs/icons/blob/main/LICENSE.md --> <symbol id="svg-copy" viewBox="0 0 16 16"> <title>Copy</title> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-clipboard" viewBox="0 0 16 16"> <path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z"/> <path d="M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z"/> </svg> </symbol> <symbol id="svg-copied" viewBox="0 0 16 16"> <title>Copied</title> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-clipboard-check-fill" viewBox="0 0 16 16"> <path d="M6.5 0A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3Zm3 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3Z"/> <path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1A2.5 2.5 0 0 1 9.5 5h-3A2.5 2.5 0 0 1 4 2.5v-1Zm6.854 7.354-3 3a.5.5 0 0 1-.708 0l-1.5-1.5a.5.5 0 0 1 .708-.708L7.5 10.793l2.646-2.647a.5.5 0 0 1 .708.708Z"/> </svg> </symbol> </svg> <header class="side-bar"> <div class="site-header"> <a href="/Meshtastic-Android/main/" class="site-title lh-tight"> Meshtastic Android </a> <button id="menu-button" class="site-button btn-reset" aria-label="Menu" aria-expanded="false"> <svg viewBox="0 0 24 24" class="icon" aria-hidden="true"><use xlink:href="#svg-menu"></use></svg> </button> </div> <nav aria-label="Main" id="site-nav" class="site-nav"> <ul class="nav-list"><li class="nav-list-item"><a href="/Meshtastic-Android/main/fr-rCA/" class="nav-list-link">Home</a></li><li class="nav-list-item"><a href="/Meshtastic-Android/main/en/" class="nav-list-link">Home</a></li><li class="nav-list-item"><button class="nav-list-expander btn-reset" aria-label="User Guide submenu" aria-expanded="false"> <svg viewBox="0 0 24 24" aria-hidden="true"><use xlink:href="#svg-arrow-right"></use></svg> </button><a href="/Meshtastic-Android/main/en/user.html" class="nav-list-link">User Guide</a><ul class="nav-list"><li class="nav-list-item"><a href="/Meshtastic-Android/main/fr-rCA/user/onboarding.html" class="nav-list-link">Getting Started</a></li><li class="nav-list-item"><a href="/Meshtastic-Android/main/en/user/onboarding.html" class="nav-list-link">Getting Started</a></li><li class="nav-list-item"><a href="/Meshtastic-Android/main/fr-rCA/user/connections.html" class="nav-list-link">Connexions</a></li><li class="nav-list-item"><a href="/Meshtastic-Android/main/en/user/connections.html" class="nav-list-link">Connections</a></li><li class="nav-list-item"><a href="/Meshtastic-Android/main/fr-rCA/user/messages-and-channels.html" class="nav-list-link">Messages & Channels</a></li><li class="nav-list-item"><a href="/Meshtastic-Android/main/en/user/messages-and-channels.html" class="nav-list-link">Messages & Channels</a></li><li class="nav-list-item"><a href="/Meshtastic-Android/main/fr-rCA/user/nodes.html" class="nav-list-link">Nœuds</a></li><li class="nav-list-item"><a href="/Meshtastic-Android/main/en/user/nodes.html" class="nav-list-link">Nodes</a></li><li class="nav-list-item"><a href="/Meshtastic-Android/main/fr-rCA/user/node-metrics.html" class="nav-list-link">Node Metrics</a></li><li class="nav-list-item"><a href="/Meshtastic-Android/main/en/user/node-metrics.html" class="nav-list-link">Node Metrics</a></li><li class="nav-list-item"><a href="/Meshtastic-Android/main/fr-rCA/user/map-and-waypoints.html" class="nav-list-link">Map & Waypoints</a></li><li class="nav-list-item"><a href="/Meshtastic-Android/main/en/user/map-and-waypoints.html" class="nav-list-link">Map & Waypoints</a></li><li class="nav-list-item"><a href="/Meshtastic-Android/main/fr-rCA/user/settings-radio-user.html" class="nav-list-link">Settings — Radio & User</a></li><li class="nav-list-item"><a href="/Meshtastic-Android/main/en/user/settings-radio-user.html" class="nav-list-link">Settings — Radio & User</a></li><li class="nav-list-item"><a href="/Meshtastic-Android/main/fr-rCA/user/settings-module-admin.html" class="nav-list-link">Settings — Modules & Admin</a></li><li class="nav-list-item"><a href="/Meshtastic-Android/main/en/user/settings-module-admin.html" class="nav-list-link">Settings — Modules & Admin</a></li><li class="nav-list-item"><a href="/Meshtastic-Android/main/fr-rCA/user/telemetry-and-sensors.html" class="nav-list-link">Telemetry & Sensors</a></li><li class="nav-list-item"><a href="/Meshtastic-Android/main/fr-rCA/user/tak.html" class="nav-list-link">TAK Integration</a></li><li class="nav-list-item"><a href="/Meshtastic-Android/main/en/user/tak.html" class="nav-list-link">TAK Integration</a></li><li class="nav-list-item"><a href="/Meshtastic-Android/main/fr-rCA/user/mqtt.html" class="nav-list-link">MQTT</a></li><li class="nav-list-item"><a href="/Meshtastic-Android/main/en/user/mqtt.html" class="nav-list-link">MQTT</a></li><li class="nav-list-item"><a href="/Meshtastic-Android/main/fr-rCA/user/discovery.html" class="nav-list-link">Découverte de maille locale</a></li><li class="nav-list-item"><a href="/Meshtastic-Android/main/en/user/discovery.html" class="nav-list-link">Local Mesh Discovery</a></li><li class="nav-list-item"><a href="/Meshtastic-Android/main/fr-rCA/user/firmware.html" class="nav-list-link">Firmware Updates</a></li><li class="nav-list-item"><a href="/Meshtastic-Android/main/en/user/firmware.html" class="nav-list-link">Firmware Updates</a></li><li class="nav-list-item"><a href="/Meshtastic-Android/main/fr-rCA/user/desktop.html" class="nav-list-link">Desktop App</a></li><li class="nav-list-item"><a href="/Meshtastic-Android/main/en/user/desktop.html" class="nav-list-link">Desktop App</a></li><li class="nav-list-item"><a href="/Meshtastic-Android/main/fr-rCA/user/signal-meter.html" class="nav-list-link">How the Meshtastic Signal Meter Works</a></li><li class="nav-list-item"><a href="/Meshtastic-Android/main/en/user/signal-meter.html" class="nav-list-link">How the Meshtastic Signal Meter Works</a></li><li class="nav-list-item"><a href="/Meshtastic-Android/main/fr-rCA/user/units-and-locale.html" class="nav-list-link">Units, Measurement & Locale</a></li><li class="nav-list-item"><a href="/Meshtastic-Android/main/en/user/units-and-locale.html" class="nav-list-link">Units, Measurement & Locale</a></li><li class="nav-list-item"><a href="/Meshtastic-Android/main/fr-rCA/user/translate.html" class="nav-list-link">Translate the App</a></li><li class="nav-list-item"><a href="/Meshtastic-Android/main/en/user/translate.html" class="nav-list-link">Translate the App</a></li><li class="nav-list-item"><a href="/Meshtastic-Android/main/en/user/app-functions.html" class="nav-list-link">App Functions</a></li><li class="nav-list-item"><a href="/Meshtastic-Android/main/en/user/widget.html" class="nav-list-link">Home Screen Widget</a></li><li class="nav-list-item"><a href="/Meshtastic-Android/main/en/user/help-and-docs.html" class="nav-list-link">Help & In-App Docs</a></li><li class="nav-list-item"><a href="/Meshtastic-Android/main/en/user/debug-logs.html" class="nav-list-link">Debug Logs</a></li></ul></li><li class="nav-list-item"><button class="nav-list-expander btn-reset" aria-label="Developer Guide submenu" aria-expanded="false"> <svg viewBox="0 0 24 24" aria-hidden="true"><use xlink:href="#svg-arrow-right"></use></svg> </button><a href="/Meshtastic-Android/main/en/developer.html" class="nav-list-link">Developer Guide</a><ul class="nav-list"><li class="nav-list-item"><a href="/Meshtastic-Android/main/en/developer/architecture.html" class="nav-list-link">Architecture</a></li><li class="nav-list-item"><a href="/Meshtastic-Android/main/en/developer/codebase.html" class="nav-list-link">Codebase</a></li><li class="nav-list-item"><a href="/Meshtastic-Android/main/en/developer/adding-a-feature-module.html" class="nav-list-link">Adding a Feature Module</a></li><li class="nav-list-item"><a href="/Meshtastic-Android/main/en/developer/navigation-and-deep-links.html" class="nav-list-link">Navigation & Deep Links</a></li><li class="nav-list-item"><a href="/Meshtastic-Android/main/en/developer/transport.html" class="nav-list-link">Transport</a></li><li class="nav-list-item"><a href="/Meshtastic-Android/main/en/developer/persistence.html" class="nav-list-link">Persistence</a></li><li class="nav-list-item"><a href="/Meshtastic-Android/main/en/developer/testing.html" class="nav-list-link">Testing</a></li><li class="nav-list-item"><a href="/Meshtastic-Android/main/en/developer/contributing.html" class="nav-list-link">Contributing</a></li><li class="nav-list-item"><a href="/Meshtastic-Android/main/en/developer/measurement.html" class="nav-list-link">Measurement & Formatting</a></li><li class="nav-list-item"><a href="/Meshtastic-Android/main/en/developer/test-builds.html" class="nav-list-link">Test Builds & Obtainium</a></li><li class="nav-list-item"><a href="/Meshtastic-Android/main/en/developer/documentation-style.html" class="nav-list-link">Documentation Style</a></li></ul></li></ul> </nav> <div class="d-md-block d-sm-none"> <div class="site-footer"> This site uses <a href="https://github.com/just-the-docs/just-the-docs">Just the Docs</a>, a documentation theme for Jekyll. </div> </div> </header> <div class="main" id="top"> <div id="main-header" class="main-header"> <div class="search" role="search"> <div class="search-input-wrap"> <input type="text" id="search-input" class="search-input" tabindex="0" placeholder="Search Meshtastic Android" autocomplete="off"> <label for="search-input" class="search-label"> <span class="sr-only">Search Meshtastic Android</span> <svg viewBox="0 0 24 24" class="search-icon" aria-hidden="true"><use xlink:href="#svg-search"></use></svg> </label> </div> <div id="search-results" class="search-results"></div> </div> <div class="theme-toggle-wrap"> <button class="theme-toggle" id="theme-toggle" aria-label="Toggle dark mode" title="Toggle light/dark theme" onclick="toggleMeshtasticTheme()"> <span id="theme-icon">🌙</span> <span id="theme-label">Dark</span> </button> <details class="language-switcher version-switcher" id="version-switcher" aria-label="Documentation version" hidden> <summary class="language-switcher-btn" title="Switch documentation version"> 🏷️ <span id="version-current"></span> </summary> <ul class="language-switcher-list" id="version-switcher-list"></ul> </details> <script> (function() { var baseurl = '/Meshtastic-Android/main'; var root = baseurl; var channel = 'latest'; // /main/, /vX.Y.Z/ or a prerelease snapshot like /v2.8.0-open.1/. var match = baseurl.match(/^(.*)\/(main|v\d+\.\d+\.\d+(?:-(?:open|closed)\.\d+)?)$/); if (match) { root = match[1]; channel = match[2]; } fetch(root + '/versions.json') .then(function(res) { return res.ok ? res.json() : Promise.reject(); }) .then(function(data) { var switcher = document.getElementById('version-switcher'); var list = document.getElementById('version-switcher-list'); var current = document.getElementById('version-current'); if (!switcher || !list || !current) return; // Keep the reader on the same page when switching channels; a page // that doesn't exist in the target version lands on the 404 page. var relativePath = location.pathname.slice(baseurl.length) + location.hash; var entries = []; if (data.latest) { entries.push({ id: 'latest', label: 'latest (v' + data.latest + ')', base: root }); } // Prereleases are documented ahead of general availability, so the track // is always spelled out — a reader must not mistake a closed-testing // snapshot for a shipped release. (data.prereleases || []).forEach(function(p) { entries.push({ id: p.dir, label: p.dir.replace(/^v/, 'v') + ' — ' + p.track + ' testing', base: root + '/' + p.dir }); }); if (data.hasMain) { entries.push({ id: 'main', label: 'main (unreleased snapshot)', base: root + '/main' }); } (data.versions || []).forEach(function(v) { entries.push({ id: 'v' + v, label: 'v' + v, base: root + '/v' + v }); }); var currentEntry = entries.filter(function(e) { return e.id === channel; })[0]; current.textContent = currentEntry ? currentEntry.label : channel; var others = entries.filter(function(e) { return e.id !== channel; }); if (others.length === 0) return; others.forEach(function(e) { var li = document.createElement('li'); var a = document.createElement('a'); a.href = e.base + relativePath; a.textContent = e.label; li.appendChild(a); list.appendChild(li); }); switcher.hidden = false; }) .catch(function() { /* no manifest (local build) — leave switcher hidden */ }); })(); </script> <a class="upstream-docs-link" href="https://meshtastic.org/docs/" title="Official Meshtastic documentation (meshtastic.org)">Meshtastic Docs ↗</a> </div> <script> function toggleMeshtasticTheme() { var current = localStorage.getItem('jtd-theme') || 'meshtastic'; var next = (current === 'meshtastic-dark') ? 'meshtastic' : 'meshtastic-dark'; if (typeof jtd !== 'undefined' && typeof jtd.setTheme === 'function') { jtd.setTheme(next); } localStorage.setItem('jtd-theme', next); var icon = document.getElementById('theme-icon'); var label = document.getElementById('theme-label'); if (icon && label) { icon.textContent = (next === 'meshtastic-dark') ? '☀️' : '🌙'; label.textContent = (next === 'meshtastic-dark') ? 'Light' : 'Dark'; } } // Apply stored/OS theme on page load (function() { var theme = localStorage.getItem('jtd-theme') || 'meshtastic'; // Sync toggle label immediately var icon = document.getElementById('theme-icon'); var label = document.getElementById('theme-label'); if (icon && label) { icon.textContent = (theme === 'meshtastic-dark') ? '☀️' : '🌙'; label.textContent = (theme === 'meshtastic-dark') ? 'Light' : 'Dark'; } // Apply theme once jtd is ready function tryApply() { if (typeof jtd !== 'undefined' && typeof jtd.setTheme === 'function') { jtd.setTheme(theme); } else { setTimeout(tryApply, 50); } } tryApply(); })(); </script> </div> <div class="main-content-wrap"> <nav aria-label="Breadcrumb" class="breadcrumb-nav"> <ol class="breadcrumb-nav-list"> <li class="breadcrumb-nav-list-item"><a href="/Meshtastic-Android/main/en/developer.html">Developer Guide</a></li> <li class="breadcrumb-nav-list-item"><span>Testing</span></li> </ol> </nav> <div id="main-content" class="main-content"> <main> <h1 id="testing"> <a href="#testing" class="anchor-heading" aria-labelledby="testing"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> Testing </h1> <p>Testing strategy and practices for the Meshtastic KMP project.</p> <h2 id="test-categories"> <a href="#test-categories" class="anchor-heading" aria-labelledby="test-categories"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> Test categories </h2> <h3 id="kmp-unit-tests-commontest"> <a href="#kmp-unit-tests-commontest" class="anchor-heading" aria-labelledby="kmp-unit-tests-commontest"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> KMP unit tests (<code class="language-plaintext highlighter-rouge">commonTest</code>) </h3> <p>Shared tests that run on all platforms:</p> <div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>./gradlew allTests
</code></pre></div></div> <ul> <li>Business logic tests</li> <li>Data model validation</li> <li>Search/ranking algorithm tests</li> <li>Route serialization tests</li> </ul> <h3 id="android-host-tests"> <a href="#android-host-tests" class="anchor-heading" aria-labelledby="android-host-tests"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> Android host tests </h3> <p>Android-specific tests that run on JVM:</p> <div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>./gradlew <span class="nb">test</span>
</code></pre></div></div> <ul> <li>ViewModel tests</li> <li>Repository tests with Room fakes</li> <li>Android-specific integration tests</li> </ul> <h3 id="compose-ui-tests"> <a href="#compose-ui-tests" class="anchor-heading" aria-labelledby="compose-ui-tests"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> Compose UI tests </h3> <p>Compose Multiplatform UI test framework:</p> <div class="language-kotlin highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nd">@Test</span>
<span class="k">fun</span> <span class="nf">myScreenTest</span><span class="p">()</span> <span class="p">=</span> <span class="nf">runComposeUiTest</span> <span class="p">{</span>
<span class="nf">setContent</span> <span class="p">{</span> <span class="nc">MyScreen</span><span class="p">()</span> <span class="p">}</span>
<span class="nf">onNodeWithText</span><span class="p">(</span><span class="s">"Expected"</span><span class="p">).</span><span class="nf">assertIsDisplayed</span><span class="p">()</span>
<span class="p">}</span>
</code></pre></div></div> <p>Located in <code class="language-plaintext highlighter-rouge">commonTest</code> or <code class="language-plaintext highlighter-rouge">jvmTest</code> source sets.</p> <h3 id="screenshot-tests"> <a href="#screenshot-tests" class="anchor-heading" aria-labelledby="screenshot-tests"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> Screenshot tests </h3> <p>Uses Android Gradle Plugin’s native (layoutlib) screenshot testing framework, split across two modules:</p> <ul> <li><strong>0</strong> — the <strong>visual-regression gate</strong>. CI runs <code class="language-plaintext highlighter-rouge">validateDebugScreenshotTest</code> on it; reframing one of these baselines is a real diff to review. Holds atomic, dual-purpose components.</li> <li><strong>0</strong> — <strong>generate-only</strong>, <em>not</em> validated in CI. Holds doc-framed compositions whose framing is tuned for the docs site, so reframing a doc image never churns the regression gate.</li> </ul> <div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>./gradlew :screenshot-tests:updateDebugScreenshotTest <span class="c"># record regression goldens</span>
./gradlew :screenshot-tests:validateDebugScreenshotTest <span class="c"># compare against goldens (CI gate)</span>
./gradlew :docs-screenshots:updateDebugScreenshotTest <span class="c"># record doc-framed composition images</span>
./gradlew :screenshot-tests:copyDocsScreenshots <span class="c"># copy doc images from BOTH modules into docs/assets</span>
</code></pre></div></div> <p>Rendering is host-deterministic here (layoutlib): a local <code class="language-plaintext highlighter-rouge">update</code> produces references byte-identical to CI, so locally-recorded goldens pass <code class="language-plaintext highlighter-rouge">validate</code>. See <code class="language-plaintext highlighter-rouge">docs/assets/screenshots/README.md</code> for which module a new screenshot belongs in.</p> <h4 id="marketing-screenshots"> <a href="#marketing-screenshots" class="anchor-heading" aria-labelledby="marketing-screenshots"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> Marketing screenshots </h4> <p>The store-listing screenshots (Play, F-Droid, IzzyOnDroid, and the desktop app’s Flathub listing) are generated too, by a third module: <strong>0</strong> is a plain JVM program, not a test. It renders the app’s own <code class="language-plaintext highlighter-rouge">commonMain</code> screens offscreen with Compose Desktop’s <code class="language-plaintext highlighter-rouge">ImageComposeScene</code> over one sample mesh and captures the real MapLibre map (basemap plus the app’s node chips) through maplibre-compose’s <code class="language-plaintext highlighter-rouge">MapSnapshotter</code>. Every shot is the raw screen, as <a href="https://support.google.com/googleplay/android-developer/answer/9866151">Play’s listing rules</a> require - no device frame, no caption banner - at one size per form factor. It has no tests, so <code class="language-plaintext highlighter-rouge">./gradlew test</code> never touches it, and CI never runs it. The one command:</p> <div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>./gradlew :marketing-screenshots:updateMarketingScreenshots
</code></pre></div></div> <p>That writes <code class="language-plaintext highlighter-rouge">1_messages.png</code> … <code class="language-plaintext highlighter-rouge">5_channels.png</code> into five folders under <code class="language-plaintext highlighter-rouge">fastlane/metadata/android/en-US/images/</code>, and <code class="language-plaintext highlighter-rouge">meshtastic-desktop-01-nodes.png</code> … <code class="language-plaintext highlighter-rouge">meshtastic-desktop-05-settings.png</code> into the Flathub folder, reproducibly - the screens are byte-identical between runs; a wide map can differ by a few antialiased label-edge pixels, see below:</p> <div class="table-wrapper"><table> <thead> <tr> <th>Folder</th> <th>Size</th> <th>Window</th> <th>Uploaded by</th> </tr> </thead> <tbody> <tr> <td><code class="language-plaintext highlighter-rouge">phoneScreenshots/</code></td> <td>1080×1920 @2.5x</td> <td>432×768 dp, compact: bottom navigation bar</td> <td><code class="language-plaintext highlighter-rouge">fastlane supply</code></td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge">sevenInchScreenshots/</code></td> <td>1080×1920 @1.8x</td> <td>600×1067 dp, medium: navigation rail, one pane</td> <td><code class="language-plaintext highlighter-rouge">fastlane supply</code></td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge">tenInchScreenshots/</code></td> <td>2560×1440 @2x</td> <td>1280×720 dp, expanded: rail, list beside detail</td> <td><code class="language-plaintext highlighter-rouge">fastlane supply</code></td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge">chromebookScreenshots/</code></td> <td>1920×1080 @1x</td> <td>expanded</td> <td>hand, in Play Console</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge">xrScreenshots/</code></td> <td>1920×1200 @1x (8:5)</td> <td>expanded</td> <td>hand, in Play Console</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge">desktopApp/packaging/linux/screenshots/</code></td> <td>1280×800 @1x (16:10)</td> <td>expanded: rail, list beside detail</td> <td>Flathub, through <code class="language-plaintext highlighter-rouge">metainfo.xml</code></td> </tr> </tbody> </table></div> <p>The screens are composed in the app’s own adaptive shell (<code class="language-plaintext highlighter-rouge">NavigationSuiteScaffold</code>, <code class="language-plaintext highlighter-rouge">ListDetailPaneScaffold</code>, <code class="language-plaintext highlighter-rouge">AdaptiveTwoPane</code>) with the same window-class calculations the app uses, so the form factors are data - a size, a density, a shot list and an output folder in <code class="language-plaintext highlighter-rouge">FormFactor.kt</code> - and every layout difference between them is the app’s own. Neither <code class="language-plaintext highlighter-rouge">fastlane supply</code> nor the Play Developer API has a Chromebook or XR slot, so those two folders are ignored by supply and F-Droid and uploaded by hand. The desktop set lists nodes, messages, map, connections and settings, the five <code class="language-plaintext highlighter-rouge">&lt;screenshot&gt;</code> entries in <code class="language-plaintext highlighter-rouge">desktopApp/packaging/linux/org.meshtastic.MeshtasticDesktop.metainfo.xml</code>, whose <code class="language-plaintext highlighter-rouge">&lt;image&gt;</code> URLs are <code class="language-plaintext highlighter-rouge">raw.githubusercontent.com</code> links pinned to a commit: regenerating it is two commits, first the PNGs (with the generator and doc changes that produced them), then the metainfo pointing its URLs at that first commit’s full SHA, because the URLs can’t name a commit that contains them. <strong>After the PR squash-merges, re-pin them to the merge commit</strong>: a squash leaves the branch commits out of <code class="language-plaintext highlighter-rouge">main</code>, and a deleted branch leaves the SHA they named unreferenced and eventually collectable, which would blank the Flathub listing. The basemap is the app’s default Liberty style, labels included. MapLibre packs glyphs into an atlas in tile-arrival order, so on the wide layouts a label’s antialiased edge can land one level off between generations - a dozen pixels, invisible; the generator captures from fresh runtimes until two agree and warns if they never do, and a regenerated wide map may not <code class="language-plaintext highlighter-rouge">cmp</code> the previous one. Commit whichever run produced it.</p> <p>Locales: <code class="language-plaintext highlighter-rouge">-PmarketingLocales=en-US,de-DE</code> renders each locale in turn after switching the JVM default locale, the same switch the desktop app makes, so the app’s strings, numbers and dates follow. Only <code class="language-plaintext highlighter-rouge">en-US</code> goes into <code class="language-plaintext highlighter-rouge">fastlane/</code> - everything there is read straight from git by F-Droid and IzzyOnDroid - and every other locale lands in <code class="language-plaintext highlighter-rouge">marketing-screenshots/build/marketing-screenshots/&lt;locale&gt;/images/</code> in the same layout, ready for a later <code class="language-plaintext highlighter-rouge">supply</code> run, with the desktop set beside it in <code class="language-plaintext highlighter-rouge">&lt;locale&gt;/desktop/</code>. The sample prose (the thread, the conversation previews, the framed variant’s captions) is in <code class="language-plaintext highlighter-rouge">marketing-screenshots/src/main/composeResources/values/strings.xml</code>, which <code class="language-plaintext highlighter-rouge">crowdin.yml</code>’s first rule already globs like every other <code class="language-plaintext highlighter-rouge">composeResources</code> strings file, so a translated conversation needs no configuration change; until Crowdin fills a locale’s <code class="language-plaintext highlighter-rouge">values-xx/strings.xml</code>, that locale’s chat text stays English while the UI around it is translated.</p> <p><code class="language-plaintext highlighter-rouge">-PmarketingFramed=true</code> also writes the framed 1242×2484 phone variants - bezel, drawn status bar and a caption banner - under <code class="language-plaintext highlighter-rouge">marketing-screenshots/build/marketing-screenshots/framed/&lt;locale&gt;/</code>, for the website and social posts. They never go into <code class="language-plaintext highlighter-rouge">fastlane/</code>.</p> <p>The map needs a Vulkan loader the JVM can find. On a stock Ubuntu nothing is required; in a Nix dev shell, which replaces <code class="language-plaintext highlighter-rouge">LD_LIBRARY_PATH</code> on entry, pass <code class="language-plaintext highlighter-rouge">-PmarketingLibraryPath=/usr/lib/x86_64-linux-gnu</code> (the system loader plus the GPU’s ICD). No display is needed or used.</p> <h3 id="baseline-profile--startup-performance"> <a href="#baseline-profile--startup-performance" class="anchor-heading" aria-labelledby="baseline-profile--startup-performance"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> Baseline Profile / startup performance </h3> <p>The <code class="language-plaintext highlighter-rouge">:baselineprofile</code> module (#5735) generates a <a href="https://developer.android.com/topic/performance/baselineprofiles/overview">Baseline Profile</a> for <code class="language-plaintext highlighter-rouge">:androidApp</code>, AOT-compiling the hot startup paths so ART doesn’t pay the JIT cost on first launch. It targets the <code class="language-plaintext highlighter-rouge">google</code> flavor (the variant most users run).</p> <p>The Macrobenchmark generator (<code class="language-plaintext highlighter-rouge">BaselineProfileGenerator</code>) and the before/after benchmark (<code class="language-plaintext highlighter-rouge">StartupBenchmark</code>) live in <code class="language-plaintext highlighter-rouge">baselineprofile/src/main/kotlin/org/meshtastic/baselineprofile/</code>. Both run on a device/emulator:</p> <div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>./gradlew :androidApp:generateGoogleReleaseBaselineProfile <span class="c"># Generate the profile (commit the output)</span>
./gradlew :androidApp:benchmarkGoogleReleaseBaselineProfile <span class="c"># Quantify the cold-start win</span>
</code></pre></div></div> <p>The generated profile is merged into <code class="language-plaintext highlighter-rouge">androidApp/src/googleRelease/generated/baselineProfiles/</code> and packaged into release builds via <code class="language-plaintext highlighter-rouge">androidx.profileinstaller</code>.</p> <blockquote> <p>ℹ️ <strong>Note:</strong> The journey covers cold start only (launch → first frame), because CI has no paired node. Post-connection screens (node list, map, message thread) aren’t yet AOT-compiled.</p> </blockquote> <p>Extending the journey past cold start needs a fake transport or a connected node wired into the harness.</p> <h2 id="test-organization"> <a href="#test-organization" class="anchor-heading" aria-labelledby="test-organization"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> Test organization </h2> <div class="language-text highlighter-rouge"><div class="highlight"><pre class="highlight"><code>feature/my-feature/src/
├── commonTest/kotlin/org/meshtastic/feature/myfeature/
│ ├── MyBusinessLogicTest.kt
│ └── MyModelTest.kt
└── jvmTest/kotlin/org/meshtastic/feature/myfeature/
└── MyDesktopSpecificTest.kt
</code></pre></div></div> <h2 id="testing-guidelines"> <a href="#testing-guidelines" class="anchor-heading" aria-labelledby="testing-guidelines"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> Testing guidelines </h2> <h3 id="do"> <a href="#do" class="anchor-heading" aria-labelledby="do"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> DO </h3> <ul> <li>Write tests in <code class="language-plaintext highlighter-rouge">commonTest</code> when possible (runs everywhere)</li> <li>Test business logic independently from UI</li> <li>Use fakes/stubs instead of mocks where practical</li> <li>Test edge cases: empty states, error states, boundary values</li> <li>Test deep link routing in <code class="language-plaintext highlighter-rouge">DeepLinkRouterTest</code></li> <li>Keep tests fast — no network, no disk I/O in unit tests</li> </ul> <h3 id="dont"> <a href="#dont" class="anchor-heading" aria-labelledby="dont"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> DON’T </h3> <ul> <li>Don’t test framework behavior (Compose internals, Room queries)</li> <li>Don’t create tests that depend on other feature modules</li> <li>Don’t use <code class="language-plaintext highlighter-rouge">Thread.sleep</code> — use coroutine test dispatchers</li> <li>Don’t rely on test execution order</li> </ul> <h2 id="running-tests"> <a href="#running-tests" class="anchor-heading" aria-labelledby="running-tests"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> Running tests </h2> <div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># All KMP tests</span>
./gradlew allTests
<span class="c"># Specific module</span>
./gradlew :feature:docs:allTests
<span class="c"># Code quality</span>
./gradlew spotlessCheck detekt
<span class="c"># Full verification</span>
./gradlew spotlessCheck detekt kmpSmokeCompile <span class="nb">test </span>allTests
</code></pre></div></div> <h2 id="ci-integration"> <a href="#ci-integration" class="anchor-heading" aria-labelledby="ci-integration"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> CI integration </h2> <p>Tests run automatically on:</p> <ul> <li>Pull request creation/update</li> <li>Push to <code class="language-plaintext highlighter-rouge">main</code></li> <li>Pre-release validation</li> </ul> <p>Single-runner jobs in <code class="language-plaintext highlighter-rouge">reusable-check.yml</code> run on <code class="language-plaintext highlighter-rouge">ubuntu-26.04</code> with JDK 25 and Gradle caching. Two jobs use a matrix: <code class="language-plaintext highlighter-rouge">test-shards</code> splits into <code class="language-plaintext highlighter-rouge">shard-core</code>, <code class="language-plaintext highlighter-rouge">shard-feature</code> and <code class="language-plaintext highlighter-rouge">shard-app</code>, and <code class="language-plaintext highlighter-rouge">build-desktop</code> runs across macOS, Windows and Linux, still pinned to <code class="language-plaintext highlighter-rouge">ubuntu-24.04</code>/<code class="language-plaintext highlighter-rouge">-arm</code>. Flatpak verification is its own workflow, not a job here. The ARM (<code class="language-plaintext highlighter-rouge">ubuntu-26.04-arm</code>) and container-backed <code class="language-plaintext highlighter-rouge">ubuntu-slim</code> runners carry the lightweight utility workflows — see <code class="language-plaintext highlighter-rouge">.skills/testing-ci/SKILL.md</code> for the four-tier rule, which still quotes the older labels.</p> </main> <hr> <footer> <footer class="site-footer"> Copyright &copy; 2026 Meshtastic LLC. Distributed under the <a href="https://www.gnu.org/licenses/gpl-3.0.html">GPL v3 License.</a> </footer> <div class="d-sm-block d-md-none"> <div class="mt-4 fs-2"> This site uses <a href="https://github.com/just-the-docs/just-the-docs">Just the Docs</a>, a documentation theme for Jekyll. </div> </div> </footer> </div> </div> <div class="search-overlay"></div> </div> </body> </html>