Skip to content

Commit

Permalink
adding testsuite run to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ivelin committed Sep 17, 2019
1 parent 7722627 commit cb2529f
Show file tree
Hide file tree
Showing 12 changed files with 102 additions and 17 deletions.
12 changes: 12 additions & 0 deletions ambianic-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh
# docker run -it ambianic/ambianic:v0.1.1
# docker run -it ambianic/ambianic bash
# python3 ambianic.py
# --rm : remove docker container on exit
docker run -it --rm \
--name ambianic-dev \
--mount type=bind,source="$(pwd)",target=/workspace \
--publish 1234:1234 \
--publish 8778:8778 \
--entrypoint 'bash' \
ambianic/ambianic:dev /workspace/tests/run-tests.sh
38 changes: 38 additions & 0 deletions ambianic.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Metadata-Version: 2.1
Name: ambianic
Version: 0.0.11
Summary: AI framework for home and business automation
Home-page: https://ambianic.ai
Author: Ivelin Ivanov
Author-email: [email protected]
License: UNKNOWN
Description: ![Build Status](https://travis-ci.org/ambianic/ambianic.svg?branch=master) ![Docker Automated](https://img.shields.io/docker/cloud/automated/ambianic/ambianic.svg) ![Docker Build](https://img.shields.io/docker/cloud/build/ambianic/ambianic.svg)

![Ambianic logo][logo]

# Project mission
Helpful AI for Home and Business Automation

Local data, custom AI models, federated learning

# Project Status
At this time, Ambianic is in active early formation stages. Lots of design and implementation decisions are made daily with focus on advancing the project to an initial stable version as soon as possible.

If you are willing to take the risk that comes with early stage code and are able to dive deep into Python, Javascript, Gstreamer, and Tensorflow code, then please keep reading. Otherwise click on the Watch button above (Releases Only option) to be notified when we release a stable end user version.

# How to run in development mode
If you are interested to try the development version, follow these steps:
1. Clone this git repository.
2. `./ambianic-start.sh`
3. Study `config.yaml` and go from there.

# Contributors
If you are interested in becoming a contributor to the project, please read the [Contributing](CONTRIBUTING.md) page and follow the steps. Looking forward to hearing from you!

[logo]: https://avatars2.githubusercontent.com/u/52052162?s=200&v=4

Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: Apache 2.0
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
22 changes: 22 additions & 0 deletions ambianic.egg-info/SOURCES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
README.md
setup.py
ambianic/__init__.py
ambianic/service.py
ambianic.egg-info/PKG-INFO
ambianic.egg-info/SOURCES.txt
ambianic.egg-info/dependency_links.txt
ambianic.egg-info/top_level.txt
ambianic/pipeline/__init__.py
ambianic/pipeline/gstreamer.py
ambianic/pipeline/interpreter.py
ambianic/pipeline/store.py
ambianic/pipeline/ai/__init__.py
ambianic/pipeline/ai/face_detect.py
ambianic/pipeline/ai/inference.py
ambianic/pipeline/ai/object_detect.py
ambianic/webapp/__init__.py
ambianic/webapp/flaskr.py
ambianic/webapp/server/__init__.py
ambianic/webapp/server/samples.py
tests/__init__.py
tests/startup_test.py
1 change: 1 addition & 0 deletions ambianic.egg-info/dependency_links.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

2 changes: 2 additions & 0 deletions ambianic.egg-info/top_level.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ambianic
tests
11 changes: 0 additions & 11 deletions ambianic.py

This file was deleted.

9 changes: 9 additions & 0 deletions ambianic/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@
from ambianic.webapp.flaskr import FlaskServer
from .pipeline.interpreter import PipelineServer
from .service import ServiceExit, ThreadedJob
import os

def main():
env_work_dir = os.environ.get('AMBIANIC_DIR', os.getcwd())
start(env_work_dir)


if __name__ == '__main__':
main()

WORK_DIR = None
AI_MODELS_DIR = "ai_models"
Expand Down
3 changes: 2 additions & 1 deletion ambianic/pipeline/gstreamer.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
from gi.repository import GObject, Gst, GLib

Gst.init(None)
GObject.threads_init()
# No need to call GObject.threads_init() since version 3.11
# GObject.threads_init()

log = logging.getLogger(__name__)

Expand Down
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
long_description = fh.read()

setuptools.setup(
name="ambianic-ivelin",
version="0.0.1",
name="ambianic",
version="0.0.11",
author="Ivelin Ivanov",
author_email="ivelin117@gmail.com",
author_email="ivelin117@ambianic.ai",
description="AI framework for home and business automation",
long_description=long_description,
long_description_content_type="text/markdown",
Expand All @@ -18,4 +18,4 @@
"License :: OSI Approved :: Apache 2.0",
"Operating System :: OS Independent",
],
)
)
Empty file added tests/__init__.py
Empty file.
12 changes: 12 additions & 0 deletions tests/run-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

# verbose mode, exit on error
set -ex

pip3 install -U pytest # unit test tool
BASEDIR=$(dirname $0)
echo "Script location: ${BASEDIR}"
# install ambianic package in edit mode
# cd $TESTS_DIR
# pip3 install -e "${BASEDIR}/../"
TESTS_DIR="${BASEDIR}/../tests"
python3 -m pytest $TESTS_DIR
1 change: 0 additions & 1 deletion startup_test.py → tests/startup_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ def test_no_work_dir():
def test_bad_work_dir():
with pytest.raises(AssertionError):
ambianic.start('/_/_/_dir_does_not_exist___')

0 comments on commit cb2529f

Please sign in to comment.