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