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

Ability to run all Benchmarks in a test file #1522

Closed
lkarlslund opened this issue Feb 19, 2018 · 2 comments
Closed

Ability to run all Benchmarks in a test file #1522

lkarlslund opened this issue Feb 19, 2018 · 2 comments

Comments

@lkarlslund
Copy link

Go testing support in this package is awesome. But it would be really cool if you had the abililty to:

run package benchmarks (if any _test.go file had Benckmark functions)
run file benchmarks (if current _test.go file contains Benchmark functions)

image

Also not show "run file tests" (if current _test.go does not contain Test functions.

@ramya-rao-a
Copy link
Contributor

Showing all the 4 below by default would get noisy

  • run package tests
  • run file tests
  • run package benchmarks
  • run file benchmarks

So I propose the below

  • Allow the go.enableCodeLens to take another property runbenchmarks with default value false
  • Show the run package benchmarks and run file benchmarks only if the above is true and if there are benchmarks present in current file

Also not show "run file tests" (if current _test.go does not contain Test functions.

Sure we can do this, but is this a common scenario that a _test.go file which is essentially a test file will not have any tests?

PRs are welcome

biancarosa added a commit to biancarosa/vscode-go that referenced this issue Aug 30, 2018
ramya-rao-a pushed a commit that referenced this issue Aug 30, 2018
* ✅ creates Go: Benchmark Package function (#1522)

* ➕ adds the possibility of running all benchmarks for a package

* remove tab on empty line

* 📝 updates description
ramya-rao-a pushed a commit that referenced this issue Aug 31, 2018
* ✅ creates Go: Benchmark Package function (#1522)

* ➕ adds the possibility of running all benchmarks for a package

* remove tab on empty line

* 📝 updates description

* ➕ add command to run all benchmarks in a file

* Fix test failure
ramya-rao-a added a commit that referenced this issue Sep 23, 2018
@ramya-rao-a
Copy link
Contributor

This should now be available in the latest update to this extension (0.6.90). Thanks to @biancarosa!

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants