diff --git a/.github/workflows/annotation.yml b/.github/workflows/annotation.yml index 83464258c1..1c31369f5f 100644 --- a/.github/workflows/annotation.yml +++ b/.github/workflows/annotation.yml @@ -6,15 +6,21 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@master + - uses: actions/setup-python@v2 + with: + python-version: 2.7 - name: Flake8 with annotations - Python 2 # Using the flake8 options in the .flake8 file - uses: peternewman/actions-flake8@python2 + uses: TrueBrain/actions-flake8@main flake8-annotation-python3: runs-on: ubuntu-latest steps: - uses: actions/checkout@master + - uses: actions/setup-python@v2 + with: + python-version: 3.9 - name: Flake8 with annotations - Python 3 # Using the flake8 options in the .flake8 file - uses: TrueBrain/actions-flake8@master + uses: TrueBrain/actions-flake8@main with: only_warn: 1 diff --git a/.travis.yml b/.travis.yml index dab377b3a5..4780d54b2a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -77,6 +77,7 @@ jobs: include: - os: linux dist: bionic + arch: arm64 env: TASK='doxygen' addons: apt: @@ -89,6 +90,7 @@ jobs: - ubuntu-toolchain-r-test - os: linux dist: bionic + arch: arm64 env: TASK='lint' addons: apt: @@ -97,6 +99,7 @@ jobs: - *bionic_build_extras_python2 - os: linux dist: bionic + arch: arm64 env: TASK='check-licences' addons: apt: @@ -105,6 +108,7 @@ jobs: - *bionic_build_extras_python2 - os: linux dist: bionic + arch: arm64 env: - TASK='codespell' - PYTHON='python3' @@ -116,20 +120,25 @@ jobs: - moreutils - os: linux dist: bionic + arch: arm64 env: TASK='weblint' addons: apt: packages: - os: linux dist: bionic - env: TASK='flake8' + arch: arm64 + env: + - TASK='flake8' + - PYTHON='python3' addons: apt: packages: - *base_build - - *bionic_build_extras_python2 + - *bionic_build_extras_python3 - os: linux dist: xenial + arch: arm64 env: TASK='pychecker' python: '2.7' addons: @@ -139,6 +148,7 @@ jobs: - python-tk - os: linux dist: xenial + arch: arm64 env: TASK='pychecker-wip' python: '2.7' addons: @@ -146,46 +156,53 @@ jobs: packages: - *base_build - python-tk - - os: linux - dist: bionic - arch: amd64 - compiler: clang - env: - - TASK='compile' - - PYTHON='python3' addons: apt: packages: - - *core_build_clang_latest + - *base_build - *bionic_build_extras_python3 - sources: - - sourceline: "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-11 main" - key_url: "https://apt.llvm.org/llvm-snapshot.gpg.key" - - sourceline: "ppa:ubuntu-toolchain-r/test" - - os: linux - dist: bionic - arch: amd64 - compiler: gcc - env: TASK='compile' - python: '2.7' - addons: - apt: - packages: - - *core_build_gpp_latest - - *bionic_build_extras_python2 - sources: - - ubuntu-toolchain-r-test +# Only run Travis builds against the zero credit partner queue solution +# - os: linux +# dist: bionic +# arch: amd64 +# compiler: clang +# env: +# - TASK='compile' +# - PYTHON='python3' +# addons: +# apt: +# packages: +# - *core_build_clang_latest +# - *bionic_build_extras_python3 +# sources: +# - sourceline: "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-11 main" +# key_url: "https://apt.llvm.org/llvm-snapshot.gpg.key" +# - sourceline: "ppa:ubuntu-toolchain-r/test" +# - os: linux +# dist: bionic +# arch: amd64 +# compiler: gcc +# env: TASK='compile' +# python: '2.7' +# addons: +# apt: +# packages: +# - *core_build_gpp_latest +# - *bionic_build_extras_python2 +# sources: +# - ubuntu-toolchain-r-test - os: linux dist: bionic arch: arm64 compiler: clang - env: TASK='compile' - python: '2.7' + env: + - TASK='compile' + - PYTHON='python3' addons: apt: packages: - *core_build - - *bionic_build_extras_python2 + - *bionic_build_extras_python3 - os: linux dist: bionic arch: arm64 @@ -263,40 +280,41 @@ jobs: # - protobuf # - libftdi0 # update: false - - os: osx - osx_image: xcode9.4 - compiler: clang - env: - - TASK='compile' - - CPPUNIT='1.14' - - PROTOBUF='latest' - - LIBFTDI='1' - addons: - homebrew: - packages: - - *mac_core_build - - cppunit - - protobuf - - libftdi # install the latest cppunit, which needs C++11 - update: false - - os: osx - osx_image: xcode9.4 - compiler: gcc - env: - - TASK='compile' - - CPPUNIT='1.14' - - PROTOBUF='latest' - - LIBFTDI='1' - addons: - homebrew: - packages: - - *mac_core_build - - cppunit - - protobuf - - libftdi # install the latest cppunit, which needs C++11 - update: false +# - os: osx +# osx_image: xcode9.4 +# compiler: clang +# env: +# - TASK='compile' +# - CPPUNIT='1.14' +# - PROTOBUF='latest' +# - LIBFTDI='1' +# addons: +# homebrew: +# packages: +# - *mac_core_build +# - cppunit +# - protobuf +# - libftdi # install the latest cppunit, which needs C++11 +# update: false +# - os: osx +# osx_image: xcode9.4 +# compiler: gcc +# env: +# - TASK='compile' +# - CPPUNIT='1.14' +# - PROTOBUF='latest' +# - LIBFTDI='1' +# addons: +# homebrew: +# packages: +# - *mac_core_build +# - cppunit +# - protobuf +# - libftdi # install the latest cppunit, which needs C++11 +# update: false - os: linux dist: bionic + arch: arm64 compiler: gcc env: TASK='coverage' addons: @@ -307,6 +325,7 @@ jobs: - sourceline: "ppa:ubuntu-toolchain-r/test" - os: linux dist: xenial + arch: arm64 compiler: gcc env: TASK='coverity' addons: @@ -319,25 +338,30 @@ jobs: - sourceline: "ppa:ubuntu-toolchain-r/test" - os: linux dist: bionic + arch: arm64 env: TASK='spellintian' addons: apt: packages: - *core_build + - *bionic_build_extras_python2 - lintian - moreutils - os: linux dist: bionic + arch: arm64 env: TASK='spellintian-duplicates' addons: apt: packages: - *core_build + - *bionic_build_extras_python2 - lintian - moreutils allow_failures: - os: linux dist: xenial + arch: arm64 env: TASK='pychecker-wip' # - os: osx # osx_image: xcode9.4 @@ -399,17 +423,27 @@ jobs: - LIBFTDI='1' - os: linux dist: bionic + arch: arm64 + env: + - TASK='flake8' + - PYTHON='python3' + - os: linux + dist: bionic + arch: arm64 compiler: gcc env: TASK='coverage' - os: linux dist: xenial + arch: arm64 compiler: gcc env: TASK='coverity' - os: linux dist: bionic + arch: arm64 env: TASK='spellintian' - os: linux dist: bionic + arch: arm64 env: TASK='spellintian-duplicates' env: @@ -449,7 +483,8 @@ before_cache: - ccache -s # see how many hits ccache got before_install: - - if [ "$PYTHON" == "python3" ]; then pyenv global 3.8.1 ; fi +# Try doing nothing (on arm64 at least) +# - if [ "$PYTHON" == "python3" ]; then pyenv global 3.8.1 ; fi #Fix permissions for unbound (and possibly others) - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then if [ ! -d /usr/local/sbin ]; then sudo mkdir -p /usr/local/sbin && sudo chown -R $(whoami) /usr/local/sbin; fi; fi #Add a missing gnupg folder diff --git a/README b/README index 04b0030d86..2954eebe74 100644 --- a/README +++ b/README @@ -2,7 +2,7 @@ [www.openlighting.org/ola](https://www.openlighting.org/ola) -[![Build Status](https://travis-ci.org/OpenLightingProject/ola.svg?branch=master)](https://travis-ci.org/OpenLightingProject/ola) [![Coverity Scan Status](https://scan.coverity.com/projects/3514/badge.svg)](https://scan.coverity.com/projects/3514) [![Coverage Status](https://coveralls.io/repos/OpenLightingProject/ola/badge.svg?branch=master)](https://coveralls.io/r/OpenLightingProject/ola?branch=master) +[![Build Status](https://travis-ci.com/github/OpenLightingProject/ola.svg?branch=master)](https://travis-ci.com/github/OpenLightingProject/ola) [![Coverity Scan Status](https://scan.coverity.com/projects/3514/badge.svg)](https://scan.coverity.com/projects/3514) [![Coverage Status](https://coveralls.io/repos/OpenLightingProject/ola/badge.svg?branch=master)](https://coveralls.io/r/OpenLightingProject/ola?branch=master) The Open Lighting Architecture (OLA) is a framework for controlling entertainment lighting equipment. Within the entertainment lighting industry, diff --git a/include/ola/MultiCallback.h b/include/ola/MultiCallback.h index f463246f43..f819ebdb6d 100644 --- a/include/ola/MultiCallback.h +++ b/include/ola/MultiCallback.h @@ -14,7 +14,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * MultiCallback.h - * A callback which can be exectuted multiple times. When a pre-defined limit + * A callback which can be executed multiple times. When a pre-defined limit * is reached, then the underlying callback is executed. * Copyright (C) 2011 Simon Newton */ @@ -66,7 +66,7 @@ namespace ola { * * @note MultiCallback is NOT thread safe. * - * @note If limit is 0, the callback is exectuted immediately. + * @note If limit is 0, the callback is executed immediately. */ class MultiCallback: public BaseCallback0 { public: diff --git a/include/ola/rdm/RDMCommandSerializer.h b/include/ola/rdm/RDMCommandSerializer.h index 1e077d00b3..95623d19ac 100644 --- a/include/ola/rdm/RDMCommandSerializer.h +++ b/include/ola/rdm/RDMCommandSerializer.h @@ -78,7 +78,7 @@ class RDMCommandSerializer { /** * @brief Serialize a RDMCommand to an array of bytes. * @param command the RDMCommand to serialize. - * @param buffer The memory location to serailize to. + * @param buffer The memory location to serialize to. * @param[in,out] size The size of the memory location. * @returns True if the command was serialized correctly, false otherwise. * diff --git a/olad/BonjourDiscoveryAgent.cpp b/olad/BonjourDiscoveryAgent.cpp index 298852edad..808b4c0e93 100644 --- a/olad/BonjourDiscoveryAgent.cpp +++ b/olad/BonjourDiscoveryAgent.cpp @@ -160,7 +160,7 @@ string BonjourDiscoveryAgent::BuildTxtRecord( unsigned int pair_size = iter->first.size() + iter->second.size() + 1; if (pair_size > UINT8_MAX) { OLA_WARN << "Discovery data of " << iter->first << ": " << iter->second - << " exceeed " << static_cast(UINT8_MAX) + << " exceed " << static_cast(UINT8_MAX) << " bytes. Data skipped"; continue; } diff --git a/plugins/ftdidmx/README.md b/plugins/ftdidmx/README.md index b0ce125a37..bdc788b8a3 100644 --- a/plugins/ftdidmx/README.md +++ b/plugins/ftdidmx/README.md @@ -1,9 +1,9 @@ FTDI USB Chipset DMX Plugin =========================== -This plugin is compatible with Enttec OpenDmx and other FTDI chipset based -USB to DMX converters where the host needs to create the DMX stream itself -and not the interface (the interface has no microprocessor to do so). +This plugin is compatible with Enttec Open DMX USB and other FTDI chipset +based USB to DMX converters where the host needs to create the DMX stream +itself and not the interface (the interface has no microprocessor to do so). ## Config file: ola-ftdidmx.conf diff --git a/plugins/opendmx/README.md b/plugins/opendmx/README.md index d160cce5d0..f142c64ffd 100644 --- a/plugins/opendmx/README.md +++ b/plugins/opendmx/README.md @@ -2,7 +2,8 @@ Enttec Open DMX Plugin ====================== The plugin creates a single device with one output port using the Enttec -Open DMX USB widget. +Open DMX USB widget. It requires the Open DMX kernel module, if you don't +have this installed, use the FTDI DMX USB plugin instead. ## Config file: `ola-opendmx.conf` diff --git a/python/ola/ClientWrapperTest.py b/python/ola/ClientWrapperTest.py index cd1e5cf2dc..a957c36276 100644 --- a/python/ola/ClientWrapperTest.py +++ b/python/ola/ClientWrapperTest.py @@ -173,6 +173,7 @@ def d(): wrapper.AddEvent(datetime.timedelta(milliseconds=5), b) wrapper.AddEvent(10, c) + # Nothing has been called yet self.assertIsNone(results.a_called) self.assertIsNone(results.b_called) self.assertIsNone(results.c_called) @@ -181,19 +182,32 @@ def d(): self.start = datetime.datetime.now() wrapper.Run() + # Everything has been called self.assertIsNotNone(results.a_called) self.assertIsNotNone(results.b_called) self.assertIsNotNone(results.c_called) self.assertIsNotNone(results.d_called) - self.assertTrue(results.a_called - self.start < - datetime.timedelta(milliseconds=5)) - self.assertTrue(results.b_called - self.start >= - datetime.timedelta(milliseconds=5)) - self.assertTrue(results.c_called - self.start >= - datetime.timedelta(milliseconds=10)) - self.assertTrue(results.d_called - self.start >= - datetime.timedelta(milliseconds=15)) + # Check when the callbacks were called. Allow 500 microseconds of drift. + # Called immediately + a_diff = results.a_called - self.start + self.assertAlmostEqual(a_diff, datetime.timedelta(milliseconds=0), + delta=datetime.timedelta(microseconds=500)) + + # Called in 5 milliseconds + b_diff = results.b_called - self.start + self.assertAlmostEqual(b_diff, datetime.timedelta(milliseconds=5), + delta=datetime.timedelta(microseconds=500)) + + # Called in 10 milliseconds + c_diff = results.c_called - self.start + self.assertAlmostEqual(c_diff, datetime.timedelta(milliseconds=10), + delta=datetime.timedelta(microseconds=500)) + + # Called in 15 milliseconds + d_diff = results.d_called - self.start + self.assertAlmostEqual(d_diff, datetime.timedelta(milliseconds=15), + delta=datetime.timedelta(microseconds=500)) sockets[0].close() sockets[1].close() @@ -230,6 +244,9 @@ def DataCallback(self): self.assertTrue(results.gotdata) + sockets[0].close() + sockets[1].close() + if __name__ == '__main__': unittest.main() diff --git a/tools/rdm/ExpectedResults.py b/tools/rdm/ExpectedResults.py index 17fcc70d59..1a46329644 100644 --- a/tools/rdm/ExpectedResults.py +++ b/tools/rdm/ExpectedResults.py @@ -58,7 +58,7 @@ def __init__(self, advisory: An advisory message to log is this result matches """ self._action = action - self._warning_messae = warning + self._warning_message = warning self._advisory_message = advisory @property @@ -67,7 +67,7 @@ def action(self): @property def warning(self): - return self._warning_messae + return self._warning_message @property def advisory(self): diff --git a/tools/rdm/TestRunner.py b/tools/rdm/TestRunner.py index b4310a0aa6..3dab397080 100644 --- a/tools/rdm/TestRunner.py +++ b/tools/rdm/TestRunner.py @@ -276,7 +276,7 @@ def RunTests(self, whitelist=None, no_factory_defaults=False, update_cb=None): Returns: A tuple in the form (tests, device), where tests is a list of tests that - exectuted, and device is an instance of DeviceProperties. + executed, and device is an instance of DeviceProperties. """ device = DeviceProperties(self._property_map.keys()) if whitelist is None: