test: add coverage for capabilities, rate-limiting, and upgrade modules#9
Draft
test: add coverage for capabilities, rate-limiting, and upgrade modules#9
Conversation
Add tests to verify new capabilities: - generatePodCapabilitiesPath: 3 dedicated unit tests - KNOWN_CAPABILITIES: 2 validation tests - loadCapabilities edge cases: 5 tests (malformed JSON, no teamRoot, agent-per-node mode) - loadRatePool: 4 tests (valid JSON, malformed, missing file, undefined teamRoot) - Upgrade semver helpers: 26 tests (parseVersion, compareVersions, isNewer, checkForUpdate, performUpgrade, upgradeSDK with pluggable fetcher/reader/writer) Agent-Logs-Url: https://github.com/sabbour/squad/sessions/c73355d4-c64c-43b9-98db-8528d78cc334 Co-authored-by: sabbour <103856+sabbour@users.noreply.github.com>
Agent-Logs-Url: https://github.com/sabbour/squad/sessions/c73355d4-c64c-43b9-98db-8528d78cc334 Co-authored-by: sabbour <103856+sabbour@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add tests to verify new capabilities
test: add coverage for capabilities, rate-limiting, and upgrade modules
Apr 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Several exported functions had zero test coverage:
generatePodCapabilitiesPath,KNOWN_CAPABILITIES,loadRatePool, and the entire upgrade semver/pluggable API surface.Capabilities (
test/capabilities.test.ts, +10 tests)generatePodCapabilitiesPath— path generation for pod-specific manifestsKNOWN_CAPABILITIES— validates exported constant (8 identifiers)loadCapabilitiesedge cases — malformed JSON, undefined teamRoot, no podId stamping in agent-per-node modeRate-limiting (
test/rate-limiting.test.ts, +4 tests)loadRatePool— valid/malformed JSON, missing file, undefined teamRootUpgrade semver & pluggable API (
test/cli/upgrade-semver.test.ts, 26 tests)parseVersion,compareVersions,isNewer— pure semver logiccheckForUpdate,performUpgrade,upgradeSDK— uses the existing pluggablesetVersionFetcher/setPackageJsonReader/setPackageJsonWriterhooks for isolated testing without mocksFull suite: 6322 passed, 2 pre-existing env failures (Playwright/Astro not installed).
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
aka.ms/usr/bin/../../opt/az/bin/python3 /usr/bin/../../opt/az/bin/python3 -Im azure.cli boards work-item type list --org REDACTED --project no-proj --output json postbuild(dns block)/usr/bin/../../opt/az/bin/python3 /usr/bin/../../opt/az/bin/python3 -Im azure.cli boards work-item type list --org REDACTED --project nonexistent-project --output json ite(sys.executable.encode('utf-8')); dev /usr/local/bin/bash(dns block)/usr/bin/../../opt/az/bin/python3 /usr/bin/../../opt/az/bin/python3 -Im azure.cli boards work-item type list --org REDACTED --project no-proj --output json --noprofile(dns block)app.aladdin.microsoft.com/usr/bin/../../opt/az/bin/python3 /usr/bin/../../opt/az/bin/python3 -Im azure.cli boards work-item type list --org REDACTED --project nonexistent-project --output json ite(sys.executable.encode('utf-8')); dev /usr/local/bin/bash(dns block)/usr/bin/../../opt/az/bin/python3 /usr/bin/../../opt/az/bin/python3 -Im azure.cli boards work-item type list --org REDACTED --project no-proj --output json postbuild(dns block)/usr/bin/../../opt/az/bin/python3 /usr/bin/../../opt/az/bin/python3 -Im azure.cli boards work-item type list --org REDACTED --project no-proj --output json --noprofile(dns block)azcliprod.blob.core.windows.net/usr/bin/../../opt/az/bin/python3 /usr/bin/../../opt/az/bin/python3 -Im azure.cli boards work-item type list --org REDACTED --project nonexistent-project --output json ite(sys.executable.encode('utf-8')); dev /usr/local/bin/bash(dns block)https://api.github.com/copilot_internal/user/home/REDACTED/work/squad/squad/node_modules/@github/copilot-linux-x64/copilot /home/REDACTED/work/squad/squad/node_modules/@github/copilot-linux-x64/copilot --acp k/_temp/ghcca-node/node/bin/git /usr/sbin/iptables js -t raw /home/REDACTED/work/node_modules/.bin/git PREROUTING -p tcp git remo�� get-url origin ndor/bin/git -i docker0 -j git(http block)/home/REDACTED/work/squad/squad/node_modules/@github/copilot-linux-x64/copilot /home/REDACTED/work/squad/squad/node_modules/@github/copilot-linux-x64/copilot --acp --stdio git remo�� get-url origin /usr/bin/docker --show-toplevel git /usr/bin/git docker --ve�� k/squad/squad/no--show-toplevel git de_modules/.bin/git o | grep "core igit git git grep(http block)/home/REDACTED/work/squad/squad/node_modules/@github/copilot-linux-x64/copilot /home/REDACTED/work/squad/squad/node_modules/@github/copilot-linux-x64/copilot --acp ode-gyp-bin/git git diff�� est-kbAJ2j --name-only /home/REDACTED/.dotnet/tools/git DASHBOARD__FRONTgit -e it git diff�� origin/dev...HEAD --name-only git get-url origin 1/x64/lib/node_m49e39fb90126f91201d2c51de94feca3e88d6851 git(http block)https://api.github.com/user/usr/bin/gh gh api user -q .login -state a091010655ee6a57ad3c07f9 1/x64/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin/git --detach --name-only -x64/copilot git upda�� refs/heads/squad-state 0ae6172dbe06cc875f68d3a7dcbadb845878cf1b ules/.bin/git cat /proc/cpuinfuniq git /bin/sh git(http block)/usr/bin/gh gh api user -q .login name "Test" 13441446d4ddafc17a44cad28b034cd29017d0a5 /opt/hostedtoolcache/node/24.14.1/x64/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/nnode refs/heads/nonexgrep 3f4a91de /usr/bin/uniq git log --format=%T -1 e_modules/.bin/git k/_temp/ghcca-nouniq git ndor/bin/git /bin/sh(http block)If you need me to access, download, or install something from one of these locations, you can either: