Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix parameter for ReadThread (windows) #1377

Merged
merged 1 commit into from
Oct 24, 2017

Conversation

kimushu
Copy link
Contributor

@kimushu kimushu commented Oct 24, 2017

Fix #1375
This is a degrade by #1367

Copy link
Member

@reconbot reconbot left a comment

Choose a reason for hiding this comment

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

This makes sense.

@reconbot
Copy link
Member

Are you able to run the full test suite with a TEST_PORT and an arduino?

@kimushu
Copy link
Contributor Author

kimushu commented Oct 24, 2017

Ok, but 1 test fails. I'll check details later.

$ env TEST_PORT=$(./bin/find-arduino.js) npm test

> [email protected] test D:\Works\node\node-serialport
> istanbul cover ./node_modules/mocha/bin/_mocha



  listLinux
    √ lists available serialports

  serialNumParser
    √ parses pnp id for FTDI Device
    √ parses pnp id for Arduino Mega
    √ parses pnp id for Atlas Scientific EZO-RGB Sensor
    √ parses pnp id for Gearmo FTDI2-LED USB RS-232 Serial Adapter
    √ parses pnp id for Arducam Nano V3.0 (Arduino Nano with FTDI)
    √ parses pnp id for Pretend Device with an unknown pnp id

  bindings/mock
    static method
      .list
        √ returns an array
        √ has objects with undefined when there is no data
    constructor
      √ creates a binding object
      √ throws when not given an options object
    instance property
      #isOpen
        √ is true after open and false after close
    instance method
      #open
        √ errors when providing a bad port
        √ throws when not given a path
        √ throws when not given options
        √ cannot open if already open
        √ keeps open state
        √ supports a custom baudRate of 25000
        √ supports a custom baudRate of 1000000
        √ supports a custom baudRate of 1000000
        optional locking
          √ locks the port by default
          √ can unlock the port
      #close
        √ errors when already closed
        √ closes an open file descriptor
      #update
        √ throws when not given an object
        √ errors asynchronously when not open
        √ throws errors when updating nothing
        √ errors when not called with options
        √ updates baudRate
      #write
        √ errors asynchronously when not open
        √ throws when not given a buffer
        √ resolves after a small write
        √ resolves after a large write (2k)
      #drain
        √ errors asynchronously when not open
        √ drains the port
        √ waits for in progress writes to finish
      #flush
        √ errors asynchronously when not open
        √ flushes the port
      #set
        √ errors asynchronously when not open
        √ throws when not called with options
        √ sets flags on the port
      #read
        √ errors asynchronously when not open
        √ doesn't throw if the port is open
        √ returns at maximum the requested number of bytes
      #get
        √ errors asynchronously when not open
        √ gets modem line status from the port

  bindings/win32
    static method
      .list
        √ returns an array
        √ has objects with undefined when there is no data
    constructor
      √ creates a binding object
      √ throws when not given an options object
    instance property
      #isOpen
        √ is true after open and false after close
    instance method
      #open
        √ errors when providing a bad port
        √ throws when not given a path
        √ throws when not given options
        √ cannot open if already open
        √ keeps open state
        - Feature "baudrate.25000" is disabled in "win32. "supports a custom baudRate of 25000"
        √ supports a custom baudRate of 1000000
        √ supports a custom baudRate of 1000000
        optional locking
          √ locks the port by default
          - Feature "open.unlock" is disabled in "win32. "can unlock the port"
      #close
        √ errors when already closed
        √ closes an open file descriptor
      #update
        √ throws when not given an object
        √ errors asynchronously when not open
        √ throws errors when updating nothing
        √ errors when not called with options
        √ updates baudRate
      #write
        √ errors asynchronously when not open
        √ throws when not given a buffer
        √ resolves after a small write
        √ resolves after a large write (2k) (2061ms)
      #drain
        √ errors asynchronously when not open
        √ drains the port
        √ waits for in progress writes to finish (2057ms)
      #flush
        √ errors asynchronously when not open
        √ flushes the port
      #set
        √ errors asynchronously when not open
        √ throws when not called with options
        √ sets flags on the port
      #read
        √ errors asynchronously when not open
        √ doesn't throw if the port is open (1587ms)
        √ returns at maximum the requested number of bytes (1589ms)
      #get
        √ errors asynchronously when not open
        √ gets modem line status from the port

  mock SerialPort Integration Tests
    static Method
      .list
        √ contains the test port
    constructor
      √ provides an error in callback when trying to open an invalid port
      √ emits an error event when trying to open an invalid port
    opening and closing
      √ can open and close
      √ cannot be opened again after open
      √ cannot be opened while opening
      √ can open and close ports repetitively
      √ can be read after closing and opening
      √ errors if closing during a write
    #update
      √ allows changing the baud rate of an open port
    #read and #write
      √ 2k test
    #flush
      √ discards any received data
      √ deals with flushing during a read
    #drain
      √ waits for in progress or queued writes to finish

  win32 SerialPort Integration Tests
    static Method
      .list
        √ contains the test port
    constructor
      √ provides an error in callback when trying to open an invalid port
      √ emits an error event when trying to open an invalid port
    opening and closing
      √ can open and close
      √ cannot be opened again after open
      √ cannot be opened while opening
      √ can open and close ports repetitively (60ms)
      √ can be read after closing and opening (3250ms)
      √ errors if closing during a write
    #update
      - Feature "port.update-baudrate" is disabled in "win32. "allows changing the baud rate of an open port"
    #read and #write
      1) 2k test


  106 passing (12s)
  3 pending
  1 failing

  1) win32 SerialPort Integration Tests
       #read and #write
         2k test:
     Error: Opening COM15: Access denied
      at Error (native)
  From previous event:
      at lib\util.js:9:513
      at open.then (lib\bindings\win32.js:9:1904)
  From previous event:
      at WindowsBinding.open (lib\bindings\win32.js:9:1723)
      at SerialPort.open (lib\serialport.js:9:7321)
      at new SerialPort (lib\serialport.js:9:5220)
      at Context.<anonymous> (test\integration.js:191:22)



=============================================================================
Writing coverage object [D:\Works\node\node-serialport\coverage\coverage.json]
Writing coverage reports at [D:\Works\node\node-serialport\coverage]
=============================================================================

=============================== Coverage summary ===============================
Statements   : 78.3% ( 498/636 )
Branches     : 68.44% ( 167/244 )
Functions    : 82.5% ( 66/80 )
Lines        : 78.51% ( 486/619 )
================================================================================
npm ERR! Test failed.  See above for more details.

@codecov-io
Copy link

Codecov Report

Merging #1377 into master will increase coverage by 0.14%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1377      +/-   ##
==========================================
+ Coverage   79.43%   79.58%   +0.14%     
==========================================
  Files          21       20       -1     
  Lines         919      862      -57     
  Branches      166      162       -4     
==========================================
- Hits          730      686      -44     
+ Misses        189      176      -13
Impacted Files Coverage Δ
lib/bindings/auto-detect.js 69.23% <0%> (-30.77%) ⬇️
lib/bindings/win32.js

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8f650c3...478c658. Read the comment docs.

@reconbot
Copy link
Member

Well.. that test should pass, this is an obvious bug to fix, hopefully there are not others. I don't have access to windows test hardware so I cant' debug it.

@reconbot reconbot merged commit 6f3afbe into serialport:master Oct 24, 2017
@kimushu
Copy link
Contributor Author

kimushu commented Oct 24, 2017

Ok, I'll post a new issue for this error.

@lock lock bot locked and limited conversation to collaborators Apr 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants