From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42855) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVYgt-0002Sw-3T for qemu-devel@nongnu.org; Tue, 16 Feb 2016 01:00:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aVYgp-0000kK-So for qemu-devel@nongnu.org; Tue, 16 Feb 2016 01:00:51 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43745) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVYgp-0000kA-Ht for qemu-devel@nongnu.org; Tue, 16 Feb 2016 01:00:47 -0500 Date: Tue, 16 Feb 2016 14:00:41 +0800 From: Fam Zheng Message-ID: <20160216060041.GE18664@ad.usersys.redhat.com> References: <1454664263-25969-1-git-send-email-famz@redhat.com> <1454664263-25969-5-git-send-email-famz@redhat.com> <878u2mnsyw.fsf@linaro.org> <8760xqnnvd.fsf@linaro.org> <20160215132959.GA18222@ad.usersys.redhat.com> <871t8enjxy.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <871t8enjxy.fsf@linaro.org> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 04/12] docker: Add test runner List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex =?iso-8859-1?Q?Benn=E9e?= Cc: kwolf@redhat.com, peter.maydell@linaro.org, sw@weilnetz.de, qemu-devel@nongnu.org, stefanha@redhat.com, Paolo Bonzini , jsnow@redhat.com, david@gibson.dropbear.id.au On Mon, 02/15 14:10, Alex Benn=E9e wrote: >=20 > Fam Zheng writes: >=20 > > On Mon, 02/15 12:45, Alex Benn=E9e wrote: > >> > >> Alex Benn=E9e writes: > >> > >> > Fam Zheng writes: > >> > > >> >> It's better to have a launcher for all tests, to make it easier t= o > >> >> initialize and manage the environment. > >> >> > >> >> Signed-off-by: Fam Zheng > >> >> --- > >> >> tests/docker/run | 23 +++++++++++++++++++++++ > >> >> 1 file changed, 23 insertions(+) > >> >> create mode 100755 tests/docker/run > >> >> > > >> OK that won't work if you have alternates in your git setup. It seem= s to > >> me the creation of the pristine tree for docker should be done befor= e we > >> enter the docker environment. > >> > >> There is a slight wrinkle as to what happens if the user wants to en= ter > >> an interactive session for debugging. However that doesn't seem poss= ible > >> via the makefile and perhaps that is just as well. Perhaps that shou= ld > >> be a helper script for the user? > > > > We can use "make distclean" in the copied tree. >=20 > I wouldn't - distclean isn't always that clean due to *mumble mumble* > makefile reasons. You could try this approach: >=20 > commit f838d3bbe2f71c731dfe172f1c3286084de203c8 > Author: Alex Benn=E9e > Date: Mon Feb 15 12:52:21 2016 +0000 >=20 > tests/docker/Makefile.include: snapshot the src for docker >=20 > Instead of providing a live version of the source tree to the docke= r > container we snapshot it with git-archive. This ensure the tree is = in a > pristine state for whatever operations the container is going to ru= n on > them. >=20 > Uncommitted changes known to files known by the git index will be > included in the snapshot if there are any. >=20 > Signed-off-by: Alex Benn=E9e >=20 > diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.incl= ude > index ca84c35..63a799c 100644 > --- a/tests/docker/Makefile.include > +++ b/tests/docker/Makefile.include > @@ -2,7 +2,7 @@ >=20 > $(if $(quiet-command),,$(eval include $(SRC_PATH)/rules.mak)) >=20 > -.PHONY: docker docker-build docker-run docker-clean > +.PHONY: docker docker-build docker-qemu-src docker-run docker-clean >=20 > DOCKER_SUFFIX =3D .docker >=20 > @@ -16,12 +16,17 @@ DOCKER_TOOLS :=3D $(filter-out test-%, $(DOCKER_SCR= IPTS)) > TESTS ?=3D % > IMAGES ?=3D % >=20 > +docker-qemu-src: > + $(if git diff-index --quiet HEAD --, \ > + git archive -1 HEAD --prefix=3Dqemu-docker-snapshot/ --format=3Dtar.= gz | tar -xz -C /tmp, \ > + git archive -1 `git stash create` --prefix=3Dqemu-docker-snapshot/ -= -format=3Dtar.gz | tar -xz -C /tmp) Does this clutter the user's git stash list? Or we can just error out if = the working tree is not clean. Fam