Skip to content
This repository has been archived by the owner on Jan 18, 2023. It is now read-only.

Add ability to pass arbitrary arguments to go test #26

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ErebusBat
Copy link

Add ability to pass arbitrary arguments to go test.

As to not interfere with the current looper options you must prefix any go test options with the double hyphen (--), ala:

looper -debug -- -run MyTest

This really renders the -tags flag obsolete as it has the same format in go test; however removing it would be a breaking change for others.

ErebusBat added a commit to ErebusBat/looper that referenced this pull request Jun 15, 2015
…s directly to `go test`.

After the ability to pass arbitrary flags to `go test` [nathany#26](nathany#26), there was no reason to keep the `-tags` flag.

Removing `-tags` leaves only `-debug` and that makes sense to move to an environment variable (`$LOOPER_DEBUG`).

Removing looper flags allows us to drop the need for `--` to pass options to `go test`, so now we can call looper just like go test.
…s directly to `go test`.

After the ability to pass arbitrary flags to `go test` [nathany#26](nathany#26), there was no reason to keep the `-tags` flag.

Removing `-tags` leaves only `-debug` and that makes sense to move to an environment variable (`$LOOPER_DEBUG`).

Removing looper flags allows us to drop the need for `--` to pass options to `go test`, so now we can call looper just like go test.
args := []string{"test"}

// additional args passed in on looper cmd line
// if the arg is {} then the files will be places there
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious. Any specific reason to use {} as a placeholder?

@nathany
Copy link
Owner

nathany commented Jun 16, 2015

Thanks. I've been meaning to add something like this, but I never settled on how it should work.


runner := gat.Run{Tags: tags}
// Pass all args to go test, except the name of the looper command
gtargs := os.Args[1:len(os.Args)]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

len(os.Args) is the default [1:]

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is "gt"?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I have already fixed [1:] on my end, I will push it.

gt == GoTest. I just needed a prefix, I can be more verbose, or now that tags are gone it could just be args.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

args sounds good. thanks

@nathany
Copy link
Owner

nathany commented Aug 24, 2015

Sorry, I seem to have introduce some conflicts in master. Do you mind removing the extra verbosity and fixing the conflicts?

@ErebusBat
Copy link
Author

I do not mind, but will not be able to tackle it immediately.  


Sent from my mobile. Please excuse any spelling or grammar mistakes.

On Sun, Aug 23, 2015 at 6:06 PM, Nathan Youngman [email protected]
wrote:

Sorry, I seem to have introduce some conflicts in master. Do you mind removing the extra verbosity and fixing the conflicts?

Reply to this email directly or view it on GitHub:
#26 (comment)

@nathany
Copy link
Owner

nathany commented Aug 24, 2015

Thanks.

@dhax
Copy link

dhax commented Feb 18, 2020

is this anywhere close to happen in the near future? ;)

Base automatically changed from master to main February 8, 2021 00:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants