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 1sHTJp-007vjV-GV for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Jun 2024 19:07: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 1sHTJn-0051Hx-0h for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Jun 2024 19:07:35 +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 1sHTJm-0051Hp-L4 for pgsql-hackers@lists.postgresql.org; Wed, 12 Jun 2024 19:07:35 +0000 Received: from mail-yw1-x1133.google.com ([2607:f8b0:4864:20::1133]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sHTJk-0010A1-Qu for pgsql-hackers@postgresql.org; Wed, 12 Jun 2024 19:07:34 +0000 Received: by mail-yw1-x1133.google.com with SMTP id 00721157ae682-62ce53782f4so2719137b3.0 for ; Wed, 12 Jun 2024 12:07:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718219252; x=1718824052; 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=G11qBd3YhXH/GdMn5lPbjxdpzlXrnIEpW/HUYQFipe4=; b=gVdaFShqBxiUxyluifeKzY6GW7IYqwhyrNM4u6bWLAyHqZENPBvE3XGUYOIMIqhCv6 EeemtS/qWjjQo8aIgSOs540yS8B2fs3ozRJdgLesdaJJfLwSVWdXd6FfBnNzNBv/xF58 AbuIT9Hk/WySFAiOu4Px12qK2xTfQGgRjlgghFbdRjd8Ay8BZJ5hxpD9UNTfeQ+ONlZ2 v4eWwgEu655q3rvLVHMO+VWxsm07VHsvTfl/mqg+WhJLhvPubcL1HScu6da8fNqcxWBC jzTOtJo2eaw786upjOwM8F5KaJTndgEtrtkDEe+cp1DtyuCQBCLh6WCOdzwPYlORwdTG CzzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718219252; x=1718824052; 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=G11qBd3YhXH/GdMn5lPbjxdpzlXrnIEpW/HUYQFipe4=; b=OCaR90gEWltAsevOQFL3+c1QdrRrcNxn2xw5R+TkF7+OE0WgRgrUIUtHIYWDP7J9Y9 MPN7JsDemTyeawhvfH70pM93ovDw1rjo5w84pQFYMk3qsttzWg3CEKrOl/XaGoXxrbzS gv1d2Wzbu7Oy6N/aUs+0c7R5gSSvldNqxJ4MW5vLW+7V575V9bIdbp/Ku+o+pHiVZPfR 6EAkUlqTbXx8kfVMR28iVXNgvPNDsywBUULoD0krzaU48qtes7savuLxjTBe5Sp25Fdm 2dHzua0RAg8Ll7y22HfZqYVEcJQ4pvPsF3Qm0tgRpgze868uMwbnnOH+ekiL6t9gJZci QS/A== X-Forwarded-Encrypted: i=1; AJvYcCW7mUW9mczSnudu8v/EFqpAyacVD6yPMF15enn0Zq8YVVIjklo8OEy4ASzjfKqmFooJzRHVr3xRe/pDhgflphsIb8OTbwgeRSy9m+44 X-Gm-Message-State: AOJu0YxVxsPZQbiNCdAyM/KSOeNfHUyhmz59bJcnEjChqNAzN1kLH5dd 4u2EnU7ZajSIaAHJUK6cpcFUp1qbC823F7zL08w+SEMwdMZfFexWlqLsNAWppdXAQFsqdHPq/6W xDKezwQXGkWnbCToC/hwGnBXSCpU= X-Google-Smtp-Source: AGHT+IGTzOtsJwLI+4gg9WiqxqZmGEEs5UcoITjoMHD/85pdxdN9TCrTmIpr3wwI5pr1/s+FZObKOSiqq4IUDGzz9m4= X-Received: by 2002:a0d:de45:0:b0:62c:ec8d:7157 with SMTP id 00721157ae682-62fbaf3853fmr28017377b3.49.1718219251730; Wed, 12 Jun 2024 12:07:31 -0700 (PDT) MIME-Version: 1.0 References: <20240610200411.byj6sv2vpgol6wcf@awork3.anarazel.de> <20240612155040.u6cvatdb5tiwcxci@awork3.anarazel.de> In-Reply-To: From: Robert Haas Date: Wed, 12 Jun 2024 15:07:16 -0400 Message-ID: Subject: Re: RFC: adding pytest as a supported test framework To: Daniel Gustafsson Cc: Andres Freund , Jacob Champion , 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 Wed, Jun 12, 2024 at 1:30=E2=80=AFPM Daniel Gustafsson = wrote: > > On 12 Jun 2024, at 17:50, Andres Freund wrote: > > On 2024-06-11 07:28:23 -0700, Jacob Champion wrote: > > >> The OAuth pytest suite makes extensive use of > >> - psycopg, to easily drive libpq; > > > > That's probably not going to fly. It introduces painful circular depend= encies > > between building postgres (for libpq), building psycopg (requiring libp= q) and > > testing postgres (requiring psycopg). > > I might be missing something obvious, but if we use a third-party libpq d= river > in the testsuite doesn't that imply that a patch adding net new functiona= lity > to libpq also need to add it to the driver in order to write the tests? = I'm > thinking about the SCRAM situation a few years back when drivers weren't = up to > date. Yeah, I don't think depending on psycopg2 is practical at all. We can either shell out to psql like we do now, or we can use something like CFFI. On the overall topic of this thread, I personally find most of the rationale articulated in the original message unconvincing. Many of those improvements could be made on top of the Perl framework we have today, and some of them have been discussed, but nobody's done the work. I also don't understand the argument that assert a =3D=3D b is some new and wonderful thing; I mean, you can already do is($a,$b,"test name") which *also* shows you the values when they don't match, and includes a test name, too! I personally think that most of the frustration associated with writing TAP tests has to do with (1) Windows behavior being randomly different than on other platforms in ways that are severely under-documented, (2) PostgreSQL::Test::whatever being somewhat clunky and under-designed, and (3) the general difficulty of producing race-free test cases. A new test framework isn't going to solve (3), and (1) and (2) could be fixed anyway. However, I understand that a lot of people would prefer to code in Python than in Perl. I am not one of them: I learned Perl in the early nineties, and I haven't learned Python yet. Nonetheless, Python being more popular than Perl is a reasonable reason to consider allowing its use in PostgreSQL. But if that's the reason, let's be up front about it. I do think we want a scripting language here i.e. not C. --=20 Robert Haas EDB: http://www.enterprisedb.com