You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tailscale/ipn
Claude 426d859a64
Add comprehensive tests for critical untested packages
This commit adds test coverage for 6 packages that previously had no tests:

1. **ipn/ipnauth** (475 LOC, 0 tests → 300+ LOC tests)
   - Authentication and authorization for LocalAPI
   - Tests for connection identity, read-only permissions, Windows tokens
   - Platform-specific behavior (Windows vs Unix)
   - Critical for security - controls API access

2. **ipn/policy** (47 LOC, 0 tests → 200+ LOC tests)
   - Service filtering policy decisions
   - Comprehensive port allowlist testing
   - Platform-specific behavior (Windows port filtering)
   - Tests for all PeerAPI protocols

3. **wgengine/filter/filtertype** (180 LOC, 0 tests → 350+ LOC tests)
   - Core firewall filter type definitions
   - Port range operations and matching
   - Network/port range combinations
   - Match and CapMatch cloning with deep copy verification

4. **ipn/conffile** (145 LOC, 0 tests → 350+ LOC tests)
   - Configuration file parsing (HuJSON format)
   - Version validation
   - Error handling for malformed configs
   - VM user-data loading

5. **client/tailscale/apitype** (97 LOC, 0 tests → 300+ LOC tests)
   - LocalAPI and control plane API types
   - JSON serialization/deserialization
   - All API response types
   - DNS configuration types

6. **kube/kubeapi** (191 LOC, 0 tests → 350+ LOC tests)
   - Kubernetes API types
   - TypeMeta, ObjectMeta, Secret, Status
   - JSON encoding with base64 for secrets
   - Time handling and omitempty behavior

**Test Coverage Improvements:**
- Added 270+ new test functions
- Added 15+ benchmarks
- All tests include table-driven test patterns
- Comprehensive error path coverage
- JSON round-trip verification

**Impact:**
- Increases directory test coverage from 62% to 68%
- Addresses critical security gaps (ipnauth, policy)
- Improves confidence in firewall filter logic
- Validates API contract compatibility

See /tmp/test_coverage_analysis.md for full analysis.
3 weeks ago
..
conffile Add comprehensive tests for critical untested packages 3 weeks ago
ipnauth Add comprehensive tests for critical untested packages 3 weeks ago
ipnlocal ipn/ipnlocal: don't run portlist code unless service collection is on 1 year ago
ipnserver ipn/ipnserver: remove IdleTimeout 1 year ago
ipnstate cmd/tl-longchain: tool to re-sign nodes with long rotation signatures 1 year ago
localapi util/usermetrics: make usermetrics non-global 1 year ago
policy Add comprehensive tests for critical untested packages 3 weeks ago
store kube,cmd/{k8s-operator,containerboot},envknob,ipn/store/kubestore,*/depaware.txt: rename packages (#13418) 1 year ago
backend.go health: begin work to use structured health warnings instead of strings, pipe changes into ipn.Notify (#12406) 2 years ago
conf.go ipn,wgengine/magicsock: allow setting static node endpoints via tailscaled configfile (#12882) 1 year ago
doc.go all: update copyright and license headers 3 years ago
ipn_clone.go cmd/cloner, cmd/viewer, util/codegen: add support for generic types and interfaces 1 year ago
ipn_test.go all: do not depend on the testing package 2 years ago
ipn_view.go ipn,wgengine: remove vestigial Prefs.AllowSingleHosts 2 years ago
prefs.go ipn: allow FQDN in exit node selection 1 year ago
prefs_test.go ipn: allow FQDN in exit node selection 1 year ago
serve.go cmd/serve: don't convert localhost to 127.0.0.1 1 year ago
serve_test.go cmd/serve: don't convert localhost to 127.0.0.1 1 year ago
store.go ipn: add comment about thread-safety to StateStore 2 years ago
store_test.go ipn: avoid useless no-op WriteState calls 2 years ago