From patchwork Tue Oct 9 17:57:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cleber Rosa X-Patchwork-Id: 10633099 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CD71915E2 for ; Tue, 9 Oct 2018 18:06:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C7C0629496 for ; Tue, 9 Oct 2018 18:06:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BB8F4294FB; Tue, 9 Oct 2018 18:06:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 594C729496 for ; Tue, 9 Oct 2018 18:06:03 +0000 (UTC) Received: from localhost ([::1]:53246 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g9wOQ-0001Fk-Ck for patchwork-qemu-devel@patchwork.kernel.org; Tue, 09 Oct 2018 14:06:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56518) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g9wGW-0003dt-Qd for qemu-devel@nongnu.org; Tue, 09 Oct 2018 13:57:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g9wGT-0000xc-KF for qemu-devel@nongnu.org; Tue, 09 Oct 2018 13:57:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42108) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g9wGT-0000xM-C6 for qemu-devel@nongnu.org; Tue, 09 Oct 2018 13:57:49 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6684E30832D8; Tue, 9 Oct 2018 17:57:48 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-120-82.rdu2.redhat.com [10.10.120.82]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8C2E07E10E; Tue, 9 Oct 2018 17:57:41 +0000 (UTC) From: Cleber Rosa To: qemu-devel@nongnu.org Date: Tue, 9 Oct 2018 13:57:37 -0400 Message-Id: <20181009175740.13812-1-crosa@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Tue, 09 Oct 2018 17:57:48 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3 0/3] Bootstrap Python venv and acceptance/functional tests X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Eduardo Habkost , Laszlo Ersek , Cleber Rosa , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Philip?= =?utf-8?q?pe_Mathieu-Daud=C3=A9?= , Stefan Hajnoczi , Caio Carrara , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP TL;DR ===== Allow acceptance tests to be run with `make check-acceptance`. Details ======= This introduces a Python virtual environment that will be setup within the QEMU build directory, that will contain the exact environment that tests may require. There's one current caveat: it requires Python 3, as it's based on the venv module. This was based on some discussions and perception about standardizing on Python 3, but can easily be made to accommodate Python 2 as well. Changes from v2: ================ * Make the $(TESTS_VENV_DIR) target depend on the venv-requirements.txt file, and touch $(TESTS_VENV_DIR) after venv runs. With this, updates on the file are reflected on the venv. (Philippe) * Run pip with "python -m pip". It may have been installed reusing the system wide packages, and then the script may not be available on the venv. (Philippe) * Dropped Python version on Travis, and using the version supplied by the distro (3.4). (Philippe) * Added "python3.4-venv" package requirement on Travis. (Philippe) * Travis jobs have been sucesfully executed with this approach: https://travis-ci.org/philmd/qemu/jobs/439254826 * Added variable (AVOCADO_SHOW) with logging streams to be shown while running the acceptance tests. By default it's set to none, the equivalent of the quiet mode used on previous versions. (Philippe) * On Travis, set the AVOCADO_SHOW variable to "app", so that the individual test results can be easily seen. (Philippe) Ideas discussed, but not implemented: * Run pip with "$(PYTHON) -m pip -q install ..." because it points to the system wide Python installation. (Philippe) * Drop the "--system-site-packages" flag. Waiting on another round of tests to determine if they are really the cause of some package installation problems. Changes from v1: ================ * TESTS_VENV_REQ (the path of "venv-requirements.txt") now points to the source path ($SRC_PATH instead of $BUILD_DIR) * Create the venv with "--system-site-packages", which allows the reuse of packages (and no additional downloads) in case there's a package installed system wide providing the same package and version. * Run Avocado with "python -m avocado". It may have been installed reusing the system wide packages, and then the script may not be available on the venv. * Improved documentation describing the Python 3, venv and pip requirements. * Updated avocado-framework requirement to latest released version (65.0) * (New commit) Added support for running the acceptance tests on Travis. Ideas discussed, but not implemented: * Install external packages such as python3-pip on Debian based systems, deemed too invasive on developer's systems. * Allow the use of Python 2, and consequently the "virtualenv" module. Cleber Rosa (3): Bootstrap Python venv for tests Acceptance tests: add make rule for running them Travis support for the acceptance tests .travis.yml | 5 +++++ docs/devel/testing.rst | 35 ++++++++++++++++++++++++++++++----- tests/Makefile.include | 37 +++++++++++++++++++++++++++++++++++++ tests/venv-requirements.txt | 4 ++++ 4 files changed, 76 insertions(+), 5 deletions(-) create mode 100644 tests/venv-requirements.txt