Skip to content

Commit

Permalink
Add unit-testing to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
mickeprag committed Oct 25, 2018
1 parent 22b1aab commit e19a7fa
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
11 changes: 11 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,14 @@ pylint:
- apk add -U git
- pip install pylint
- pylint --rcfile=.pylintrc $(git ls-tree --name-only --full-tree -r HEAD | grep '\.py' | sort | tr '\n' ' ') || RETCODE=1

unittest:
image: python:2.7-alpine
stage: test
script:
- apk add -U bash gcc linux-headers musl-dev npm py2-virtualenv
- ./tellstick.sh setup
- ./tellstick.sh install events
- ./tellstick.sh install scheduler
- ./tellstick.sh install upgrade
- ./tellstick.sh test
3 changes: 3 additions & 0 deletions live/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
netifaces
pbkdf2
pycrypto
python-openid
requests
7 changes: 6 additions & 1 deletion tellstick.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ printHelp() {
echo -e " \t\t The server will be restarted automatically when a file changes"
echo -e " setup:\tSets up the virtualenv and installs a minium set of required plugins"
echo -e " shell:\tStarts a new shell with the virtualenv activated"
echo -e " test:\tRun unit testing"
echo -e " uninstall:\tUninstall a plugin. Usage:"
echo -e " \t\t $0 uninstall [plugin-name]"
echo -e " \t\t where [plugin-name] is the name of the plugin."
Expand All @@ -115,12 +116,13 @@ run() {

setup() {
PLUGINS="api base board developer live log sdk telldus web"
pip install -U -r requirements.txt

for plugin in $PLUGINS; do
PLUGINPATH="$BASEDIR/$plugin"
installPlugin $PLUGINPATH
done
# Setup git commit hooks
pip install -U -r requirements.txt
captainhook install --use-virtualenv-python
}

Expand Down Expand Up @@ -169,6 +171,9 @@ case $1 in
PS1='(TellStick) \[\033[01;32m\]\u@\h\[\033[01;34m\] \$\[\033[00m\] '
sh
;;
test)
python -m unittest tests
;;
uninstall)
pip uninstall $2
;;
Expand Down
6 changes: 6 additions & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-

# Enable once fixed that the server is not started when running. See #199
# from scheduler.base.tests import SchedulerTest

from upgrade.tests import HotFixManagerTest

0 comments on commit e19a7fa

Please sign in to comment.