airspeed-velocity / asv

Airspeed Velocity: A simple Python benchmarking tool with web-based reporting
https://asv.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
874 stars 180 forks source link

asv run "ALL_TAGS" #488

Open MSeifert04 opened 8 years ago

MSeifert04 commented 8 years ago

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.

prisae commented 6 years ago

That would be a really great feature!

philpep commented 6 years ago

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

prisae commented 6 years ago

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.

philpep commented 6 years ago

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

prisae commented 6 years ago

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

pv commented 6 years ago

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

prisae commented 6 years ago
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 commented 6 years ago

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.

pv commented 6 years ago

It works fine in bash 4.4.19.

prisae commented 6 years ago

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

pv commented 6 years ago

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...

prisae commented 6 years ago

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.

winni2k commented 2 years ago

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.