Skip to content

Add comprehensive test coverage for GTU7 GPS sensor#17

Merged
rustyeddy merged 5 commits intogtu7from
copilot/sub-pr-16
Jan 17, 2026
Merged

Add comprehensive test coverage for GTU7 GPS sensor#17
rustyeddy merged 5 commits intogtu7from
copilot/sub-pr-16

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 16, 2026

Addresses review feedback requesting additional test scenarios beyond the existing RMC precedence test.

Tests Added

  • Malformed/invalid NMEA handling: Empty lines, truncated sentences, unknown types, missing fields
  • GGA-only operation: Verifies correct position data when RMC/VTG unavailable
  • Context cancellation: Clean shutdown between sentence processing
  • Multi-constellation variants: GNGGA/GNRMC/GNVTG sentence support (GPS+GLONASS/Galileo)

Example test structure:

func TestGTU7_MalformedSentences(t *testing.T) {
    tests := []struct {
        name  string
        input string
    }{
        {"empty lines", "\n\n\n$GPGGA,..."},
        {"truncated GGA", "$GPGGA,160446.00,3340\n$GPGGA,..."},
        {"invalid sentence type", "$GPXYZ,...\n$GPGGA,..."},
        {"missing lat/lon fields", "$GPGGA,160446.00,,,,,2,08,..."},
    }
    // Verifies driver skips malformed data and processes valid sentences
}

All tests use string readers (hermetic, deterministic) and follow existing timeout patterns.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits January 16, 2026 17:39
Co-authored-by: rustyeddy <2903425+rustyeddy@users.noreply.github.com>
Co-authored-by: rustyeddy <2903425+rustyeddy@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jan 16, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

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:

  • go.googlesource.com
    • Triggering command: /update-job-proxy /update-job-proxy x64/src/runtime/ls-files (dns block)
    • Triggering command: /update-job-proxy /update-job-proxy DROP tnet/tools/git test -e CA.pem 6153098/b225/importcfg /bin/test pkg/mod/periph.i/usr/bin/git pkg/mod/periph.icat-file ache/go/1.24.11/blob test -e .pem ache/go/1.24.11/x64/pkg/tool/lin-e est se rity.crt cal/bin/sh test (dns block)
  • gopkg.in
    • Triggering command: /update-job-proxy /update-job-proxy x64/src/runtime/ls-files (dns block)
    • Triggering command: /update-job-proxy /update-job-proxy DROP tnet/tools/git test -e CA.pem 6153098/b225/importcfg /bin/test pkg/mod/periph.i/usr/bin/git pkg/mod/periph.icat-file ache/go/1.24.11/blob test -e .pem ache/go/1.24.11/x64/pkg/tool/lin-e est se rity.crt cal/bin/sh test (dns block)
  • periph.io
    • Triggering command: /update-job-proxy /update-job-proxy x64/src/runtime/ls-files (dns block)
    • Triggering command: /update-job-proxy /update-job-proxy DROP tnet/tools/git test -e CA.pem 6153098/b225/importcfg /bin/test pkg/mod/periph.i/usr/bin/git pkg/mod/periph.icat-file ache/go/1.24.11/blob test -e .pem ache/go/1.24.11/x64/pkg/tool/lin-e est se rity.crt cal/bin/sh test (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Update PR to address feedback on Gtu7 sensor and drivers Add comprehensive test coverage for GTU7 GPS sensor Jan 16, 2026
Copilot AI requested a review from rustyeddy January 16, 2026 17:42
@rustyeddy rustyeddy marked this pull request as ready for review January 17, 2026 15:50
Copilot AI review requested due to automatic review settings January 17, 2026 15:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds comprehensive test coverage for the GTU7 GPS sensor driver to address review feedback. The tests verify the driver's robustness in handling malformed NMEA sentences, operating with limited sentence types, responding to context cancellation, and supporting multi-constellation GNSS formats (GPS+GLONASS/Galileo).

Changes:

  • Added tests for malformed/invalid NMEA sentence handling (empty lines, truncated data, unknown types, missing fields)
  • Added test for GGA-only operation without RMC/VTG speed data
  • Added test for context cancellation behavior
  • Added tests for multi-constellation GNSS sentence variants (GNGGA/GNRMC/GNVTG)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread sensors/gtu7_test.go Outdated
Comment thread sensors/gtu7_test.go
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@rustyeddy rustyeddy merged commit 38e9605 into gtu7 Jan 17, 2026
@rustyeddy rustyeddy deleted the copilot/sub-pr-16 branch January 17, 2026 15:55
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.

3 participants