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 1sJZuv-005gps-1l for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Jun 2024 14:34:37 +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 1sJZus-00EIo4-PM for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Jun 2024 14:34:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sJZus-00EIn7-EK for pgsql-hackers@lists.postgresql.org; Tue, 18 Jun 2024 14:34:35 +0000 Received: from mail-qv1-xf34.google.com ([2607:f8b0:4864:20::f34]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sJZuq-002Iam-8U for pgsql-hackers@postgresql.org; Tue, 18 Jun 2024 14:34:33 +0000 Received: by mail-qv1-xf34.google.com with SMTP id 6a1803df08f44-6b06bb80d7dso28289176d6.0 for ; Tue, 18 Jun 2024 07:34:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1718721269; x=1719326069; 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=pgPQffTC9ecSLvhN1G5xZotrXwsVPaQ0whVbStfvJ3I=; b=gVQhwp+OCSt6k411fiCtlhRU/TTBYTywwTmegy8m37m2swcPFJu7PjYAUHo5PnUSS8 GQDTJHjZcjCa1rN5oe7gVj8e+YNlHZB2QmkYJiJ8l1lmcH3txEzrjlOyQv/3Dk0H0+79 Tm0+XVxvHLEfVmXTLVEr/MArt/AbKy470j+Sm4sQVcC6MBl0qDjNp9CVC3OlmP0wNRd/ Z8SRzSFTFcFa9tkddnaiF+RRvHklnRDhjepMQdgKxnmvm6duHfVmUXws+tjmYYLs1ttX t4Dp7wmOkrcHNb5DyFQLvbZ/pIAmUZ10Y5kgRkFCO2WNQjA/xL4KoyywDChUiKRQBqsJ HWDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718721269; x=1719326069; 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=pgPQffTC9ecSLvhN1G5xZotrXwsVPaQ0whVbStfvJ3I=; b=L9SX+Sfk5uRaeiILIw33rrgilbUURGgW9s4jh/1oC8/3CWvNW1+ZKcNWmYdsJ7Bv/B 8LZPzFztLYh/7yGw/aZ58CJsI4KJazeOVWw37I5auRgMc7KfkCWQwEsVx1/Fw/jZ/ZO4 cf6euTJVI9o3tyQiFK2yYAOkyygindC3lkHWVRk1DIBpyWqTPVjalIV6croZPv1SSFRl y5K3206xbV/BxwIw9MMLxf01LXCmR4QmM2D8GAJXHvxyXFYl1w8DuwM099K1rkPNIh/M XeJsCG5Mmhb0xrsIOx3IFgg6kx8WF3Qbbk9lpzuoPwXJTMf5fa1/x5bvDNpkKbokvChV vSYQ== X-Forwarded-Encrypted: i=1; AJvYcCXhQGQHawDWcKLfOA6AmSZLnHBP2UFZEvgolY4GKzJj2P/A4glXpjStu4xLNyQTALMICYyfZWW3gKixu0nJUGdY5nM0/XXBbs86gKJi X-Gm-Message-State: AOJu0YwwHKhpNS8UjiZX9/jls68qaQ2avT4v1y+pirDvkxJOPrexvRVP C3iu+1ipzeXvk1D3nbguu2k00Oi5kWj0RAKnaieNcZtjvS+yqD7aDcoNJ7rJy+uEkfC3646Zlix kJQq5AdrwhHY8epME2WAcPQvgLYpaaVrAo2AzVgANV0NJauEmOg== X-Google-Smtp-Source: AGHT+IH5+LtBIh58DKv30fMi9iyps8XaPUEU99ZqC6BZUZYgVUTWWLh7IxBGWw7jSjK3kAOvwo6j4kZ4BkxMS8IxlYE= X-Received: by 2002:a0c:c243:0:b0:6b0:7dc7:894c with SMTP id 6a1803df08f44-6b2afc8eac3mr130636806d6.26.1718721269477; Tue, 18 Jun 2024 07:34:29 -0700 (PDT) MIME-Version: 1.0 References: <20240610200411.byj6sv2vpgol6wcf@awork3.anarazel.de> <20240612155040.u6cvatdb5tiwcxci@awork3.anarazel.de> In-Reply-To: From: Jacob Champion Date: Tue, 18 Jun 2024 07:34:17 -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 (slowly catching up from the weekend email backlog) On Fri, Jun 14, 2024 at 5:10=E2=80=AFAM Robert Haas = wrote: > I mean, both Perl and Python are Turing-complete. Tom responded to this better than I could have, but I don't think this is a helpful statement. In fact I opened the unconference session with it and immediately waved it away as not-the-point. > I just don't believe in the idea that we're going to write one > category of tests in one language and another category in another > language. You and I will probably not agree, then, because IMO we already do that. SQL behavior is tested in SQL via pg_regress characterization tests. End-to-end tests are written in Perl. Lower-level tests are often written in C (and, unfortunately, then driven in Perl instead of C; see above mail to Noah). I'm fundamentally a polyglot tester by philosophy, so I don't see careful use of multiple languages as an inherent problem to be solved. They increase complexity (considerably so!) but generally provide sufficient value to offset the cost. > As soon as we open the door to Python tests, people are > going to start writing the TAP tests that they would have written in > Perl in Python instead. There's a wide spectrum of opinions between yours (which I will cheekily paraphrase as "people will love testing in Python so much they'll be willing to reinvent all of the wheels" -- which in the short term would increase maintenance cost but in the long term sounds like a very good problem to have), and people who seem to think that new test suite infrastructure would sit unused because no one wants to write tests anyway (to pull a strawman out of some hallway conversations at PGConf.dev). I think the truth is probably somewhere in the middle? My prior mail was an attempt to bridge the gap between today and the medium term, by introducing a series of compromises and incremental steps in response to specific fears. We can jump forward to the end state and try to talk about it, but I don't control the end state and I don't have a crystal ball. > So as I see > it, the only reasonable plan here if we want to introduce testing in > Python (or C#, or Ruby, or Go, or JavaScript, or Lua, or LOLCODE) is > to try to achieve a reasonable degree of parity between that language > and Perl. Because then we can at least review the new infrastructure > all at once, instead of incrementally spread across many patches > written, reviewed, and committed by many different people. I don't at all believe that a test API which is ported en masse as a horizontal layer, without motivating vertical slices of test functionality, is going to be fit for purpose. And "written, reviewed, and committed by many different people" is a feature for me, not a bug. One of the goals of the thread is to encourage more community test writing than we currently have. Otherwise, I could have kept silent (I am very happy with my personal suite and have been comfortably maintaining it for a while). I am trying to build community momentum around a pain point that is currently rusted in place. > Consider the meson build system project. To get that committed, Andres > had to make it do pretty much everything MSVC could do and mostly > everything that configure could do I think some lessons can be pulled from that, but fundamentally that's a port of the build infrastructure done by a person with a commit bit. There are some pretty considerable differences. (And even then, it wasn't "done" with the first volley of patches, right?) Thanks, --Jacob