From patchwork Sat Feb 29 00:00:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Fr=C3=A9d=C3=A9ric_Mangano-Tarumi?= X-Patchwork-Id: 1527 Return-Path: Delivered-To: patchwork@archlinux.org Received: from apollo.archlinux.org (localhost [127.0.0.1]) by apollo.archlinux.org (Postfix) with ESMTP id 5ABFD175613E1 for ; Sat, 29 Feb 2020 00:00:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on apollo.archlinux.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID=1, DKIM_SIGNED=0.1,MAILING_LIST_MULTI=-1,RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001 autolearn=ham autolearn_force=no version=3.4.4 X-Spam-BL-Results: [127.0.9.1] Received: from orion.archlinux.org (orion.archlinux.org [IPv6:2a01:4f8:160:6087::1]) by apollo.archlinux.org (Postfix) with ESMTPS for ; Sat, 29 Feb 2020 00:00:49 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 72B11198723BFE; Sat, 29 Feb 2020 00:00:47 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [IPv6:2a01:4f8:160:3033::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: luna) by orion.archlinux.org (Postfix) with ESMTPSA id 33AD2198723BFC; Sat, 29 Feb 2020 00:00:47 +0000 (UTC) Authentication-Results: orion.archlinux.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mg0.fr header.i=@mg0.fr header.b=1uD4S0/q Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id 175B229D0E; Sat, 29 Feb 2020 00:00:47 +0000 (UTC) Authentication-Results: luna.archlinux.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mg0.fr header.i=@mg0.fr header.b=1uD4S0/q Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id 80C9029D0C for ; Sat, 29 Feb 2020 00:00:43 +0000 (UTC) Received: from orion.archlinux.org (orion.archlinux.org [88.198.91.70]) by luna.archlinux.org (Postfix) with ESMTPS for ; Sat, 29 Feb 2020 00:00:43 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 8EAD4198723BF3 for ; Sat, 29 Feb 2020 00:00:39 +0000 (UTC) Received: from tsubame.mg0.fr (tsubame.mg0.fr [IPv6:2001:41d0:401:3100::402b]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by orion.archlinux.org (Postfix) with ESMTPS for ; Sat, 29 Feb 2020 00:00:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mg0.fr; s=tsubame; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID: Subject:To:From:Date:Sender:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=wGfWk1BOb0oJQWTJetCXX+vsmB+fLfliPWPRa8k6j/E=; b=1uD4S0/qJ/ocS4RxdlAjOZ9K/U n7Vt3jB0VOa9WgzMVV71cGXAjpnnSy1l+2BkrRoCLOoZwwTiT/GNpkEUuFpX3g4e+RYUu8aMUYBOU FrQFsvqySO6J6K2GpJVabrDLTJqXojJjEmcYtXWo/YrvGmCN1hp/DB1SqCcwIXGzIJRI=; Received: from fmang by tsubame.mg0.fr with local (Exim 4.93) (envelope-from ) id 1j7pYc-006hLd-6y for aur-dev@archlinux.org; Sat, 29 Feb 2020 01:00:38 +0100 Date: Sat, 29 Feb 2020 01:00:38 +0100 From: =?utf-8?b?RnLDqWTDqXJpYw==?= Mangano-Tarumi To: aur-dev@archlinux.org Subject: [PATCH 1/4] TESTING: Step for installing the Python package Message-ID: <20200229000038.GA1596596@tsubame.mg0.fr> MIME-Version: 1.0 Content-Disposition: inline X-BeenThere: aur-dev@archlinux.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Arch User Repository \(AUR\) Development" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: aur-dev-bounces@archlinux.org Sender: "aur-dev" --- TESTING | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/TESTING b/TESTING index 4a1e6f4c..7476bc97 100644 --- a/TESTING +++ b/TESTING @@ -22,7 +22,16 @@ INSTALL. Be sure to change backend to sqlite and name to the file location of your created test database. -4) Prepare the testing database: +4) Install the aurweb Python package: + + $ cd /path/to/aurweb/ + # Optionally create a virtualenv and activate it. + $ pip install -e . + + Note that the with -e option, you don’t need to rerun pip install when the + code changes. When working without a virtualenv, you may need --user. + +5) Prepare the testing database: $ cd /path/to/aurweb/ $ python -m aurweb.initdb @@ -31,6 +40,6 @@ INSTALL. $ ./gendummydata.py out.sql $ sqlite3 path/to/aurweb.sqlite3 < out.sql -5) Run the PHP built-in web server: +6) Run the PHP built-in web server: $ AUR_CONFIG='/path/to/aurweb/conf/config' php -S localhost:8080 -t /path/to/aurweb/web/html From patchwork Sat Feb 29 00:01:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Fr=C3=A9d=C3=A9ric_Mangano-Tarumi?= X-Patchwork-Id: 1528 Return-Path: Delivered-To: patchwork@archlinux.org Received: from apollo.archlinux.org (localhost [127.0.0.1]) by apollo.archlinux.org (Postfix) with ESMTP id 8B32C175618A5 for ; Sat, 29 Feb 2020 00:06:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on apollo.archlinux.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=DKIM_INVALID=1, DKIM_SIGNED=0.1,MAILING_LIST_MULTI=-1,RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001 autolearn=ham autolearn_force=no version=3.4.4 X-Spam-BL-Results: [127.0.9.2] Received: from orion.archlinux.org (orion.archlinux.org [88.198.91.70]) by apollo.archlinux.org (Postfix) with ESMTPS for ; Sat, 29 Feb 2020 00:06:22 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 31675198739D59; Sat, 29 Feb 2020 00:04:21 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [5.9.250.164]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: luna) by orion.archlinux.org (Postfix) with ESMTPSA id B71B2198739D4D; Sat, 29 Feb 2020 00:03:18 +0000 (UTC) Authentication-Results: orion.archlinux.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mg0.fr header.i=@mg0.fr header.b=S3FBmH73 Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id A86EF29D0E; Sat, 29 Feb 2020 00:03:18 +0000 (UTC) Authentication-Results: luna.archlinux.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mg0.fr header.i=@mg0.fr header.b=S3FBmH73 Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id D3A6529D0B for ; Sat, 29 Feb 2020 00:03:15 +0000 (UTC) Received: from orion.archlinux.org (orion.archlinux.org [88.198.91.70]) by luna.archlinux.org (Postfix) with ESMTPS for ; Sat, 29 Feb 2020 00:03:15 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 1C150198739D3A for ; Sat, 29 Feb 2020 00:02:34 +0000 (UTC) Received: from tsubame.mg0.fr (tsubame.mg0.fr [IPv6:2001:41d0:401:3100::402b]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by orion.archlinux.org (Postfix) with ESMTPS for ; Sat, 29 Feb 2020 00:02:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mg0.fr; s=tsubame; h=Content-Type:MIME-Version:Message-ID:Subject:To:From:Date:Sender :Reply-To:Cc:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=vheHQjzlT+Mvwgpiz//e2UjxV0U/F4edRXN72KUBFe0=; b=S3FBmH73LnaWoNALEfn6FGp8Lu iBpgOzNYCtNqlfFXSf+luQPu+tFJS6TuBHtZqt8HTmGWzyrFy+C68SCFIv5MZDxqHdwCqQh30e9lz fCB8iigrrgyiwYwBoIEkunOpRv2ha3Kk3O/JXFyHcEUeQTHj9qIKhMdPkF7LSkS+cYpQ=; Received: from fmang by tsubame.mg0.fr with local (Exim 4.93) (envelope-from ) id 1j7pZa-006hMA-Pq for aur-dev@archlinux.org; Sat, 29 Feb 2020 01:01:38 +0100 Date: Sat, 29 Feb 2020 01:01:38 +0100 From: =?utf-8?b?RnLDqWTDqXJpYw==?= Mangano-Tarumi To: aur-dev@archlinux.org Subject: [PATCH 2/4] Support running tests from any directory Message-ID: <20200229000138.GA1596609@tsubame.mg0.fr> MIME-Version: 1.0 Content-Disposition: inline X-BeenThere: aur-dev@archlinux.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Arch User Repository \(AUR\) Development" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: aur-dev-bounces@archlinux.org Sender: "aur-dev" --- test/setup.sh | 5 ++--- test/t1100-git-auth.t | 2 +- test/t1200-git-serve.t | 2 +- test/t1300-git-update.t | 2 +- test/t2100-mkpkglists.t | 2 +- test/t2200-tuvotereminder.t | 2 +- test/t2300-pkgmaint.t | 2 +- test/t2400-aurblup.t | 2 +- test/t2500-notify.t | 2 +- test/t2600-rendercomment.t | 2 +- test/t2700-usermaint.t | 2 +- 11 files changed, 12 insertions(+), 13 deletions(-) diff --git a/test/setup.sh b/test/setup.sh index cad5cd66..4a6eb3b1 100644 --- a/test/setup.sh +++ b/test/setup.sh @@ -1,7 +1,6 @@ -TEST_DIRECTORY="$(pwd)" -TOPLEVEL="$(cd .. && pwd)" +TOPLEVEL="$(cd "$(dirname "$0")/.." && pwd)" -. ./sharness.sh +. "$TOPLEVEL/test/sharness.sh" # Configure python search path. PYTHONPATH="$TOPLEVEL" diff --git a/test/t1100-git-auth.t b/test/t1100-git-auth.t index 71d526f2..cbf16aed 100755 --- a/test/t1100-git-auth.t +++ b/test/t1100-git-auth.t @@ -2,7 +2,7 @@ test_description='git-auth tests' -. ./setup.sh +. "$(dirname "$0")/setup.sh" test_expect_success 'Test basic authentication.' ' "$GIT_AUTH" "$AUTH_KEYTYPE_USER" "$AUTH_KEYTEXT_USER" >out && diff --git a/test/t1200-git-serve.t b/test/t1200-git-serve.t index e817b2cf..1893cdcd 100755 --- a/test/t1200-git-serve.t +++ b/test/t1200-git-serve.t @@ -2,7 +2,7 @@ test_description='git-serve tests' -. ./setup.sh +. "$(dirname "$0")/setup.sh" test_expect_success 'Test interactive shell.' ' "$GIT_SERVE" 2>&1 | grep -q "Interactive shell is disabled." diff --git a/test/t1300-git-update.t b/test/t1300-git-update.t index 06d14984..82c0fb99 100755 --- a/test/t1300-git-update.t +++ b/test/t1300-git-update.t @@ -2,7 +2,7 @@ test_description='git-update tests' -. ./setup.sh +. "$(dirname "$0")/setup.sh" dump_package_info() { for t in Packages Licenses PackageLicenses Groups PackageGroups \ diff --git a/test/t2100-mkpkglists.t b/test/t2100-mkpkglists.t index fc11d073..5bf13de8 100755 --- a/test/t2100-mkpkglists.t +++ b/test/t2100-mkpkglists.t @@ -2,7 +2,7 @@ test_description='mkpkglists tests' -. ./setup.sh +. "$(dirname "$0")/setup.sh" test_expect_success 'Test package list generation with no packages.' ' echo "DELETE FROM Packages;" | sqlite3 aur.db && diff --git a/test/t2200-tuvotereminder.t b/test/t2200-tuvotereminder.t index c82ce874..5a8f3a25 100755 --- a/test/t2200-tuvotereminder.t +++ b/test/t2200-tuvotereminder.t @@ -2,7 +2,7 @@ test_description='tuvotereminder tests' -. ./setup.sh +. "$(dirname "$0")/setup.sh" test_expect_success 'Test Trusted User vote reminders.' ' now=$(date -d now +%s) && diff --git a/test/t2300-pkgmaint.t b/test/t2300-pkgmaint.t index 478df526..c390f5db 100755 --- a/test/t2300-pkgmaint.t +++ b/test/t2300-pkgmaint.t @@ -2,7 +2,7 @@ test_description='pkgmaint tests' -. ./setup.sh +. "$(dirname "$0")/setup.sh" test_expect_success 'Test package base cleanup script.' ' now=$(date -d now +%s) && diff --git a/test/t2400-aurblup.t b/test/t2400-aurblup.t index 708281c6..cc287a0f 100755 --- a/test/t2400-aurblup.t +++ b/test/t2400-aurblup.t @@ -2,7 +2,7 @@ test_description='aurblup tests' -. ./setup.sh +. "$(dirname "$0")/setup.sh" test_expect_success 'Test official provider update script.' ' mkdir -p remote/test/foobar-1.0-1 && diff --git a/test/t2500-notify.t b/test/t2500-notify.t index 380e65b8..5ef64c18 100755 --- a/test/t2500-notify.t +++ b/test/t2500-notify.t @@ -2,7 +2,7 @@ test_description='notify tests' -. ./setup.sh +. "$(dirname "$0")/setup.sh" test_expect_success 'Test out-of-date notifications.' ' cat <<-EOD | sqlite3 aur.db && diff --git a/test/t2600-rendercomment.t b/test/t2600-rendercomment.t index be408b80..e01904c6 100755 --- a/test/t2600-rendercomment.t +++ b/test/t2600-rendercomment.t @@ -2,7 +2,7 @@ test_description='rendercomment tests' -. ./setup.sh +. "$(dirname "$0")/setup.sh" test_expect_success 'Test comment rendering.' ' cat <<-EOD | sqlite3 aur.db && diff --git a/test/t2700-usermaint.t b/test/t2700-usermaint.t index 4f625142..f0bb449b 100755 --- a/test/t2700-usermaint.t +++ b/test/t2700-usermaint.t @@ -2,7 +2,7 @@ test_description='usermaint tests' -. ./setup.sh +. "$(dirname "$0")/setup.sh" test_expect_success 'Test removal of login IP addresses.' ' now=$(date -d now +%s) && From patchwork Sat Feb 29 00:02:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Fr=C3=A9d=C3=A9ric_Mangano-Tarumi?= X-Patchwork-Id: 1529 Return-Path: Delivered-To: patchwork@archlinux.org Received: from apollo.archlinux.org (localhost [127.0.0.1]) by apollo.archlinux.org (Postfix) with ESMTP id F386C175618FB for ; Sat, 29 Feb 2020 00:06:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on apollo.archlinux.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID=1, DKIM_SIGNED=0.1,MAILING_LIST_MULTI=-1,RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001 autolearn=ham autolearn_force=no version=3.4.4 X-Spam-BL-Results: [127.0.9.1] Received: from orion.archlinux.org (orion.archlinux.org [IPv6:2a01:4f8:160:6087::1]) by apollo.archlinux.org (Postfix) with ESMTPS for ; Sat, 29 Feb 2020 00:06:44 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 35E3A198739D82; Sat, 29 Feb 2020 00:04:38 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [IPv6:2a01:4f8:160:3033::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: luna) by orion.archlinux.org (Postfix) with ESMTPSA id 2A128198739D60; Sat, 29 Feb 2020 00:04:24 +0000 (UTC) Authentication-Results: orion.archlinux.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mg0.fr header.i=@mg0.fr header.b=L9lfhPDL Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id E7F3629D0E; Sat, 29 Feb 2020 00:04:23 +0000 (UTC) Authentication-Results: luna.archlinux.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mg0.fr header.i=@mg0.fr header.b=L9lfhPDL Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id 8FDC429D0B for ; Sat, 29 Feb 2020 00:04:21 +0000 (UTC) Received: from orion.archlinux.org (orion.archlinux.org [88.198.91.70]) by luna.archlinux.org (Postfix) with ESMTPS for ; Sat, 29 Feb 2020 00:04:21 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 71C97198739D3D for ; Sat, 29 Feb 2020 00:02:34 +0000 (UTC) Received: from tsubame.mg0.fr (tsubame.mg0.fr [IPv6:2001:41d0:401:3100::402b]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by orion.archlinux.org (Postfix) with ESMTPS for ; Sat, 29 Feb 2020 00:02:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mg0.fr; s=tsubame; h=Content-Type:MIME-Version:Message-ID:Subject:To:From:Date:Sender :Reply-To:Cc:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=uUcgKLhk7zn5evaVrFSf/JMH81riFtFwdgmzRsVA5WU=; b=L9lfhPDLvS1fA9FjoBJqcHAggH LHaDZw/gnGY8fPTxZu9CFmh4zTWPcV62xGFL35s/becnvav/7ksXiSRFvH6dCh6geuKV7if1G3SoI B9bvGO/ui7ZqCJTQ3BYhJSlW9RK79cVJc2qgKT8wuNlAu+P55Wx+KAPwY5bsjwh4HAAg=; Received: from fmang by tsubame.mg0.fr with local (Exim 4.93) (envelope-from ) id 1j7pa0-006hMN-Ot for aur-dev@archlinux.org; Sat, 29 Feb 2020 01:02:04 +0100 Date: Sat, 29 Feb 2020 01:02:04 +0100 From: =?utf-8?b?RnLDqWTDqXJpYw==?= Mangano-Tarumi To: aur-dev@archlinux.org Subject: [PATCH 3/4] test/Makefile: Run tests with prove when available Message-ID: <20200229000204.GA1596640@tsubame.mg0.fr> MIME-Version: 1.0 Content-Disposition: inline X-BeenThere: aur-dev@archlinux.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Arch User Repository \(AUR\) Development" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: aur-dev-bounces@archlinux.org Sender: "aur-dev" --- test/Makefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/Makefile b/test/Makefile index d310c8f5..758befa3 100644 --- a/test/Makefile +++ b/test/Makefile @@ -1,6 +1,13 @@ T = $(sort $(wildcard *.t)) +PROVE := $(shell command -v prove 2> /dev/null) + +ifdef PROVE +check: + prove . +else check: $(T) +endif clean: $(RM) -r test-results/ From patchwork Sat Feb 29 00:02:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Fr=C3=A9d=C3=A9ric_Mangano-Tarumi?= X-Patchwork-Id: 1530 Return-Path: Delivered-To: patchwork@archlinux.org Received: from apollo.archlinux.org (localhost [127.0.0.1]) by apollo.archlinux.org (Postfix) with ESMTP id 9225917561A29 for ; Sat, 29 Feb 2020 00:08:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on apollo.archlinux.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=DKIM_INVALID=1, DKIM_SIGNED=0.1,MAILING_LIST_MULTI=-1,RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001 autolearn=ham autolearn_force=no version=3.4.4 X-Spam-BL-Results: [127.0.9.2] Received: from orion.archlinux.org (orion.archlinux.org [88.198.91.70]) by apollo.archlinux.org (Postfix) with ESMTPS for ; Sat, 29 Feb 2020 00:08:24 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id D4AAF198739DB1; Sat, 29 Feb 2020 00:05:30 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [5.9.250.164]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: luna) by orion.archlinux.org (Postfix) with ESMTPSA id 2D743198739D77; Sat, 29 Feb 2020 00:04:35 +0000 (UTC) Authentication-Results: orion.archlinux.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mg0.fr header.i=@mg0.fr header.b=t8Qg1IEJ Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id 20C9329D0E; Sat, 29 Feb 2020 00:04:35 +0000 (UTC) Authentication-Results: luna.archlinux.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mg0.fr header.i=@mg0.fr header.b=t8Qg1IEJ Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id 2F42229D0B for ; Sat, 29 Feb 2020 00:04:32 +0000 (UTC) Received: from orion.archlinux.org (orion.archlinux.org [IPv6:2a01:4f8:160:6087::1]) by luna.archlinux.org (Postfix) with ESMTPS for ; Sat, 29 Feb 2020 00:04:32 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id AB765198739D48 for ; Sat, 29 Feb 2020 00:03:15 +0000 (UTC) Received: from tsubame.mg0.fr (tsubame.mg0.fr [IPv6:2001:41d0:401:3100::402b]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by orion.archlinux.org (Postfix) with ESMTPS for ; Sat, 29 Feb 2020 00:03:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mg0.fr; s=tsubame; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID: Subject:To:From:Date:Sender:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=rOzG8o99AoM7J0jqjajil94ypg6dyu6EEHjpcOahMxU=; b=t8Qg1IEJinJfJ0R3G143LgUhWX EMm106jYByMHsizo4bVqBMshKpkdVYG4Z71aZ9SgTKKKXZHZHoPloGMb2AkHm8e0iICYchaf9JLOe 4xXMZIFHPNjQc/RpZ3w5O7fk2vcv3U28nqFkbqVjht3DWcevA1gdFLIYqt8Z7z8k6EBs=; Received: from fmang by tsubame.mg0.fr with local (Exim 4.93) (envelope-from ) id 1j7pac-006hMZ-Q2 for aur-dev@archlinux.org; Sat, 29 Feb 2020 01:02:42 +0100 Date: Sat, 29 Feb 2020 01:02:42 +0100 From: =?utf-8?b?RnLDqWTDqXJpYw==?= Mangano-Tarumi To: aur-dev@archlinux.org Subject: [PATCH 4/4] Write test/README.md to help working with tests Message-ID: <20200229000242.GA1596653@tsubame.mg0.fr> MIME-Version: 1.0 Content-Disposition: inline X-BeenThere: aur-dev@archlinux.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Arch User Repository \(AUR\) Development" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: aur-dev-bounces@archlinux.org Sender: "aur-dev" --- test/README.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 test/README.md diff --git a/test/README.md b/test/README.md new file mode 100644 index 00000000..c48001d8 --- /dev/null +++ b/test/README.md @@ -0,0 +1,38 @@ +Running tests +------------- + +To run all the tests, you may run `make check` under `test/`. + +For more control, you may use the `prove` command, which receives a directory or +a list of files to run, and produces a report. + +Each test script is standalone, so you may run them individually. Some tests may +receive command-line options to help debugging. See for example sharness’s +documentation for shell test scripts: +https://github.com/chriscool/sharness/blob/master/README.git + +### Dependencies + +For all the test to run, the following Arch packages should be installed: + +- pyalpm +- python-alembic +- python-bleach +- python-markdown +- python-pygit2 +- python-sqlalchemy +- python-srcinfo + + +Writing tests +------------- + +Test scripts must follow the Test Anything Protocol specification: +http://testanything.org/tap-specification.html + +Tests must support being run from any directory. They may use $0 to determine +their location. Python scripts should expect aurweb to be installed and +importable without toying with os.path or PYTHONPATH. + +Tests written in shell should use sharness. In general, new tests should be +consistent with existing tests unless they have a good reason not to.