Giter VIP home page Giter VIP logo

integration-tests-firmware's Introduction

Edge Impulse device integration tests

This contains device integration tests for the Edge Impulse remote management and serial protocols. It contains tests for both serial and IP communication, and sampling from the accelerometer and the microphone. If your device has a different sensor configuration you'll have to update the tests.

How to run

  1. Create an Edge Impulse account specifically for the tests. Ensure that there is only one project listed under the account, and that the account is activated.

  2. Install the Edge Impulse CLI and ensure that the CLI can see your development board. If not, you'll need to provide a PR for the CLI first.

  3. Clone this repository.

    $ git clone https://github.com/edgeimpulse/integration-tests-firmware
    
  4. Install dependencies:

    $ npm install
    $ npm install chromedriver@latest
    
  5. Run the tests:

    ./node_modules/typescript/bin/tsc -p . && \
        EI_USERNAME="xxx" \
        EI_PASSWORD="xxx" \
        EI_PROJECTNAME="xxx" \
        EI_HMACKEY="xxx" \
        EI_TESTWIFI=1 \
        SELENIUM_WIFI_SSID="xxx" \
        SELENIUM_WIFI_PASSWORD="xxx" \
        TEST_ACCELEROMETER=1 \
        TEST_MICROPHONE=1 \
        ./node_modules/.bin/wdio wdio.headless.chrome.js
    

    With these options:

    • EI_USERNAME - the Edge Impulse username of your test account.
    • EI_PASSWORD - the Edge Impulse password of your test account.
    • EI_PROJECTNAME - the name of the only project for your test account.
    • EI_HMACKEY - the development HMAC key for the project (see Keys under the studio's dashboard).
    • EI_TESTWIFI - whether to test WiFi connection.
    • SELENIUM_WIFI_SSID - if WiFi was enabled, the SSID of the network.
    • SELENIUM_WIFI_PASSWORD - if WiFi was enabled, the SSID of the network.
    • TEST_ACCELEROMETER - whether to test the accelerometer.
    • TEST_MICROPHONE whether to test the microphone.
    • ACCELEROMETER_SENSOR_NAME - name of the accelerometer sensor (default: 'Built-in accelerometer').
    • MICROPHONE_SENSOR_NAME - name of the microphone sensor (default: 'Built-in microphone').
  6. This yields a test report:

    [chrome  mac os x #0-0] Spec: /Users/janjongboom/repos/integration-tests-firmware/build/device-integration.js
    [chrome  mac os x #0-0] Running: chrome on mac os x
    [chrome  mac os x #0-0] Session ID: b81ab4177bdb379c34e09d8590cd1b77
    [chrome  mac os x #0-0]
    [chrome  mac os x #0-0] device integration
    [chrome  mac os x #0-0]     environment variables
    [chrome  mac os x #0-0]        ✓ should have EI_USERNAME set
    [chrome  mac os x #0-0]        ✓ should have EI_PASSWORD set
    [chrome  mac os x #0-0]        ✓ should have EI_PROJECTNAME set
    [chrome  mac os x #0-0]        ✓ should have EI_HMACKEY set
    [chrome  mac os x #0-0]        ✓ should have EI_TESTWIFI set
    [chrome  mac os x #0-0]
    [chrome  mac os x #0-0]     logging in
    [chrome  mac os x #0-0]        ✓ allows logging in
    [chrome  mac os x #0-0]
    [chrome  mac os x #0-0]     daemon
    [chrome  mac os x #0-0]         clearing configuration
    [chrome  mac os x #0-0]            ✓ should clear configuration
    [chrome  mac os x #0-0]
    [chrome  mac os x #0-0]         accelerometer
    [chrome  mac os x #0-0]             training data
    [chrome  mac os x #0-0]                ✓ shows data posted by the ingestion API
    [chrome  mac os x #0-0]                ✓ has correct label
    [chrome  mac os x #0-0]                ✓ passed signature verification
    [chrome  mac os x #0-0]                ✓ allows deleting sample
    [chrome  mac os x #0-0]
    [chrome  mac os x #0-0]             testing data
    [chrome  mac os x #0-0]                ✓ shows data posted by the ingestion API
    [chrome  mac os x #0-0]                ✓ has correct label
    [chrome  mac os x #0-0]                ✓ passed signature verification
    [chrome  mac os x #0-0]                ✓ allows deleting sample
    [chrome  mac os x #0-0]
    [chrome  mac os x #0-0]         microphone
    [chrome  mac os x #0-0]             training data
    [chrome  mac os x #0-0]                ✓ shows data posted by the ingestion API
    [chrome  mac os x #0-0]                ✓ has correct label
    [chrome  mac os x #0-0]                ✓ passed signature verification
    [chrome  mac os x #0-0]                ✓ allows deleting sample
    [chrome  mac os x #0-0]
    [chrome  mac os x #0-0]             testing data
    [chrome  mac os x #0-0]                ✓ shows data posted by the ingestion API
    [chrome  mac os x #0-0]                ✓ has correct label
    [chrome  mac os x #0-0]                ✓ passed signature verification
    [chrome  mac os x #0-0]                ✓ allows deleting sample
    [chrome  mac os x #0-0]
    [chrome  mac os x #0-0]         shutting down daemon
    [chrome  mac os x #0-0]            ✓ shuts down daemon
    [chrome  mac os x #0-0]
    [chrome  mac os x #0-0]     wifi
    [chrome  mac os x #0-0]         environmental variables
    [chrome  mac os x #0-0]            ✓ has wifi credentials set
    [chrome  mac os x #0-0]
    [chrome  mac os x #0-0]         clearing configuration
    [chrome  mac os x #0-0]            ✓ should clear configuration
    [chrome  mac os x #0-0]
    [chrome  mac os x #0-0]         accelerometer
    [chrome  mac os x #0-0]             training data
    [chrome  mac os x #0-0]                ✓ shows data posted by the ingestion API
    [chrome  mac os x #0-0]                ✓ has correct label
    [chrome  mac os x #0-0]                ✓ passed signature verification
    [chrome  mac os x #0-0]                ✓ allows deleting sample
    [chrome  mac os x #0-0]
    [chrome  mac os x #0-0]             testing data
    [chrome  mac os x #0-0]                ✓ shows data posted by the ingestion API
    [chrome  mac os x #0-0]                ✓ has correct label
    [chrome  mac os x #0-0]                ✓ passed signature verification
    [chrome  mac os x #0-0]                ✓ allows deleting sample
    [chrome  mac os x #0-0]
    [chrome  mac os x #0-0]         microphone
    [chrome  mac os x #0-0]             training data
    [chrome  mac os x #0-0]                ✓ shows data posted by the ingestion API
    [chrome  mac os x #0-0]                ✓ has correct label
    [chrome  mac os x #0-0]                ✓ passed signature verification
    [chrome  mac os x #0-0]                ✓ allows deleting sample
    [chrome  mac os x #0-0]
    [chrome  mac os x #0-0]             testing data
    [chrome  mac os x #0-0]                ✓ shows data posted by the ingestion API
    [chrome  mac os x #0-0]                ✓ has correct label
    [chrome  mac os x #0-0]                ✓ passed signature verification
    [chrome  mac os x #0-0]                ✓ allows deleting sample
    [chrome  mac os x #0-0]
    [chrome  mac os x #0-0] 42 passing (1m 30.1s)
    
    
    Spec Files:      1 passed, 1 total (100% completed) in 00:01:30
    

Using Firefox

The default driver is Chrome, but you can also use Firefox via:

./node_modules/typescript/bin/tsc -p . && \
    EI_USERNAME="xxx" \
    EI_PASSWORD="xxx" \
    EI_PROJECTNAME="xxx" \
    EI_HMACKEY="xxx" \
    EI_TESTWIFI=1 \
    SELENIUM_WIFI_SSID="xxx" \
    SELENIUM_WIFI_PASSWORD="xxx" \
    TEST_ACCELEROMETER=1 \
    TEST_MICROPHONE=1 \
    ./node_modules/.bin/wdio wdio.headless.firefox.js

integration-tests-firmware's People

Contributors

janjongboom avatar

Stargazers

Weiren avatar Abhijeet Bhatikar avatar

Watchers

mat kelcey avatar James Cloos avatar Mathijs Baaijens avatar Louis MOREAU avatar Doug Anson avatar Aurelien Lequertier avatar Mateusz Majchrzycki avatar  avatar Jenny Plunkett avatar Vojislav Milivojevic avatar Francesco avatar Eoin Jordan avatar Omar Shrit avatar Sara Olsson avatar Evan Rust avatar  avatar  avatar

integration-tests-firmware's Issues

Not available on the Linux platform

The installation looks fine, but it doesn't work. Is there something missing? @janjongboom

baozhu@bz:~/storage/integration-tests-firmware$ npm install 
audited 506 packages in 2.388s

26 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

baozhu@bz:~/storage/integration-tests-firmware$ ./node_modules/typescript/bin/tsc -p . &&     EI_USERNAME="xxx"     EI_PASSWORD="xxx"     EI_PROJECTNAME="xxx"     EI_HMACKEY="xxx"     EI_TESTWIFI=1     SELENIUM_WIFI_SSID="xxx"     SELENIUM_WIFI_PASSWORD="xxx"     ./node_modules/.bin/wdio wdio.headless.conf.js

Execution of 1 spec files started at 2020-06-03T09:26:51.196Z

2020-06-03T09:26:51.213Z INFO @wdio/cli:launcher: Run onPrepare hook
Could not find chromedriver in default path:  /home/baozhu/storage/integration-tests-firmware/node_modules/chromedriver/lib/chromedriver/chromedriver
Falling back to use global chromedriver bin
events.js:174
      throw er; // Unhandled 'error' event
      ^

Error: spawn chromedriver ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
    at onErrorNT (internal/child_process.js:415:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)
    at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
Emitted 'error' event at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
    at onErrorNT (internal/child_process.js:415:16)
    [... lines matching original stack trace ...]
    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
baozhu@bz:~/storage/integration-tests-firmware$ 



Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.