Skip to content

fix: replace panic with error, fix device targeting, add tests - #2

Merged
taigrr merged 1 commit into
masterfrom
cd/tests-quality-fixes
Mar 15, 2026
Merged

taigrr merged 1 commit into
masterfrom
cd/tests-quality-fixes

Conversation

@taigrr

@taigrr taigrr commented Mar 14, 2026

Copy link
Copy Markdown
Owner

Changes

Bug Fixes

  • execute() no longer panics when adb is not found — returns ErrNotInstalled instead
  • Pull() was checking the wrong path — checked src (device-side) instead of dest (local) for existence
  • Push, Pull, Reboot, Root now pass -s serial for correct multi-device targeting
  • Root() parses stdout to determine actual success instead of always returning true
  • Shell() removed redundant variable redeclaration (:= → direct return)

Improvements

  • Use sync.Once for lazy adb path lookup instead of init()
  • Add ErrDestExists error for Pull destination conflicts
  • Fix 'inconsostency' typo in KillServer doc comment
  • Add doc comments to all error variables
  • Update Go 1.26.0 → 1.26.1

Tests

  • ConnString — default port, custom port, IPv6
  • ShortenSleep — verifies scalar division
  • GetLength — verifies 110% duration calculation
  • TapSequence JSON roundtrip
  • SequenceImporter.ToInput — all types + unknown fallback
  • insertSleeps — verifies sleep insertion between events
  • parseDevices — empty string, offline device, extra whitespace
  • parseScreenResolution — empty string, Samsung S21, override size
  • filterErr — basic coverage

…ot/Root targeting

- execute() no longer panics when adb is not found; returns ErrNotInstalled
- Use sync.Once for lazy adb path lookup instead of init()
- Fix Pull() checking src (device path) instead of dest (local path)
- Add ErrDestExists error for Pull destination conflicts
- Add -s serial flag to Push, Pull, Reboot, Root for multi-device support
- Root() now parses stdout to determine actual success
- Fix Shell() redundant variable redeclaration
- Fix 'inconsostency' typo in KillServer doc
- Add doc comments to all error variables
- Update Go 1.26.0 -> 1.26.1
- Add tests: ConnString, ShortenSleep, GetLength, JSON roundtrip,
  SequenceImporter.ToInput, insertSleeps, parseDevices edge cases,
  parseScreenResolution edge cases, filterErr
@taigrr
taigrr merged commit 80d01ae into master Mar 15, 2026
1 check passed
@taigrr
taigrr deleted the cd/tests-quality-fixes branch April 27, 2026 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant