From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jostein_Kj=c3=b8nigsen?= Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Testing strategy for Tree-sitter modes Date: Sun, 8 Jan 2023 22:14:40 +0100 Message-ID: <2e370d5d-203e-7b5c-30d2-a3c4d8ca2b2f@secure.kjonigsen.net> References: Reply-To: jostein@kjonigsen.net Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24463"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jan 08 22:15:46 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pEd16-00067o-UH for ged-emacs-devel@m.gmane-mx.org; Sun, 08 Jan 2023 22:15:46 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pEd0E-0005a7-Rt; Sun, 08 Jan 2023 16:14:50 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pEd0D-0005Zy-AF for emacs-devel@gnu.org; Sun, 08 Jan 2023 16:14:49 -0500 Original-Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pEd0B-0008EZ-2J for emacs-devel@gnu.org; Sun, 08 Jan 2023 16:14:48 -0500 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id AB92E3200909 for ; Sun, 8 Jan 2023 16:14:43 -0500 (EST) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sun, 08 Jan 2023 16:14:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= secure.kjonigsen.net; h=cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:reply-to:sender :subject:subject:to:to; s=fm2; t=1673212483; x=1673298883; bh=W0 4fmN/42CyBenXJfi48WmPbnFUa9czLOb4EEiftnn8=; b=cqM3l2VzDQ4LNbkfMS fQbLT4xzxU3ZyNxCXw04gCUKzacX8pJEdPucm1hz6keQo3MJgu+pBqhg3Fl2Q7kB RlnDFb6XN9c3E+Qh1QdlmBB7CoAhUnOlkxLkbLqH2Q1MHorM4qbAKlT/63S+fT4o HnyNkZmw5V/OT1vHPN1mV0DuuKTI/0wnQ+pfhWjVdxy8u9wxqhA1VxIYskGe/hez gMyW5m7RnTOxQdKe23cVtybryeg0gGTFxBSYg+TAmXOJJrVGK8ECwos3IvB5FRlO 22BmYLEagrOHSPmBHniERl01x+t66jsxQOHnAJKWXtNrV5QAsZ+X60wjWVGDXfC1 HFUQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:feedback-id:feedback-id:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1673212483; x= 1673298883; bh=W04fmN/42CyBenXJfi48WmPbnFUa9czLOb4EEiftnn8=; b=Y bN8o3cdAElmEOEBjPkJViwUDx/V/9fe9bQCNE+ooNqfQnSjK9qqnZWHElBv3JP1y VLfmUUAxyIxSVa/wg71zykso1gnfoOJciGiBkQRWv7g4D4+1QATbXWRrZ5X6bqZt Ts9B4lmy0LpR921Ogyk23TLCOV22KmDRrbs3zivfinCUN5YpXjSiQ6FUvo79cJiv 1ylnxp+TDwKA3ay6g8wN5sya/rKPAAXX1nPdta+BV/RPNf6AqY5gWkTivgwph/i6 +ZiveTF2wBUxXUPlJgqo44SSi58CyxE6FdX0vIVNDyDvsEL3zZh853NmtVZ5kXnj jgE2YexYJlf5umvwWOnTA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrkeeggdduhedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfghruffvfhfhjggtgfesth ekredttdefjeenucfhrhhomheplfhoshhtvghinhcumfhjpphnihhgshgvnhcuoehjohhs thgvihhnsehsvggtuhhrvgdrkhhjohhnihhgshgvnhdrnhgvtheqnecuggftrfgrthhtvg hrnhepteelledvgfehjeeuvdefjeejhedtueefuefgkeefheelleeuudffkeehieehffeu necuffhomhgrihhnpehgnhhurdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomhepjhhoshhtvghinhesshgvtghurhgvrdhkjhhonhhighhs vghnrdhnvght X-ME-Proxy: Feedback-ID: ib2f84088:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Sun, 8 Jan 2023 16:14:42 -0500 (EST) Content-Language: en-GB, nb-NO In-Reply-To: Received-SPF: pass client-ip=64.147.123.24; envelope-from=jostein@secure.kjonigsen.net; helo=wout1-smtp.messagingengine.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:302292 Archived-At: On 08.01.2023 15:23, Daniel Martín wrote: > I think the development of Tree-sitter modes would benefit from having a > regression test suite that ensures that bug fixes for specific cases > don't regress in the future. > > As a start, I've attached to this mail some ERT-based tests for the > indentation feature of c-ts-mode. I've used the convenient feature of > "erts" files to create the tests, which I think make them readable and > maintainable. > > The tests are skipped if the Emacs build does not have Tree-sitter > enabled, or if the corresponding grammar is not installed. Perhaps it > would be a good idea to install these Tree-sitter dependencies in the > container images used for EMBA (https://emba.gnu.org/emacs), so that > we're able to run Tree-sitter tests in continuous integration, and even > play with different versions of Tree-sitter or the Tree-sitter grammars > to detect incompatibilities. I'll leave this decision to the people in > charge of EMBA. > > Thanks. > I fully support the addition of the possibility to have a test-suite run on CI. When we ported csharp-mode and typescript-mode from ELPA to new ts-based major modes in Emacs-core, I always felt like this was the one thing I really wished we'd have here as well. If this can be added easily, it would make it much easier (and safer!) to make changes to tree-sitter grammars in major-modes with complex grammer, and where it's not always obvious what rule covers what use-case(s). -- Jostein