GNU bug report logs - #74786
[PATCH] Add custom args to test compile step

Previous Next

Package: emacs;

Reported by: "O'Brien, Will" <will.08rien <at> gmail.com>

Date: Wed, 11 Dec 2024 11:29:02 UTC

Severity: wishlist

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 74786 in the body.
You can then email your comments to 74786 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#74786; Package emacs. (Wed, 11 Dec 2024 11:29:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "O'Brien, Will" <will.08rien <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 11 Dec 2024 11:29:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "O'Brien, Will" <will.08rien <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Add custom args to test compile step
Date: Wed, 11 Dec 2024 10:18:04 +0000
[Message part 1 (text/plain, inline)]
Tags: patch

Hi,

First time trying to contribute here, so apologies for any wrong doing.  I
haven't signed FSF papers; would be happy to but believe this may fit in to
tiny patch territory.

This is a feature request to pass custom flags down to the test compile
step in go-ts-mode-test-... functions.  Specifically I wanted to
add the coverprofile argument to unit test invocation.

The attached patch seems to do the trick for me.


In GNU Emacs 31.0.50 (build 1, aarch64-apple-darwin23.6.0, NS
 appkit-2487.70 Version 14.6.1 (Build 23G93)) of 2024-09-02 built
 on Wills-MacBook-Pro.local
Windowing system distributor 'Apple', version 10.3.2575
System Description:  macOS 15.1.1

Configured using:
 'configure --disable-silent-rules
 --prefix=/nix/store/2hqk7brndnbi3r5c2rjyhx0k19m1q77j-w08r-emacs-92ea393a16e
 --enable-locallisppath=/nix/store/2hqk7brndnbi3r5c2rjyhx0k19m1q77j-w08r-emacs-92ea393a16e/site-lisp
 --without-dbus --without-imagemagick --with-mailutils
 --disable-ns-self-contained --with-cairo --with-modules
 --with-xml2 --with-gnutls --with-rsvg --with-native-compilation
 --with-gnutls=ifavailable
 --enable-mac-app=/nix/store/2hqk7brndnbi3r5c2rjyhx0k19m1q77j-w08r-emacs-92ea393a16e/Applications
 --with-xwidgets --with-tree-sitter 'CFLAGS=-O3 -isysroot
 /Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk/
 -framework AppKit'
 'CPPFLAGS=-I/Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk/usr/include
 -isysroot
 /Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk/
 -I/Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk//System/Library/Frameworks/AppKit.framework/Versions/C/Headers
 -I/nix/store/d3f47kd7kr5xdpcgs3xx7bg2mx5fbb0z-libgccjit-12.2.0/include'
 'LDFLAGS=-O3 -L
 /nix/store/d3f47kd7kr5xdpcgs3xx7bg2mx5fbb0z-libgccjit-12.2.0/lib''


best
--
will

