Skip to content

Commit

Permalink
Don't run serial_driver_spec in Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
jmthomas committed Jan 28, 2022
1 parent 4edb57b commit a516d46
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,7 @@ RUN cd /devel \
&& git clone ${COSMOS_DOCKER_REPO}

ENV COSMOS_DEVEL /devel/COSMOS
ENV COSMOS_NO_SIMPLECOV 1
ENV DOCKER 1
WORKDIR /devel/COSMOS
CMD bash
CMD bash
8 changes: 7 additions & 1 deletion spec/io/posix_serial_driver_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@
# as published by the Free Software Foundation; version 3 with
# attribution addendums as found in the LICENSE.txt

if RbConfig::CONFIG['target_os'] !~ /mswin|mingw|cygwin/i and RUBY_ENGINE == 'ruby' and !ENV['CI']
# NOTE: !ENV['DOCKER'] because of the following error while in container:
# Failure/Error: @handle = Kernel.open(port_name, File::RDWR | File::NONBLOCK)
# Errno::ENOENT:
# No such file or directory @ rb_sysopen - /dev/ttyS0
# ./lib/cosmos/io/posix_serial_driver.rb:48:in `initialize'

if RbConfig::CONFIG['target_os'] !~ /mswin|mingw|cygwin/i and RUBY_ENGINE == 'ruby' and !ENV['CI'] and !ENV['DOCKER']

require 'spec_helper'
require 'cosmos/io/posix_serial_driver'
Expand Down

0 comments on commit a516d46

Please sign in to comment.