Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sHqiq-00BBzi-FF for pgsql-hackers@arkaria.postgresql.org; Thu, 13 Jun 2024 20:07:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sHqio-0072R8-8Z for pgsql-hackers@arkaria.postgresql.org; Thu, 13 Jun 2024 20:06:59 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sHqin-0072Qw-U1 for pgsql-hackers@lists.postgresql.org; Thu, 13 Jun 2024 20:06:58 +0000 Received: from mail-qk1-x72b.google.com ([2607:f8b0:4864:20::72b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sHqim-001Aiw-1L for pgsql-hackers@postgresql.org; Thu, 13 Jun 2024 20:06:57 +0000 Received: by mail-qk1-x72b.google.com with SMTP id af79cd13be357-797f2d8b408so97972285a.1 for ; Thu, 13 Jun 2024 13:06:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1718309215; x=1718914015; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=YIlNZvYL6Uyiux8sLmotS0/khyDajVT1SNj+e79NFeA=; b=dcDwAIL8RyV+v+Y0ebuShgPPsPLi5BSlnttknmRj3/To6Xf1tWhPshWWePTpEmmi+k tqkfpyksV10hM4wdHrFb2nibVgXsMEMMdhJq9zMxXilLUbwWEpHsYJVvY7mD73mm0eow PhInutCvD2Fp+2+XBaY47tzwLIyzODu5sFAgbc+tMAY2GZI+IKvJNMGKrITFN8C53+JK eCtbRp0rfERCBChOufvnvr//VUpoYPLLuaUaecuYHfM6zd/m0ydaGKa/Pjlb8vxyd7tw QPcvz8RaFJoIt2/vVihDjOY22mmomioNUkSMiDIKHcHWc/TMCTjeEkmtL4ybBSEiq6Kf qZ4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718309215; x=1718914015; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YIlNZvYL6Uyiux8sLmotS0/khyDajVT1SNj+e79NFeA=; b=l3hCJ/QBM7ggGfLcpLFpHu9ZseifbQrFfb3scm2WJk6Jo5UaHM0yY/0Vo9CXLLwWxV MELWlImZ2KYW++sY4bXBjI9ZJH3eHlH5nZlxi3H349Z9ap/lfdz0cD9qVh6kKjiDLwop fYgLgc86KQBr5biMGLAQVffbZ8TsrR7Pss5Kfl0NW2Zh2evoF/DbRBI/H+50xMYY6hAG VL3M2MV5l/SL/SwrqZSMjVo798hFhkztZ70X+fEWuxLF/90tDc6cKYzXQb9rpY2lAhSR tIWvgaWaxALR156GoR/ShuLWOY/e952Y14mg//KsL6p/Ev07+D9Md47vSW6VBUUEQlHG DGHA== X-Forwarded-Encrypted: i=1; AJvYcCVBSouetD0lxFEfM76iQixOsn7gymszWBWZQ7x/BBzo5Zm9NYgoGi9rR8fKZw1Sz3onK8Pe2+0xIAfvs0GdCN4pdXcW+ws9T1o7FD9t X-Gm-Message-State: AOJu0YyhomRROKhkmwXVGKRqWQQH3fVYR4ggBDKHc/e3yYsvYwyaeEfq 0/rjqUV/w971h+c34zRcxI/Bii1ePecHyQ2WcLziip/sgt2ZYmt26mHbEO6nS6jNpWGHwZqSdtl TV2KvmsH3p6hGCTEnL4zhQwRsyf69J62IhKB5 X-Google-Smtp-Source: AGHT+IHnkAKeYCDJbmGyNBAqzvZNvt7+zo4coIJOzOw2NwbqVsaqWjK8jbMBWQdnwUj83qP/YW8+TAH+iQ4Ug2ZR8lk= X-Received: by 2002:a05:6214:1850:b0:6b0:907a:91c9 with SMTP id 6a1803df08f44-6b2afc792f0mr5812986d6.7.1718309214932; Thu, 13 Jun 2024 13:06:54 -0700 (PDT) MIME-Version: 1.0 References: <20240610200411.byj6sv2vpgol6wcf@awork3.anarazel.de> <20240612155040.u6cvatdb5tiwcxci@awork3.anarazel.de> In-Reply-To: From: Jacob Champion Date: Thu, 13 Jun 2024 13:06:44 -0700 Message-ID: Subject: Re: RFC: adding pytest as a supported test framework To: Robert Haas Cc: Jelte Fennema-Nio , Daniel Gustafsson , Andres Freund , PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Jun 13, 2024 at 12:20=E2=80=AFPM Robert Haas wrote: > I interpreted Jacob's original email as articulating a goal ("For the > v18 cycle, I would like to try to get pytest [1] in as a supported > test driver, in addition to the current offerings") rather than a > plan. That's the first part of it. > There's no patch set yet and, as I understand it, no detailed > plan for a patch set: that email seemed to focus on the question of > desirability, rather than on outlining a plan of work, which I assume > is still to come. There was a four-step plan sketch at the end of that email, titled "A Plan". That was not intended to be "the final detailed plan", because I was soliciting feedback on the exact pieces people wanted to try to implement first, and I am not the God Emperor of Pytest. But it was definitely A Plan. > Some things I'd like to see when a patch set does > show up are: > > - good documentation for people who have no previous experience with > Python and/or pytest e.g. here's how to set up your environment on > Linux, Windows, macOS, *BSD so you can run the tests, here's how to > run the tests, here's how it's different from the Perl framework we > have now +1 > - no external dependencies on PostgreSQL connectors. psql or libpq > foreign function interface. the latter would be a cool increment of > progress over the status quo. If this is a -1 for psycopg, then I will cast my vote for ctypes/CFFI and against psql. > - at least as much in-tree support for writing tests as we have today > with PostgreSQL::Test::whatever, but not necessarily a 1:1 reinvention > of the stuff we have now, and documentation of those facilities that > is as good or, ideally, better than what we have today. I think this is way too much expectation for a v1 patch. If you were committing this by yourself, would you agree to develop the entirety of PostgreSQL::Test in a single commit, without the benefit of the buildfarm checking you as you went, and other people trying to write tests with it? > - high overall code quality and level of maturity, not just something > someone threw together for parity with the Perl system. +1 > - enough tests written for or converted to the new system to give > reviewers confidence that it's truly usable and fit for purpose. This is that "know everything up front" tax that I think is not reasonable for a test framework. If the thing you're trying to avoid is the foot-in-the-door phenomenon, I would agree with you for a Postgres feature. But these are tests; we don't ship them, we have different rules for backporting them, they are developed in a very different way. > The important thing to me here (as it so often is) is to think like a > maintainer. Imagine that immediately after the patches for this > feature are committed, the developers who did the work all disappear > from the community and are never heard from again. How much pain does > that end us causing? The answer doesn't need to be zero; that is > unrealistic. But it also shouldn't be "well, if that happens we're > going to have to rip the feature out" Can you elaborate on why that's not an okay outcome? > or "well, a bunch of committers > who didn't want to write tests in Python in the first place are now > going to have to do a lot of work in Python to stabilize the work > already committed." Is it that? If the problem is that, we should address that. Because if that is truly the fear, I cannot assuage that fear without showing you something, and I cannot show you something you do not want to see, if you don't want to write tests in Python in the first place. --Jacob