asv icon indicating copy to clipboard operation
asv copied to clipboard

asv run "ALL_TAGS"

Open MSeifert04 opened this issue 8 years ago • 13 comments

If I create a new benchmark I generally want to run the benchmarks for all existing releases (in my case git tags). The -b optional already helps to select only the new test but it's either not easy to run on all tags or I missed the option.

Nevertheless: I think it would be really nice to have an "ALL_TAGS" option equivalent to the already existing "ALL", "EXISTING" and "NEW" option for range in asv run.

MSeifert04 avatar Nov 12 '16 13:11 MSeifert04

That would be a really great feature!

prisae avatar Jul 06 '18 04:07 prisae

I think this can already be done with asv run $(git tags -l | xargs) for git and asv run 'tag()' for mercurial.

philpep avatar Jul 06 '18 08:07 philpep

That doesn't seem to work for me. If I try it errors

asv/> asv run $(git tags -l | xargs)
git: 'tags' is not a git command. See 'git --help'.

Did you mean one of these?
    stage
    tag

If I instead run asv run $(git tag -l | xargs) (tag instead tags) it simply runs the latest commit, and if I do asv run $(git tags -l | xargs) v1.0.0..master it runs all commits, not just tags.

The problem with this is that it looks like asv runs every commit between tag x until tag x+1. So running asv run v1.0.0 runs all commits from v1.0.0 until the last commit before the next tag, say v1.0.1.

prisae avatar Jul 06 '18 12:07 prisae

Ok maybe asv run $(git tag -l | awk '{ print $1 "^.." $1 }' | xargs) ?

philpep avatar Jul 06 '18 12:07 philpep

Unfortunately not, it just runs the latest commit for me if I try the command.

prisae avatar Jul 06 '18 13:07 prisae

asv run "git tag -l | awk '{ print $1 "^!" }'"is the incantation, but as seen above, not so easy to recall...

pv avatar Jul 06 '18 13:07 pv

asv/> asv run "`git tag -l | awk '{ print $1 "^!" }'`"
asv run "`git tag -l | awk '{ print $1 "^"`git tag -l | awk '{ print $1 "^" }'`" }'`"
bash: command substitution: line 1: unexpected EOF while looking for matching `''
bash: command substitution: line 2: syntax error: unexpected end of file
bash: command substitution: line 1: unexpected EOF while looking for matching `"'
bash: command substitution: line 2: syntax error: unexpected end of file
· Fetching recent changes
· Error running /usr/bin/git rev-list --first-parent git tag -l | awk '{ print ^ }'
            STDOUT -------->

prisae avatar Jul 06 '18 13:07 prisae

And if I run

asv run `git tag -l | awk '{ print $1 "^!" }'`

instead it does not fail, but it only runs the last commit, not the tags.

prisae avatar Jul 06 '18 14:07 prisae

It works fine in bash 4.4.19.

pv avatar Jul 06 '18 14:07 pv

Ha, interesting. I am on GNU bash, version 4.3.48(1)-release (x86_64-pc-linux-gnu) (Ubuntu 16.04).

prisae avatar Jul 06 '18 14:07 prisae

Probably it points towards that the addition of extra ALL_TAGS keywords could be useful :)

Additionally, "asv run" probably should accept multiple input arguments, so that one wouldn't need to work hard on getting the quoting right which apparently depends even on bash version...

pv avatar Jul 06 '18 16:07 pv

I do think a ALL_TAGS keyword would be great. But then I have no idea how easy/difficult it is to implement.

Additionally, "asv run" probably should accept multiple input arguments

Totally agree. Because next I though I just get a list of tags with git tag -l | awk '{ print $1 "^!" }' and provide it to asv run. But that doesn't work, so one would have to loop over it.

So thumb up from my side for both, ALL_TAGS and multiple input arguments.

prisae avatar Jul 06 '18 16:07 prisae

This seems to work for me:

git tag -l | awk '{ print $1 "^!" }' | xargs -L 1 asv run 

is basically just using xargs as a for loop to loop over every tag in turn.

winni2k avatar Jun 13 '22 10:06 winni2k