From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Xiyue Deng Newsgroups: gmane.emacs.bugs Subject: bug#66782: 29.1; ERT tests report test redefined depending on loading sequence Date: Sat, 28 Oct 2023 02:39:46 -0700 Message-ID: <87o7gjgk65.fsf_-_@debian-hx90.lan> References: <87msw393z8.fsf@debian-hx90.lan> <83y1fncl4k.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21429"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= , 66782@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 28 11:40:51 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1qwfoJ-0005Ni-B6 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 28 Oct 2023 11:40:51 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qwfo1-00059d-6H; Sat, 28 Oct 2023 05:40:33 -0400 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 1qwfny-00058s-P7 for bug-gnu-emacs@gnu.org; Sat, 28 Oct 2023 05:40:30 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qwfny-0003Lp-Gh for bug-gnu-emacs@gnu.org; Sat, 28 Oct 2023 05:40:30 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qwfoU-0002g6-3K for bug-gnu-emacs@gnu.org; Sat, 28 Oct 2023 05:41:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Xiyue Deng Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 28 Oct 2023 09:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66782 X-GNU-PR-Package: emacs Original-Received: via spool by 66782-submit@debbugs.gnu.org id=B66782.169848602910234 (code B ref 66782); Sat, 28 Oct 2023 09:41:02 +0000 Original-Received: (at 66782) by debbugs.gnu.org; 28 Oct 2023 09:40:29 +0000 Original-Received: from localhost ([127.0.0.1]:37762 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qwfnx-0002f0-63 for submit@debbugs.gnu.org; Sat, 28 Oct 2023 05:40:29 -0400 Original-Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]:45319) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qwfnu-0002ek-8m for 66782@debbugs.gnu.org; Sat, 28 Oct 2023 05:40:27 -0400 Original-Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1c9c5a1b87bso21990015ad.3 for <66782@debbugs.gnu.org>; Sat, 28 Oct 2023 02:39:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698485988; x=1699090788; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=jbQoaeGqEpwNPdnzEjHYEB+z4CGihbC22VvAMg5dRhk=; b=K82DujlRdxuNe97ROQooz13bQAw3Za78FftR+vnD6buyR87ri7boWyHaEKKJlHGvXN nfkI4X6BCnJRu4qqDna11p+Qy1F8+57rWCHIOtzOOpqxXNHpVrOfpovHTpR+tVeZNJGE 7jkyPeXnoa0dSgWW0rNrdKkYg6PnYVyg62uht0g6rosa9YjSm0bRgaRPCTVwR+MA0dct dAKaXpD74EWN7Rxgd8vj7Bwd5qVmtTclEM+xsAYhBQll/zFhWpxLnVMszF8UEoJQ28we urXsaCtMbamO6zwblAgsAYfweF6lZl2d2rjmQcppkB+4zU6RjbrY0yrRZcweqLAbDmm7 ktRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698485988; x=1699090788; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=jbQoaeGqEpwNPdnzEjHYEB+z4CGihbC22VvAMg5dRhk=; b=WnNNd8YXET9yh1gBY5EzmJ3NYtcbuCY9/DlN/5O2mXWL7tfxMQOrmnR5W06GLof2da IXygYtu2zcgRIajaoh5QHDzudaE/55mmdRiHp0NIXNfaFeguwbDefjR0Mk1IgBkCGs+c zpT5iJYxqVhznTTxhSDJO7kjxisQjDX6C3ajy7y5lrgFMZ5EQMCeEMo9hGRZBhr02c5q t2m5Cu9PEO28U5BBJD0b1J6njFzGJmzasD58mPsLtenCfoeB1y1MMgQXfRwnTqTn9Utp krbSEDyP6crt+p3tAb8mltmr8LUC4mA7ePyNqImyoH+X0vEIAAytRUc69i+rW3wDjCon ADdQ== X-Gm-Message-State: AOJu0Yz+vN9osZFuMAbfluaAzgdTFa1rcwUDg861Lyqp5HhVBnDIV7GX ZW2V3EKTdJ4eJZFLrtX9zwfxPzT8GcZzcw== X-Google-Smtp-Source: AGHT+IFVoc06oTorVQ7LVYDruNDNmJP030BwahMe3tZ0yuaHVgN2fD76DlWwlEI2OhVR9LrTM4jx/Q== X-Received: by 2002:a17:902:e84a:b0:1cc:c0f:7a13 with SMTP id t10-20020a170902e84a00b001cc0c0f7a13mr4790472plg.47.1698485988118; Sat, 28 Oct 2023 02:39:48 -0700 (PDT) Original-Received: from debian-hx90 (2603-8000-a400-0cdc-2578-79b2-8435-c317.res6.spectrum.com. [2603:8000:a400:cdc:2578:79b2:8435:c317]) by smtp.gmail.com with ESMTPSA id 12-20020a170902ee4c00b001bc18e579aesm121135plo.101.2023.10.28.02.39.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Oct 2023 02:39:47 -0700 (PDT) In-Reply-To: <83y1fncl4k.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 28 Oct 2023 09:32:43 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:273422 Archived-At: Eli Zaretskii writes: >> From: Xiyue Deng >> Date: Fri, 27 Oct 2023 13:59:07 -0700 >> >> As you can see there's only one `first-test' defined. The error message >> is misleading. >> >> A real world example of this can be found in lsp-mode, where >> test/lsp-clangd-test.el[1] requires test/lsp-integration-test.el[2]. >> See also the discussion on an Debian bug[3]. > > If test2 requires test1, why are both of them explicitly run from the > command line? Isn't that redundant, since running test2 will also run > the tests defined by test1? > IIUC most projects just run all tests without explicit dependency detection. For example, in lsp-mode it uses eask ert-runner to run all tests[1]. In Debian it doesn't support cask or eask, so it also has a custom script that detects all test files and loads them all to run under ert[2]. In those cases the loading sequence of the test files is random. I think few projects actually check for such dependency, which is not worth the trouble when the test file count is large. On the other hand, such use is pretty rare if not wrong. As in the case of lsp-mode, lsp-clangd-test actually just requires lsp-integration-test just for a macro, which could have been defined elsewhere in a helper module and be required from both tests and the problem would be solved. As an alternative exists, I wonder whether upstream may consider requiring a file containing ert tests a misuse in ert tests and should be discouraged, as it may lead to unexpected side effects depending on loading sequence. >> However, I'd like to see whether upstream considers this type of usage >> well-formed and should be supported. If not, upstream should give a >> warning on such usage, such as printing a warning when requiring other >> modules that has `ert-deftest'. Meanwhile, an improved error message >> would also be great. > > I could agree to improving the error message, but I don't see why we > should do anything beyond that, FWIW. > This would also be better. > Adding Mattias, who added this check 2 years ago. [1] https://github.com/emacs-lsp/lsp-mode/blob/master/Makefile#L42 [2] https://salsa.debian.org/emacsen-team/dh-elpa/-/blob/master/dh_elpa_test#L386-396 -- Xiyue Deng