[0001-Add-custom-args-to-test-compile-step.patch (text/patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#74786; Package emacs. (Wed, 11 Dec 2024 15:47:01 GMT) Full text and rfc822 format available.

Message #8 received at 74786 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: "O'Brien, Will" <will.08rien <at> gmail.com>,
 Randy Taylor <dev <at> rjt.dev>
Cc: 74786 <at> debbugs.gnu.org
Subject: Re: bug#74786: [PATCH] Add custom args to test compile step
Date: Wed, 11 Dec 2024 17:45:59 +0200
> From: "O'Brien, Will" <will.08rien <at> gmail.com>
> Date: Wed, 11 Dec 2024 10:18:04 +0000
> 
> First time trying to contribute here, so apologies for any wrong doing.  I
> haven't signed FSF papers; would be happy to but believe this may fit in to
> tiny patch territory.

It does.  But you may wish to start the paperwork regardless, so we
could accept your future contributions without limitations.  Let me
know if you want me to send you the form and instructions.

> This is a feature request to pass custom flags down to the test compile
> step in go-ts-mode-test-... functions.  Specifically I wanted to
> add the coverprofile argument to unit test invocation.
> 
> The attached patch seems to do the trick for me.

Thanks.

Randy, any comments or suggestions?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#74786; Package emacs. (Wed, 11 Dec 2024 16:00:05 GMT) Full text and rfc822 format available.

Message #11 received at 74786 <at> debbugs.gnu.org (full text, mbox):

From: Robert Pluim <rpluim <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Randy Taylor <dev <at> rjt.dev>, "O'Brien, Will" <will.08rien <at> gmail.com>,
 74786 <at> debbugs.gnu.org
Subject: Re: bug#74786: [PATCH] Add custom args to test compile step
Date: Wed, 11 Dec 2024 16:58:03 +0100
>>>>> On Wed, 11 Dec 2024 17:45:59 +0200, Eli Zaretskii <eliz <at> gnu.org> said:

    >> From: "O'Brien, Will" <will.08rien <at> gmail.com>
    >> Date: Wed, 11 Dec 2024 10:18:04 +0000
    >> 
    >> First time trying to contribute here, so apologies for any wrong doing.  I
    >> haven't signed FSF papers; would be happy to but believe this may fit in to
    >> tiny patch territory.

    Eli> It does.  But you may wish to start the paperwork regardless, so we
    Eli> could accept your future contributions without limitations.  Let me
    Eli> know if you want me to send you the form and instructions.

    >> This is a feature request to pass custom flags down to the test compile
    >> step in go-ts-mode-test-... functions.  Specifically I wanted to
    >> add the coverprofile argument to unit test invocation.
    >> 
    >> The attached patch seems to do the trick for me.

    Eli> Thanks.

    Eli> Randy, any comments or suggestions?

Iʼm not Randy, but:

    >> +(defun go-ts-mode--get-test-args ()
    >> +  "Return the test args.
    >> +This function respects the `go-ts-mode-test-args' variable for
    >> +specifying test args, such as adding coverage file."
    >> +  (if go-ts-mode-test-args
    >> +      (string-join go-ts-mode-test-args)
    >> +    ""))
    >> +

This entire function is not needed, since

(string-join nil) => ""

    >>  (defun go-ts-mode--compile-test (regexp)
    >>    "Compile the tests matching REGEXP.
    >>  This function respects the `go-ts-mode-build-tags' variable for
    >>  specifying build tags."
    >> -  (compile (format "go test -v %s -run '%s'"
    >> +  (compile (format "go test %s -v %s -run '%s'"
    >> +                   (go-ts-mode--get-test-args)
    >>                     (go-ts-mode--get-build-tags-flag)
    >>                     regexp)))
    >> 

so you could just inline the `string-join' here.


Robert
-- 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#74786; Package emacs. (Wed, 11 Dec 2024 17:12:02 GMT) Full text and rfc822 format available.

Message #14 received at 74786 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: "O'Brien, Will" <will.08rien <at> gmail.com>
Cc: dev <at> rjt.dev, 74786 <at> debbugs.gnu.org
Subject: Re: bug#74786: [PATCH] Add custom args to test compile step
Date: Wed, 11 Dec 2024 19:10:55 +0200
> From: "O'Brien, Will" <will.08rien <at> gmail.com>
> Cc: Randy Taylor <dev <at> rjt.dev>,  74786 <at> debbugs.gnu.org
> Date: Wed, 11 Dec 2024 16:30:36 +0000
> 
> On Wed, Dec 11 2024 at 17:45, Eli Zaretskii <eliz <at> gnu.org> wrote:
> 
> >> From: "O'Brien, Will" <will.08rien <at> gmail.com>
> >> Date: Wed, 11 Dec 2024 10:18:04 +0000
> >> 
> >> First time trying to contribute here, so apologies for any wrong doing.  I
> >> haven't signed FSF papers; would be happy to but believe this may fit in to
> >> tiny patch territory.
> >
> > It does.  But you may wish to start the paperwork regardless, so we
> > could accept your future contributions without limitations.  Let me
> > know if you want me to send you the form and instructions.
> 
> Makes sense, please pass on the form and I will complete.

Thanks, form sent off-list.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#74786; Package emacs. (Wed, 11 Dec 2024 17:28:03 GMT) Full text and rfc822 format available.

Message #17 received at 74786 <at> debbugs.gnu.org (full text, mbox):

From: "O'Brien, Will" <will.08rien <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Randy Taylor <dev <at> rjt.dev>, 74786 <at> debbugs.gnu.org
Subject: Re: bug#74786: [PATCH] Add custom args to test compile step
Date: Wed, 11 Dec 2024 16:30:36 +0000
On Wed, Dec 11 2024 at 17:45, Eli Zaretskii <eliz <at> gnu.org> wrote:

>> From: "O'Brien, Will" <will.08rien <at> gmail.com>
>> Date: Wed, 11 Dec 2024 10:18:04 +0000
>> 
>> First time trying to contribute here, so apologies for any wrong doing.  I
>> haven't signed FSF papers; would be happy to but believe this may fit in to
>> tiny patch territory.
>
> It does.  But you may wish to start the paperwork regardless, so we
> could accept your future contributions without limitations.  Let me
> know if you want me to send you the form and instructions.

Makes sense, please pass on the form and I will complete.

best
--
will




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#74786; Package emacs. (Wed, 11 Dec 2024 17:28:03 GMT) Full text and rfc822 format available.

Message #20 received at 74786 <at> debbugs.gnu.org (full text, mbox):

From: "O'Brien, Will" <will.08rien <at> gmail.com>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: Randy Taylor <dev <at> rjt.dev>, Eli Zaretskii <eliz <at> gnu.org>,
 74786 <at> debbugs.gnu.org
Subject: Re: bug#74786: [PATCH] Add custom args to test compile step
Date: Wed, 11 Dec 2024 16:31:49 +0000
[Message part 1 (text/plain, inline)]
On Wed, Dec 11 2024 at 16:58, Robert Pluim <rpluim <at> gmail.com> wrote:

>>>>>> On Wed, 11 Dec 2024 17:45:59 +0200, Eli Zaretskii <eliz <at> gnu.org> said:
>
> Iʼm not Randy, but:
>
>     >> +(defun go-ts-mode--get-test-args ()
>     >> +  "Return the test args.
>     >> +This function respects the `go-ts-mode-test-args' variable for
>     >> +specifying test args, such as adding coverage file."
>     >> +  (if go-ts-mode-test-args
>     >> +      (string-join go-ts-mode-test-args)
>     >> +    ""))
>     >> +
>
> This entire function is not needed, since
>
> (string-join nil) => ""
>
>     >>  (defun go-ts-mode--compile-test (regexp)
>     >>    "Compile the tests matching REGEXP.
>     >>  This function respects the `go-ts-mode-build-tags' variable for
>     >>  specifying build tags."
>     >> -  (compile (format "go test -v %s -run '%s'"
>     >> +  (compile (format "go test %s -v %s -run '%s'"
>     >> +                   (go-ts-mode--get-test-args)
>     >>                     (go-ts-mode--get-build-tags-flag)
>     >>                     regexp)))
>     >> 
>
> so you could just inline the `string-join' here.

Ah, thanks!  I've attached a new patch with the simplification.

best
--
will

[0001-Add-custom-args-to-test-compile-step.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#74786; Package emacs. (Sun, 15 Dec 2024 02:19:02 GMT) Full text and rfc822 format available.

Message #23 received at 74786 <at> debbugs.gnu.org (full text, mbox):

From: Randy Taylor <dev <at> rjt.dev>
To: "O'Brien, Will" <will.08rien <at> gmail.com>
Cc: Robert Pluim <rpluim <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>,
 74786 <at> debbugs.gnu.org
Subject: Re: bug#74786: [PATCH] Add custom args to test compile step
Date: Sun, 15 Dec 2024 02:17:55 +0000
On Wednesday, December 11th, 2024 at 11:31, O'Brien, Will <will.08rien <at> gmail.com> wrote:
> [...]
> 
> Ah, thanks! I've attached a new patch with the simplification.
> 
> best
> --
> will

Thanks for working on this.

+(defcustom go-ts-mode-test-args nil
+  "List of extra args for the Go test commands."
Should we call this `go-ts-mode-test-flags' instead?
That seems to be the parlance golang uses, and there is an official
`-args' that go test supports that has a specific behaviour:
	-args
	    Pass the remainder of the command line (everything after -args)
	    to the test binary, uninterpreted and unchanged.
	    Because this flag consumes the remainder of the command line,
	    the package list (if present) must appear before this flag.

+  (compile (format "go test %s -v %s -run '%s'"
+                   (string-join go-ts-mode-test-args)
With the above in mind, we may want to move the %s to the absolute
end so that -args could be used without catastrophe.

This will also need a commit message and a NEWS entry.
See the CONTRIBUTE file for details.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#74786; Package emacs. (Tue, 17 Dec 2024 02:43:01 GMT) Full text and rfc822 format available.

Message #26 received at 74786 <at> debbugs.gnu.org (full text, mbox):

From: "J.P." <jp <at> neverwas.me>
To: "O'Brien, Will" <will.08rien <at> gmail.com>
Cc: Randy Taylor <dev <at> rjt.dev>, Robert Pluim <rpluim <at> gmail.com>,
 Eli Zaretskii <eliz <at> gnu.org>, 74786 <at> debbugs.gnu.org
Subject: Re: bug#74786: [PATCH] Add custom args to test compile step
Date: Mon, 16 Dec 2024 18:41:55 -0800
Hi,

Hope you don't mind my butting in.

"O'Brien, Will" <will.08rien <at> gmail.com> writes:

> Ah, thanks!  I've attached a new patch with the simplification.
>
[...]
> @@ -396,7 +402,8 @@ specifying build tags."
>    "Compile the tests matching REGEXP.
>  This function respects the `go-ts-mode-build-tags' variable for
>  specifying build tags."
> -  (compile (format "go test -v %s -run '%s'"
> +  (compile (format "go test %s -v %s -run '%s'"
> +                   (string-join go-ts-mode-test-args)
                                                       ^

Should this specify a separator argument?

Or, since

  $ go help testflag

lists a few options that take a regexp argument, maybe something like

  (mapconcat #'shell-quote-argument go-ts-mode-test-args " ")

would make more sense? If that's just nonsense, please pardon the noise.

J.P.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#74786; Package emacs. (Tue, 17 Dec 2024 15:20:03 GMT) Full text and rfc822 format available.

Message #29 received at 74786 <at> debbugs.gnu.org (full text, mbox):

From: "O'Brien, Will" <will.08rien <at> gmail.com>
To: "J.P." <jp <at> neverwas.me>
Cc: Randy Taylor <dev <at> rjt.dev>, Robert Pluim <rpluim <at> gmail.com>,
 Eli Zaretskii <eliz <at> gnu.org>, 74786 <at> debbugs.gnu.org
Subject: Re: bug#74786: [PATCH] Add custom args to test compile step
Date: Tue, 17 Dec 2024 08:32:50 +0000
On Mon, Dec 16 2024 at 18:41, "J.P." <jp <at> neverwas.me> wrote:

>>    "Compile the tests matching REGEXP.
>>  This function respects the `go-ts-mode-build-tags' variable for
>>  specifying build tags."
>> -  (compile (format "go test -v %s -run '%s'"
>> +  (compile (format "go test %s -v %s -run '%s'"
>> +                   (string-join go-ts-mode-test-args)
>                                                        ^
>
> Should this specify a separator argument?

It should indeed!


> Or, since
>
>   $ go help testflag
>
> lists a few options that take a regexp argument, maybe something like
>
>   (mapconcat #'shell-quote-argument go-ts-mode-test-args " ")

Ah, nice!  Yeah I will update.

Thank you!




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#74786; Package emacs. (Tue, 17 Dec 2024 15:20:05 GMT) Full text and rfc822 format available.

Message #32 received at 74786 <at> debbugs.gnu.org (full text, mbox):

From: "O'Brien, Will" <will.08rien <at> gmail.com>
To: Randy Taylor <dev <at> rjt.dev>
Cc: Robert Pluim <rpluim <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>,
 74786 <at> debbugs.gnu.org
Subject: Re: bug#74786: [PATCH] Add custom args to test compile step
Date: Tue, 17 Dec 2024 08:34:05 +0000
On Sun, Dec 15 2024 at 02:17, Randy Taylor <dev <at> rjt.dev> wrote:

> On Wednesday, December 11th, 2024 at 11:31, O'Brien, Will <will.08rien <at> gmail.com> wrote:
>> [...]
>> 
>> Ah, thanks! I've attached a new patch with the simplification.
>> 
>> best
>> --
>> will
>
> Thanks for working on this.
>
> +(defcustom go-ts-mode-test-args nil
> +  "List of extra args for the Go test commands."
> Should we call this `go-ts-mode-test-flags' instead?
> That seems to be the parlance golang uses, and there is an official
> `-args' that go test supports that has a specific behaviour:
> 	-args
> 	    Pass the remainder of the command line (everything after -args)
> 	    to the test binary, uninterpreted and unchanged.
> 	    Because this flag consumes the remainder of the command line,
> 	    the package list (if present) must appear before this flag.
>
> +  (compile (format "go test %s -v %s -run '%s'"
> +                   (string-join go-ts-mode-test-args)
> With the above in mind, we may want to move the %s to the absolute
> end so that -args could be used without catastrophe.

Got it.  Right I'll work on this and test out a few options with
combinations flags.

> This will also need a commit message and a NEWS entry.
> See the CONTRIBUTE file for details.

Ok, will send new patch with code changes and NEW entry along with
a commit message.

Thank you!

--
will




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#74786; Package emacs. (Thu, 19 Dec 2024 16:22:02 GMT) Full text and rfc822 format available.

Message #35 received at 74786 <at> debbugs.gnu.org (full text, mbox):

From: "O'Brien, Will" <will.08rien <at> gmail.com>
To: Randy Taylor <dev <at> rjt.dev>, "J.P." <jp <at> neverwas.me>
Cc: Robert Pluim <rpluim <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>,
 74786 <at> debbugs.gnu.org
Subject: Re: bug#74786: [PATCH] Add custom args to test compile step
Date: Thu, 19 Dec 2024 16:20:18 +0000
[Message part 1 (text/plain, inline)]
Hi,

On Tue, Dec 17 2024 at 08:34, "O'Brien, Will" <will.08rien <at> gmail.com> wrote:

> On Sun, Dec 15 2024 at 02:17, Randy Taylor <dev <at> rjt.dev> wrote:
>
>> On Wednesday, December 11th, 2024 at 11:31, O'Brien, Will <will.08rien <at> gmail.com> wrote:

[...]


>> +  (compile (format "go test %s -v %s -run '%s'"
>> +                   (string-join go-ts-mode-test-args)
>> With the above in mind, we may want to move the %s to the absolute
>> end so that -args could be used without catastrophe.
>
> Got it.  Right I'll work on this and test out a few options with
> combinations flags.
>
>> This will also need a commit message and a NEWS entry.
>> See the CONTRIBUTE file for details.
>
> Ok, will send new patch with code changes and NEW entry along with
> a commit message.

I believe the attached patch should cover your suggestion, Randy,
as well as incorporating Robert's and J.P.'s suggestions.

I have tried to update NEWS and used a commit message within the
patch which I believe conforms to the requirements laid out in
CONTRIBUTE.

Look forward to hearing your feedback, thank you all for showing
such patience.

[0001-Enable-extra-flags-in-go-ts-mode-test-commands.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#74786; Package emacs. (Fri, 20 Dec 2024 16:17:02 GMT) Full text and rfc822 format available.

Message #38 received at 74786 <at> debbugs.gnu.org (full text, mbox):

From: "O'Brien, Will" <will.08rien <at> gmail.com>
To: Randy Taylor <dev <at> rjt.dev>
Cc: Robert Pluim <rpluim <at> gmail.com>, 74786 <at> debbugs.gnu.org,
 Eli Zaretskii <eliz <at> gnu.org>, "J.P." <jp <at> neverwas.me>
Subject: Re: bug#74786: [PATCH] Add custom args to test compile step
Date: Fri, 20 Dec 2024 16:14:54 +0000
Hi,

On Thu, Dec 19 2024 at 16:20, "O'Brien, Will" <will.08rien <at> gmail.com> wrote:

> I believe the attached patch should cover your suggestion, Randy,
> as well as incorporating Robert's and J.P.'s suggestions.

I think there's a further issue which I believe was pre-existing.

The package test function looks like this:

--8<---------------cut here---------------start------------->8---
(defun go-ts-mode-test-this-package ()
  "Run all the unit tests under the current package."
  (interactive)
  (compile (format "go test -v %s -run %s"
                   (go-ts-mode--get-build-tags-flag)
                   default-directory)))
--8<---------------cut here---------------end--------------->8---

The issue that the argument to the `-run` flag is a regex that
should match any tests that will be execute.  Passing a directory
has slightly unexpected consequences, and although it seems to
work, for me typically results tests not running.

I think that we can remove the `-run` flag from this function.
What do others think?  Also, should this be a separate bug/patch
(if indeed it is a bug) or I can incorporate this change into the
current change set.

best
--
will




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#74786; Package emacs. (Wed, 01 Jan 2025 23:51:02 GMT) Full text and rfc822 format available.

Message #41 received at 74786 <at> debbugs.gnu.org (full text, mbox):

From: Randy Taylor <dev <at> rjt.dev>
To: "O'Brien, Will" <will.08rien <at> gmail.com>
Cc: Robert Pluim <rpluim <at> gmail.com>, 74786 <at> debbugs.gnu.org,
 Eli Zaretskii <eliz <at> gnu.org>, "J.P." <jp <at> neverwas.me>
Subject: Re: bug#74786: [PATCH] Add custom args to test compile step
Date: Wed, 01 Jan 2025 23:50:32 +0000
On Friday, December 20th, 2024 at 11:14, O'Brien, Will <will.08rien <at> gmail.com> wrote:
> 
> 
> Hi,
> 
> On Thu, Dec 19 2024 at 16:20, "O'Brien, Will" will.08rien <at> gmail.com wrote:
> 
> > I believe the attached patch should cover your suggestion, Randy,
> > as well as incorporating Robert's and J.P.'s suggestions.

Thanks, the patch looks good to me.
There is a typo:
+  "Return the flags for test invoation."
                              ^invocation

> 
> 
> I think there's a further issue which I believe was pre-existing.
> 
> The package test function looks like this:
> 
> --8<---------------cut here---------------start------------->8---
> 
> (defun go-ts-mode-test-this-package ()
> "Run all the unit tests under the current package."
> (interactive)
> (compile (format "go test -v %s -run %s"
> (go-ts-mode--get-build-tags-flag)
> default-directory)))
> --8<---------------cut here---------------end--------------->8---
> 
> 
> The issue that the argument to the `-run` flag is a regex that
> should match any tests that will be execute. Passing a directory
> has slightly unexpected consequences, and although it seems to
> work, for me typically results tests not running.
> 
> I think that we can remove the `-run` flag from this function.
> What do others think? Also, should this be a separate bug/patch
> (if indeed it is a bug) or I can incorporate this change into the
> current change set.
> 
> best
> --
> will

I believe you are correct, we can get rid of the -run flag.
Please incorporate these changes as part of this patch.

(Side note, maybe we should actually pass the package to
go test instead of relying on default directory but
don't worry about that for this patch).




Severity set to 'wishlist' from 'normal' Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 02 Jan 2025 01:40:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#74786; Package emacs. (Thu, 02 Jan 2025 11:23:02 GMT) Full text and rfc822 format available.

Message #46 received at 74786 <at> debbugs.gnu.org (full text, mbox):

From: "O'Brien, Will" <will.08rien <at> gmail.com>
To: Randy Taylor <dev <at> rjt.dev>
Cc: Robert Pluim <rpluim <at> gmail.com>, 74786 <at> debbugs.gnu.org,
 Eli Zaretskii <eliz <at> gnu.org>, "J.P." <jp <at> neverwas.me>
Subject: Re: bug#74786: [PATCH] Add custom args to test compile step
Date: Thu, 02 Jan 2025 11:21:54 +0000
[Message part 1 (text/plain, inline)]
On Wed, Jan 01 2025 at 23:50, Randy Taylor <dev <at> rjt.dev> wrote:

> Thanks, the patch looks good to me.
> There is a typo:
> +  "Return the flags for test invoation."
>                               ^invocation
>

Fixed.

[...]

>> I think that we can remove the `-run` flag from this function.
>> What do others think? Also, should this be a separate bug/patch
>> (if indeed it is a bug) or I can incorporate this change into the
>> current change set.
>> 
>
> I believe you are correct, we can get rid of the -run flag.
> Please incorporate these changes as part of this patch.

Done.

> (Side note, maybe we should actually pass the package to
> go test instead of relying on default directory but
> don't worry about that for this patch).

Will raise a new issue.

best
--
will

[0001-Enable-extra-flags-in-go-ts-mode-test-commands.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#74786; Package emacs. (Sat, 04 Jan 2025 19:07:02 GMT) Full text and rfc822 format available.

Message #49 received at 74786 <at> debbugs.gnu.org (full text, mbox):

From: Randy Taylor <dev <at> rjt.dev>
To: "O'Brien, Will" <will.08rien <at> gmail.com>
Cc: Robert Pluim <rpluim <at> gmail.com>, 74786 <at> debbugs.gnu.org,
 Eli Zaretskii <eliz <at> gnu.org>, "J.P." <jp <at> neverwas.me>
Subject: Re: bug#74786: [PATCH] Add custom args to test compile step
Date: Sat, 04 Jan 2025 19:05:55 +0000
On Thursday, January 2nd, 2025 at 06:21, O'Brien, Will <will.08rien <at> gmail.com> wrote:
> 
> 
> On Wed, Jan 01 2025 at 23:50, Randy Taylor dev <at> rjt.dev wrote:
> 
> > Thanks, the patch looks good to me.
> > There is a typo:
> > + "Return the flags for test invoation."
> > ^invocation
> 
> 
> Fixed.
> 
> [...]
> 
> > > I think that we can remove the `-run` flag from this function.
> > > What do others think? Also, should this be a separate bug/patch
> > > (if indeed it is a bug) or I can incorporate this change into the
> > > current change set.
> > 
> > I believe you are correct, we can get rid of the -run flag.
> > Please incorporate these changes as part of this patch.
> 
> 
> Done.
> 
> > (Side note, maybe we should actually pass the package to
> > go test instead of relying on default directory but
> > don't worry about that for this patch).
> 
> 
> Will raise a new issue.
> 
> best
> --
> will

Thanks, looks good to me.

Eli, please install if you have no further comments. Thanks in
advance.




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Sun, 05 Jan 2025 12:44:01 GMT) Full text and rfc822 format available.

Notification sent to "O'Brien, Will" <will.08rien <at> gmail.com>:
bug acknowledged by developer. (Sun, 05 Jan 2025 12:44:02 GMT) Full text and rfc822 format available.

Message #54 received at 74786-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Randy Taylor <dev <at> rjt.dev>
Cc: will.08rien <at> gmail.com, 74786-done <at> debbugs.gnu.org, rpluim <at> gmail.com,
 jp <at> neverwas.me
Subject: Re: bug#74786: [PATCH] Add custom args to test compile step
Date: Sun, 05 Jan 2025 14:43:07 +0200
> Date: Sat, 04 Jan 2025 19:05:55 +0000
> From: Randy Taylor <dev <at> rjt.dev>
> Cc: "J.P." <jp <at> neverwas.me>, Robert Pluim <rpluim <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>, 74786 <at> debbugs.gnu.org
> 
> Thanks, looks good to me.
> 
> Eli, please install if you have no further comments. Thanks in
> advance.

Thanks, installed on the master branch, and closing the bug.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 03 Feb 2025 12:24:17 GMT) Full text and rfc822 format available.

This bug report was last modified 136 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.