Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nJil8-0003PV-SS for pgsql-hackers@arkaria.postgresql.org; Mon, 14 Feb 2022 21:19:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nJil7-0001G4-Ny for pgsql-hackers@arkaria.postgresql.org; Mon, 14 Feb 2022 21:19:45 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nJil7-0001Fv-EW for pgsql-hackers@lists.postgresql.org; Mon, 14 Feb 2022 21:19:45 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nJil4-0005g4-L4 for pgsql-hackers@lists.postgresql.org; Mon, 14 Feb 2022 21:19:45 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 21ELJeIg2927291; Mon, 14 Feb 2022 16:19:40 -0500 From: Tom Lane To: Matheus Alcantara cc: pgsql-hackers@lists.postgresql.org Subject: Re: [PATCH] Add tests for psql tab completion In-reply-to: References: <2920743.1644868864@sss.pgh.pa.us> Comments: In-reply-to Matheus Alcantara message dated "Mon, 14 Feb 2022 20:12:10 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2927289.1644873580.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 14 Feb 2022 16:19:40 -0500 Message-ID: <2927290.1644873580@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk [ Please keep the mailing list cc'd ] Matheus Alcantara writes: > On Monday, February 14th, 2022 at 17:01, Tom Lane wr= ote: >> What exactly is the motivation for these particular tests? > I was studying the source code and looking for projects that I could con= tribute so I decided > to start with tests, so I ran coverage and started with files that had l= ittle coverage, realized > that psql tab completion ones had little coverage so I decided to add so= me tests, I tried to > start with the simplest. > I understand that the patch may not be as much of a need, I just wanted = to try and help with something. > Do you think there would be other tests that should be done? I would lik= e to try to contribute. There's certainly lots of places that could use more test coverage. But I think that making a meaningful difference in tab-complete.c would require writing test cases to hit most of the if-else branches, which doesn't seem very profitable either in terms of test-writing effort or in terms of the cycles that'd be spent on running those tests forevermore. We try to be thrifty about how much work is done by check-world, because it's a real advantage for development that that takes a small number of minutes and not hours. I'm not really seeing that covering more of tab-complete would buy much. As for areas that *do* need more coverage, the first one that I come across in looking through the coverage report is GIST index build: gistbuild.c is only showing 45% coverage, and gistbuildbuffers.c a fat zero [1]. We've looked at that before [2] but not made much progress on developing an adequately cheap test case. Maybe you could pick up where that thread left off? Or if that doesn't seem interesting to you, there's lots of other possibilities. I'd suggest getting some buy-in from this list on what to work on before you start, though. regards, tom lane [1] https://coverage.postgresql.org/src/backend/access/gist/index.html [2] https://www.postgresql.org/message-id/flat/10261.1588705157%40sss.pgh.= pa.us#46b998e6585f0bf0fd7b75703b43decb