| peusterm | 3791156 | 2018-10-18 15:03:55 +0200 | [diff] [blame] | 1 | #!/bin/bash |
| peusterm | 6558156 | 2019-11-13 12:49:15 +0100 | [diff] [blame] | 2 | # Copyright (c) 2015 SONATA-NFV and Paderborn University |
| 3 | # ALL RIGHTS RESERVED. |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | # |
| 17 | # Neither the name of the SONATA-NFV, Paderborn University |
| 18 | # nor the names of its contributors may be used to endorse or promote |
| 19 | # products derived from this software without specific prior written |
| 20 | # permission. |
| 21 | # |
| 22 | # This work has been performed in the framework of the SONATA project, |
| 23 | # funded by the European Commission under Grant number 671517 through |
| 24 | # the Horizon 2020 and 5G-PPP programmes. The authors would like to |
| 25 | # acknowledge the contributions of their colleagues of the SONATA |
| 26 | # partner consortium (www.sonata-nfv.eu). |
| 27 | |
| 28 | |
| peusterm | 3791156 | 2018-10-18 15:03:55 +0200 | [diff] [blame] | 29 | # helper script to be executed before committing |
| 30 | set -e |
| 31 | # trigger pep8 style check |
| 32 | echo "Doing flake8 style check ..." |
| peusterm | 8246f98 | 2019-06-06 17:43:34 +0200 | [diff] [blame] | 33 | flake8 --exclude=.eggs,build,devops,examples/charms --ignore=E501,W605,W504 . |
| peusterm | 3791156 | 2018-10-18 15:03:55 +0200 | [diff] [blame] | 34 | echo "done." |
| 35 | # trigger the tests |
| 36 | echo "Running unit tests ..." |
| 37 | sudo pytest -v |
| peusterm | 04e5f98 | 2018-10-31 19:50:16 +0100 | [diff] [blame] | 38 | # do everything in Docker, like it is done by Jenkins |
| 39 | docker build -t vim-emu-loc-test . |
| peusterm | 6558156 | 2019-11-13 12:49:15 +0100 | [diff] [blame] | 40 | docker run --rm --privileged --pid='host' -v /var/run/docker.sock:/var/run/docker.sock vim-emu-loc-test pip list |
| peusterm | 04e5f98 | 2018-10-31 19:50:16 +0100 | [diff] [blame] | 41 | docker run --rm --privileged --pid='host' -v /var/run/docker.sock:/var/run/docker.sock vim-emu-loc-test pytest -v |
| peusterm | 8246f98 | 2019-06-06 17:43:34 +0200 | [diff] [blame] | 42 | docker run --rm --privileged --pid='host' -v /var/run/docker.sock:/var/run/docker.sock vim-emu-loc-test flake8 --exclude=.eggs,devopsi,build,examples/charms --ignore=E501,W605,W504 . |
| peusterm | 3791156 | 2018-10-18 15:03:55 +0200 | [diff] [blame] | 43 | echo "done." |