Change in vdsm[master]: tests: Run unit tests using travis-ci and docker

nsoffer at redhat.com nsoffer at redhat.com
Sun Mar 20 11:05:46 UTC 2016


Nir Soffer has posted comments on this change.

Change subject: tests: Run unit tests using travis-ci and docker
......................................................................


Patch Set 5:

(4 comments)

https://gerrit.ovirt.org/#/c/54856/5/.travis.yml
File .travis.yml:

Line 4:   - docker
Line 5: 
Line 6: # Disable depth (for ./autogen.sh --system to pass)
Line 7: git:
Line 8:   depth: 9999999
It works for me locally witrh centos:7 and fedora:23 images without this. Are you sure we need this?
Line 9: 
Line 10: before_install:
Line 11:   - docker --version
Line 12:   - docker pull edwardhaas/ovirt-vdsm-dev


Line 11:   - docker --version
Line 12:   - docker pull edwardhaas/ovirt-vdsm-dev
Line 13: 
Line 14: script:
Line 15:   - docker run --rm=true -it -v `pwd`:/vdsm:rw edwardhaas/ovirt-vdsm-dev /bin/bash -c "cd /vdsm && ./autogen.sh --system && make; make check-unit"
Nice, but are you sure we need --rm and running interactive session (-it)?

I tested this and this simpler command works - and does not change the image:

    docker run imagename bash -c "cd vdsm && ./autogen.sh --system && make && make check"

But I think we need to also control the git checkout - so we need:

    docker run imagename bash -c "git fetch https://gerrit.ovirt.org/vdsm refs/changes/56/54856/5 && git checkout FETCH_HEAD && cd vdsm && ./autogen.sh --system && make && make check"

This is super ugly but easy to change.

We should not to this checkout inside the image, so we can control which branch we want to test without changing the image, and also to be able to run the test on multiple images (fedora, centos, debian).


https://gerrit.ovirt.org/#/c/54856/5/contrib/Dockerfile
File contrib/Dockerfile:

Line 4:   yum update -y && yum install -y \
Line 5:   make autoconf automake git \
Line 6:   python-nose python-six python-devel libvirt-python python-netaddr python-inotify \
Line 7:   libselinux-python python-pthreading  python-cpopen mom && \
Line 8:   easy_install pip && easy_install pyflakes && pip install pep8==1.5.6
This is unreadable.

We should use this format:

    # Description..
    RUN yum install -y http://resources.ovirt.org/pub/yum-repo/ovirt-release-master.rpm

    # Description...
    yum update -y 

    # ...
    yum install -y \
        package \
        other \
        ...

    # ...
    RUN easy_install pip
    RUN pip install pyflakes pep8==version
Line 9: 
Line 10: CMD mkdir workspace && \
Line 11:     cd workspace && \
Line 12:     git clone http://gerrit.ovirt.org/p/vdsm.git && cd vdsm && \


Line 9: 
Line 10: CMD mkdir workspace && \
Line 11:     cd workspace && \
Line 12:     git clone http://gerrit.ovirt.org/p/vdsm.git && cd vdsm && \
Line 13:     ./autogen.sh --system; make; make check-unit
We should not clone entire vdsm history each time we build. We should clone the current history in a RUN command, so checking patches will be quick, and update the image from time to time to keep checkouts fast.

Or, we should do shallow checkouts - only the current source, no history.

We should not check master when we run the image, if you want to do that, it should be part of the travis yaml.

We should not run anything when this image starts. This way an image can be used as a quick way to get a working environment for new or casual contributors.

Finally, we should have also fedora and debian based images, it is easy to test a patch on all platforms.


-- 
To view, visit https://gerrit.ovirt.org/54856
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ia6cd647acb4c740f890e9b602783915439317880
Gerrit-PatchSet: 5
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Edward Haas <edwardh at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: David Caro <dcaro at redhat.com>
Gerrit-Reviewer: Edward Haas <edwardh at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Petr Horáček <phoracek at redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list