From 5ab23e65670f447175517c6745834985d7999914 Mon Sep 17 00:00:00 2001 From: Alexander Todorov Date: Thu, 26 Apr 2018 10:20:55 +0300 Subject: [PATCH] Enable testing in Travis and collecting of coverage history (cherry picked from commit 88139bcc03d6829d7251fbc5be03b7c38155d42d) --- .coveragerc | 3 +++ .travis.yml | 23 +++++++++++++++++++++++ Dockerfile.test | 14 ++++++++++++++ Makefile | 3 +++ 4 files changed, 43 insertions(+) create mode 100644 .coveragerc create mode 100644 .travis.yml create mode 100644 Dockerfile.test diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 00000000..2b9abc36 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,3 @@ +[paths] +source = . + /lorax/ diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..992f32c7 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,23 @@ +sudo: required +language: python +services: + - docker + +script: + - make test-in-docker + +after_success: + - | + + sudo docker create --name results-cont welder/lorax /bin/echo + sudo docker cp results-cont:/lorax/.coverage .coverage.docker + sudo docker rm results-cont + + pip install coverage coveralls + coverage combine + coveralls + +notifications: + email: + on_failure: change + on_success: never diff --git a/Dockerfile.test b/Dockerfile.test new file mode 100644 index 00000000..d592db60 --- /dev/null +++ b/Dockerfile.test @@ -0,0 +1,14 @@ +FROM fedora:rawhide + +RUN dnf -y install make libgit2-glib tito python3-pylint \ + python3-nose python3-mako python3-flask \ + python3-coverage libselinux-python3 sudo \ + pykickstart python3-pytoml python3-sphinx \ + python3-semantic_version \ + anaconda-tui + +RUN mkdir /lorax +COPY . /lorax + +WORKDIR /lorax +RUN make test diff --git a/Makefile b/Makefile index 55709e45..8a5c06ab 100644 --- a/Makefile +++ b/Makefile @@ -61,6 +61,9 @@ local: @rm -rf /var/tmp/$(PKGNAME)-$(VERSION) @echo "The archive is in $(PKGNAME)-$(VERSION).tar.gz" +test-in-docker: + sudo docker build -t welder/lorax:latest -f Dockerfile.test . + ci: check test .PHONY: docs