From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 22706 invoked from network); 10 Oct 2021 17:51:56 -0000 Received: from lists.zx2c4.com (165.227.139.114) by inbox.vuxu.org with ESMTPUTF8; 10 Oct 2021 17:51:56 -0000 Received: by lists.zx2c4.com (ZX2C4 Mail Server) with ESMTP id b56a2729; Sun, 10 Oct 2021 17:51:38 +0000 (UTC) Return-Path: Received: from forward500o.mail.yandex.net (forward500o.mail.yandex.net [2a02:6b8:0:1a2d::610]) by lists.zx2c4.com (ZX2C4 Mail Server) with ESMTPS id 588194f9 (TLSv1.2:ECDHE-ECDSA-AES256-GCM-SHA384:256:NO) for ; Sun, 10 Oct 2021 17:51:36 +0000 (UTC) Received: from iva1-cda173853631.qloud-c.yandex.net (iva1-cda173853631.qloud-c.yandex.net [IPv6:2a02:6b8:c0c:9295:0:640:cda1:7385]) by forward500o.mail.yandex.net (Yandex) with ESMTP id 971879417AA; Sun, 10 Oct 2021 20:51:35 +0300 (MSK) Received: from iva7-f62245f79210.qloud-c.yandex.net (2a02:6b8:c0c:2e83:0:640:f622:45f7 [2a02:6b8:c0c:2e83:0:640:f622:45f7]) by iva1-cda173853631.qloud-c.yandex.net (mxback/Yandex) with ESMTP id 86WXfHAyk7-pZE0RfHe; Sun, 10 Oct 2021 20:51:35 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brnkv.ru; s=mail; t=1633888295; bh=+r3x4TqDKlcaNYaNjN535x5IG62KLplSusk6PUGgT+Y=; h=In-Reply-To:Message-ID:From:Date:References:To:Subject:Cc; b=VEWTCw1C8ZKH2ja8lix6aqHxMqYWUyzqU8QZxYdn6PkYE1xa1t2FmE57BAmV/OA9L MdcSjNtOhkCJ03bdeD97XKaCBkJUkaUxgfaWtn9IBXtKxZRa0fWGeOm/skiBpkmpZo 7ukv7wi9tXkfq2y+ftpU11BpX5n92oS7/fO/YlCs= Authentication-Results: iva1-cda173853631.qloud-c.yandex.net; dkim=pass header.i=@brnkv.ru Received: by iva7-f62245f79210.qloud-c.yandex.net (smtp/Yandex) with ESMTPS id ji9DeXe2SP-pYQ412ws; Sun, 10 Oct 2021 20:51:34 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) Subject: Re: [PATCH 0/2] Support of test results To: John Keeping , Sergey Bronnikov Cc: cgit@lists.zx2c4.com References: From: Sergey Bronnikov Message-ID: <0bce2d8f-19b0-51fb-1240-5993c2fb6d10@brnkv.ru> Date: Sun, 10 Oct 2021 20:51:33 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: cgit@lists.zx2c4.com X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: List for cgit developers and users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: cgit-bounces@lists.zx2c4.com Sender: "CGit" On 07.10.2021 12:42, John Keeping wrote: > On Mon, Oct 04, 2021 at 01:22:34PM +0300, Sergey Bronnikov wrote: >> From: Sergey Bronnikov >> >> Git SCM allows to store information in so called notes [1] and cgit >> allows to show notes that placed to default reference >> ('refs/notes/commits') and attached to certain commits. It is convenient >> to add various useful information related to commit in Git notes. >> >> Often tests results stored for future analysis in different systems (aka >> 'test report systems'). But one is the logic places to store test >> results is a Git SCM, test report automatically connected to commits and >> easily available for everyone. It even can be automated using git-test [2]. > This feels very specifc to one use case that isn't particularly general. > Have you considered any way to make this more generic for displaying > different notes for different purposes? In my experience different tools uses different git notes ref and it cannot be changed. For example: "git appraise" uses refs/notes/devtools/reviews, gerrit uses refs/notes/review and google-git-notes-publisher-plugin uses refs/notes/devtools/ci. I can make git note ref configurable. Will make it more general feature? > Did you experiment with changing notes.displayRef in gitconfing and > using the existing commit filter to display those inline in the commit > page? Sure, I know about default notes and experimented with commit filters a bit. I don't like to store test results in default ref because: - often test report has a long list of tests and it is inconvenient to scroll down it on cgit commit page. - it is inconvenient to parse test report format when it is mixed with commit message, > >> How-to use: >> >> $ cat report.tap >> 1..2 >> ok 1 - test_0.py::test_list_once >> ok 2 - test_0.py::test_list_twice >> $ GIT_NOTES_REF=refs/notes/testres git notes add -F report.tap 95aa7d200ee10580c472a1156a11c726046b110f >> $ git notes add -m 'Tested-by: Sergey Bronnikov ' \ >> 2a3a0d1a62de2ae5ab4511c15d82a6a0f2c2a930 >> $ GIT_NOTES_REF=refs/notes/testres git show 95aa7d200ee10580c472a1156a11c726046b110f >> >> commit 95aa7d200ee10580c472a1156a11c726046b110f >> Author: Sergey Bronnikov >> Date: Tue Dec 22 10:06:10 2020 +0300 >> >> ... >> >> Notes (testres): >> 1..2 >> ok 1 - test_0.py::test_list_once >> ok 2 - test_0.py::test_list_twice >> >> Test report become available in cgit by clicking to href 'tests' for >> that commit. >> >> 1. https://git-scm.com/docs/git-notes >> 2. https://github.com/ligurio/git-test >> 3. https://github.com/ligurio/testres/wiki/Using-GIT-as-a-storage >> >> Sergey Bronnikov (2): >> ui-commit: add support of test results >> ui-commit: add testres filter >> >> cgit.c | 6 +++ >> cgit.h | 4 +- >> cgitrc.5.txt | 17 +++++++++ >> cmd.c | 8 +++- >> filter.c | 6 +++ >> filters/testres-example.lua | 21 +++++++++++ >> shared.c | 1 + >> tests/setup.sh | 2 + >> tests/t0105-commit.sh | 7 ++++ >> tests/t0111-filter.sh | 8 ++++ >> ui-commit.c | 73 ++++++++++++++++++++++++++++++++++++- >> ui-commit.h | 1 + >> ui-shared.c | 8 +++- >> ui-shared.h | 3 ++ >> 14 files changed, 161 insertions(+), 4 deletions(-) >> create mode 100755 filters/testres-example.lua >> >> -- >> 2.25.1 >>