Christopher Mullins c43ea77d45 Remove extraneous test 6 rokov pred
..
helpers ab432727d2 Add helpers for transition tests 6 rokov pred
lib c332cf7023 Use OpenAPI to specify and document REST API endpoints and JSON schemas (#493) 6 rokov pred
spec c43ea77d45 Remove extraneous test 6 rokov pred
.rspec 00ed98f276 add integration tests 6 rokov pred
.ruby-version 00ed98f276 add integration tests 6 rokov pred
Gemfile b7e960830c Add Chroma library for RGB<->HSV conversion in tests 6 rokov pred
Gemfile.lock b7e960830c Add Chroma library for RGB<->HSV conversion in tests 6 rokov pred
README.md b5072eb23d add sample output to readme 6 rokov pred
espmh.env.example cc087aee3a add UDP tests (#438) 6 rokov pred
settings.json.example 648bfb4da2 Fix example settings -- not including the kevlin key breaks tests 6 rokov pred

README.md

Integration Tests

This integration test suite is built using rspec. It integrates with espMH in a variety of ways, and monitors externally visible behaviors and states to ensure they match expectations.

Setup

  1. Copy settings.json.example to settings.json and make appropriate modifications for your setup.
  2. Copy espmh.env.example to espmh.env and make appropriate modifications. For MQTT tests, you will need an external MQTT broker.
  3. Install ruby and the bundler gem.
  4. Run bundle install.

Running

Run the tests using bundle exec rspec.

Example output

$ bundle exec rspec -f d

Environment
  needs to have a settings.json file
  environment
    should have a host defined
    should respond to /about
  client
    should return IDs

State
  deleting
    should remove retained state
  birth and LWT
    should send birth message when configured
  commands and state
    should affect state
    should publish to state topics
    should publish an update message for each new command
    should respect the state update interval
  :device_id token for command topic
    should support hexadecimal device IDs
    should support decimal device IDs
  :hex_device_id for command topic
    should respond to commands
  :dec_device_id for command topic
    should respond to commands
  :hex_device_id for update/state topics
    should publish updates with hexadecimal device ID
    should publish state with hexadecimal device ID
  :dec_device_id for update/state topics
    should publish updates with hexadecimal device ID
    should publish state with hexadecimal device ID

REST Server
  authentication
    should not require auth unless both username and password are set
    should require auth for all routes when password is set

Settings
  POST settings file
    should clobber patched settings
    should apply POSTed settings
  radio
    should store a set of channels
    should store a listen channel
  static ip
    should boot with static IP when applied

State
  toggle command
    should toggle ON to OFF
    should toggle OFF to ON
  deleting
    should support deleting state
  persistence
    should persist parameters
    should affect member groups when changing group 0
    should keep group 0 state
    should clear group 0 state after member group state changes
    should not clear group 0 state when updating member group state if value is the same
    changing member state mode and then changing level should preserve group 0 brightness for original mode
  fields
    should support the color field
  increment/decrement commands
    should assume state after sufficiently many down commands
    should assume state after sufficiently many up commands
    should affect known state

Finished in 2 minutes 36.9 seconds (files took 0.23476 seconds to load)
38 examples, 0 failures