Skip to content
This repository has been archived by the owner on Jun 19, 2022. It is now read-only.

Releases: bossjones/scarlett_os

Threadmanager, pytest, and fixes for mock/monkeypatch leaks.

21 May 14:55
Compare
Choose a tag to compare

Feature

threadmanager


This PR is a horrible convoluted set of changes, partially due to a regression in pytest-mock, pytest, and python 3.5.2. More info on the issue can be seen here: https://github.com/bossjones/reproduce_pytest_mock_issue_84

Seeing this issue has really highlighted the need to clean up the structure of the test repo promptly.

In the next PR will work on a top level conftest.py, and several folders for unit, intgr, performance, behavior, and regression testing. Then we can get rid of a lot of the duplicate code currently being used. From there, we can finally return to adding features to Scarlett.

Main point is, we got threadmanager in, tested it, got rid of a lot of old unittest code, move more over to pytest, and actually found a way to test some threading based classes.

Reordered-unittest: Splint things into folders based on type of test

21 May 19:31
Compare
Choose a tag to compare

Feature

.
├── AUTHORS.rst
├── Brewfile
├── CONTRIBUTING.rst
├── Dockerfile
├── Dockerfile-mediagoblin
├── Gemfile
├── Gemfile.lock
├── HISTORY.rst
├── LICENSE
├── MANIFEST.in
├── Makefile
├── README.rst
├── _debug
│   ├── generator-player-pipeline.png
│   └── generator-player.dot
├── assets
│   ├── generator-listener-pipeline.png
│   ├── generator-listener.dot
│   ├── generator-player-pipeline.png
│   └── generator-player.dot
├── ci
│   ├── build.yml
│   ├── set_postactivate.sh
│   ├── travis.sh
│   ├── travis_bootstrap.sh
│   ├── travis_debugging.md
│   ├── travis_jhbuild.yml
│   └── travis_source.sh
├── config
│   ├── configuration.yaml.example
│   ├── custom_automations
│   │   ├── example.py
│   │   └── hello_world.py
│   └── custom_components
├── container
│   └── root
│       ├── clean.sh
│       ├── docker_entrypoint.sh
│       ├── dotfiles
│       └── etc
│           └── services.d
│               └── scarlett_os
│                   ├── finish
│                   └── run
├── cookiecutter.json
├── docker-anaconda.yml
├── docker-compose-devtools.yml
├── docker-compose-test-improved.yml
├── docker-compose.test.yml
├── docker-compose.yml
├── docs
│   ├── Makefile
│   ├── authors.rst
│   ├── conf.py
│   ├── contributing.rst
│   ├── history.rst
│   ├── index.rst
│   ├── installation.rst
│   ├── make.bat
│   ├── readme.rst
│   └── usage.rst
├── espeak-1.48.04-source.zip
├── espeak_tmp.wav
├── ess.zip
├── example-cookiecutterrc.yaml
├── fabfile.py
├── fs-scarlett.sh
├── gtk-osx-build-setup.sh
├── gtk3-venv.sh
├── keys
│   ├── vagrant.pub
│   └── vagrant_id_rsa
├── listener.py.diff
├── osx_virtualenv.sh
├── pa.tgz
├── pa_stable_v19_20140130.tgz
├── postactivate
├── postactivate_osx
├── pylintrc
├── pytestdebug.log
├── release_checklist.md
├── requirements.txt
├── requirements_dev.txt
├── requirements_test.txt
├── requirements_test_experimental.txt
├── scarlett_os
│   ├── __init__.py
│   ├── __main__.py
│   ├── __pycache__
│   │   ├── __init__.cpython-35.pyc
│   │   ├── commands.cpython-35.pyc
│   │   ├── compat.cpython-35.pyc
│   │   ├── config.cpython-35.pyc
│   │   ├── const.cpython-35.pyc
│   │   ├── core.cpython-35.pyc
│   │   ├── emitter.cpython-35.pyc
│   │   ├── exceptions.cpython-35.pyc
│   │   ├── listener.cpython-35.pyc
│   │   ├── loader.cpython-35.pyc
│   │   ├── mpris.cpython-35.pyc
│   │   ├── player.cpython-35.pyc
│   │   ├── speaker.cpython-35.pyc
│   │   ├── subprocess.cpython-35.pyc
│   │   └── tasker.cpython-35.pyc
│   ├── automations
│   │   └── __init__.py
│   ├── commands.py
│   ├── compat.py
│   ├── config.py
│   ├── const.py
│   ├── core.py
│   ├── emitter.py
│   ├── exceptions.py
│   ├── helpers
│   │   ├── __init__.py
│   │   ├── __pycache__
│   │   │   ├── __init__.cpython-35.pyc
│   │   │   ├── config_validation.cpython-35.pyc
│   │   │   └── entity.cpython-35.pyc
│   │   ├── config_validation.py
│   │   └── entity.py
│   ├── internal
│   │   ├── __init__.py
│   │   ├── __pycache__
│   │   │   ├── __init__.cpython-35.pyc
│   │   │   ├── debugger.cpython-35.pyc
│   │   │   ├── deps.cpython-35.pyc
│   │   │   ├── encoding.cpython-35.pyc
│   │   │   ├── formatting.cpython-35.pyc
│   │   │   ├── gi.cpython-35.pyc
│   │   │   └── path.cpython-35.pyc
│   │   ├── debugger.py
│   │   ├── deps.py
│   │   ├── encoding.py
│   │   ├── formatting.py
│   │   ├── gi.py
│   │   ├── path.py
│   │   └── system_utils.py
│   ├── listener.py
│   ├── loader.py
│   ├── log.py
│   ├── logger.py
│   ├── mpris.py
│   ├── player.py
│   ├── receiver.py
│   ├── scripts
│   │   ├── __init__.py
│   │   ├── __pycache__
│   │   │   ├── __init__.cpython-35.pyc
│   │   │   └── cli.cpython-35.pyc
│   │   ├── cli.py
│   │   └── config.py
│   ├── speaker.py
│   ├── subprocess.py
│   ├── tasker.py
│   ├── tools
│   │   ├── __init__.py
│   │   ├── __pycache__
│   │   │   ├── __init__.cpython-35.pyc
│   │   │   ├── package.cpython-35.pyc
│   │   │   └── verify.cpython-35.pyc
│   │   ├── package.py
│   │   └── verify.py
│   └── utility
│       ├── __init__.py
│       ├── __pycache__
│       │   ├── __init__.cpython-35.pyc
│       │   ├── dbus_runner.cpython-35.pyc
│       │   ├── dbus_utils.cpython-35.pyc
│       │   ├── distance.cpython-35.pyc
│       │   ├── dt.cpython-35.pyc
│       │   ├── generators.cpython-35.pyc
│       │   ├── gnome.cpython-35.pyc
│       │   ├── location.cpython-35.pyc
│       │   ├── temperature.cpython-35.pyc
│       │   ├── thread.cpython-35.pyc
│       │   ├── threadmanager.cpython-35.pyc
│       │   ├── unit_system.cpython-35.pyc
│       │   └── yaml.cpython-35.pyc
│       ├── audio.py
│       ├── dbus_runner.py
│       ├── dbus_utils.py
│       ├── distance.py
│       ├── dt.py
│       ├── file.py
│       ├── generators.py
│       ├── gnome.py
│       ├── location.py
│       ├── temperature.py
│       ├── thread.py
│       ├── threadmanager.py
│       ├── unit_system.py
│       └── yaml.py
├── scarlett_os.sublime-project
├── scarlett_os_notes.md
├── scripts
│   ├── docker
│   │   └── exec-master
│   ├── fix_pulse.sh
│   ├── generate_sublime3_anaconda_config.sh
│   ├── install_openssl_and_py_cryptography.sh
│   ├── lint
│   ├── mainloop_terminate_ctrl_c.py
│   ├── pdbrc
│   ├── pdbrc.py
│   └── remove_non_utf8.sh
├── setup.cfg
├── setup.py
├── src
│   ├── pip-delete-this-directory.txt
│   └── pytest-flakefinder
│       ├── CHANGELOG.md
│       ├── LICENSE
│       ├── MANIFEST.in
│       ├── README.rst
│       ├── docs
│       │   └── index.md
│       ├── mkdocs.yml
│       ├── pytest_flakefinder.py
│       ├── setup.cfg
│       ├── setup.py
│       ├── tests
│       │   ├── conftest.py
│       │   └── test_flakefinder.py
│       └── tox.ini
├── static
│   ├── noise.prof
│   ├── sounds
│   │   ├── pi-cancel.2.wav
│   │   ├── pi-cancel.wav
│   │   ├── pi-listening.2.wav
│   │   ├── pi-listening.wav
│   │   ├── pi-loading.wav
│   │   ├── pi-response.wav
│   │   └── pi-response2.wav
│   └── speech
│       ├── corpus
│       │   └── scarlett.corpus
│       ├── dict
│       │   ├── 0104.dic
│       │   ├── 1473.dic
│       │   ├── 1602.dic
│       │   ├── 6404.dic
│       │   ├── 7219.dic
│       │   ├── 7254.dic
│       │   ├── 7597.dic
│       │   └── 7840.dic
│       ├── grammer
│       │   └── scarlett.jsgf
│       ├── hmm
│       │   └── en_US
│       │       └── hub4wsj_sc_8k
│       │           ├── feat.params
│       │           ├── mdef
│       │           ├── means
│       │           ├── noisedict
│       │           ├── sendump
│       │           ├── transition_matrices
│       │           └── variances
│       ├── http
│       │   └── hue_api_lights_resp.json
│       ├── lm
│       │   ├── 0104.lm
│       │   ├── 1473.lm
│       │   ├── 1602.lm
│       │   ├── 6404.lm
│       │   ├── 7219.lm
│       │   ├── 7254.lm
│       │   ├── 7597.lm
│       │   └── 7840.lm
│       ├── mp4
│       │   ├── turn_lights_red.mp4
│       │   ├── turn_on_the_lights.mp4
│       │   └── whats_the_weather.mp4
│       ├── vocab
│       │   ├── 0104.vocab
│       │   ├── 1602.vocab
│       │   ├── 7219.vocab
│       │   ├── 7254.vocab
│       │   ├── 7597.vocab
│       │   └── 7840.vocab
│       └── wav
│           └── turn_lights_red.wav
├── tests
│   ├── __init__.py
│   ├── __pycache__
│   │   ├── __init__.cpython-35.pyc
│   │   ├── common.cpython-35.pyc
│   │   └── conftest.cpython-35-PYTEST.pyc
│   ├── common.py
│   ├── common_integration.py
│   ├── conftest.py
│   ├── data
│   │   └── samples
│   │       ├── fixture_scarlett-riff-little-endian-16bit-16kh-wave-file.wav
│   │       ├── fixture_turn_lights_red-riff-little-endian-16bit-16kh-wave-file.wav
│   │       └── fixture_what_time_is_it-riff-little-endian-16bit-16kh-wave-file.wav
│   ├── integrationtests
│   │   ├── README.md
│   │   ├── __init__.py
│   │   ├── __pycache__
│   │   │   ├── __init__.cpython-35.pyc
│   │   │   ├── baseclass.cpython-35.pyc
│   │   │   ├── conftest.cpython-35-PYTEST.pyc
│   │   │   ├── stubs.cpython-35.pyc
│   │   │   ├── test_integration_end_to_end.cpython-35-PYTEST.pyc
│   │   │   ├── test_integration_listener.cpython-35-PYTEST.pyc
│   │   │   ├── test_integration_mpris.cpython-35-PYTEST.pyc
│   │   │   ├── test_integration_player.cpython-35-PYTEST.pyc
│   │   │   ├── test_integration_tasker.cpython-35-PYTEST.pyc
│   │   │   └── test_integration_threadmanager.cpython-35-PYTEST.pyc
│   │   ├── baseclass.py
│   │   ├── stubs.py
│   │   ├── test_integration_end_to_end.py
│   │   ├── test_integration_listener.py
│   │   ├── test_integration_mpris.py
│   │   ├── test_integration_player.py
│   │   ├── test_integration_tasker.py
│   │   ├── test_integration_tasker.py.enable_sound.diff
│   │   └── test_integration_threadmanager.py
│   ├── performancetests
│   │   ├── __init__.py
│   │   └── baseclass.py
│   ├── run_all_tests
│   ├── run_dbus_tests.sh
│   ├── testing_config
│   │   └── custom_automations
│   │       ├── light
│   │       │   └── test.py
│   │       └── switch
│   │           └── test.py
│   ├── tools_common.py
│   ├── unit_scarlett_os.py
│   └── unittests
│       ├── __init__.py
│       ├── __pycache__
│       │   ├── __init__.cpython-35.pyc
│       │   ├── test_cli.cpython-35-PYTEST.pyc
│       │   ├── test_commands.cpython-35-PYTEST.pyc
│       │   ├── test_listener.cpython-35-PYTEST.pyc
│       │   ├── test_mpris.cpython-35-PYTEST.pyc
│       │   ├── test_player.cpython-35-PYTEST.pyc
│       │   ├── test_scarlett_os.cpython-35-PYTEST.pyc
│       │   ├── test_speaker.cpython-35-PYTEST.pyc
│       │   ├── test_subprocess.cpython-35-PYTEST.pyc
│       │   ├── test_tasker.cpython-35-PYTEST.pyc
│       │   └── test_threadmanager.cpython-35-PYTEST.pyc
│       ├...
Read more

Initial Integration testing via pytest

28 Jan 18:16
Compare
Choose a tag to compare
Pre-release

Features

  • Integration testing
  • Dbus session service per Integration test, keeps things isolated and allows us to test signals/methods
  • Fixes to DEBUG environment variables
  • Slight refactoring to dbus calls
  • Attempting to delete more code we don't use
  • Better usage of pdb

Note from PR being closed

We still haven't 100% gotten to the real solid refactor work. This sprint ended up being related to integration testing since I started introducing regressions into scarlett's code by making simple changes. Going forward I want to add more to the end-to-end testing suite to make sure we really capture all things that happen and report back correctly when things are wrong, but this is a good starting point.

Main things we added, individual dbus instances per test via pytest fixtures. Allows us to interact directly with an isolated instance of dbus per test. It is very difficult to mock out the entire pydbus class, so this gives us some degree of integration between services.

Also added a new class that can be used by Scarlett service to interact with dbus directly. Will need to go through and fix up her code / get ride of repeating code.

Still pushing for a SOLID refactor, but will continue to take time as I wrap my head around concepts and get exposed to some of the better code out there. Merging.

TL;DR - There is still a lot of ugly things I'm doing, but I'm learning a shit ton in the process, and it will all pay off in the end.

basics

07 Jan 16:11
Compare
Choose a tag to compare
basics Pre-release
Pre-release

All components of scarlettOS work in this release, but the code is brittle and needs heavy refactoring.