Comments (13)
I haven't personally found the need for this but it shouldn't be too hairy to implement. My top priority, currently, is to get better output during parallel tests, but then I can have a try at this.
I'd probably go about this by polling the filesystem every (say) 1-2 seconds and checking timestamps/md5s. Do you think that would be adequate? Or would something fancier like https://github.com/howeyc/fsnotify be in order?
from ginkgo.
When I'm writing lots of tests I don't want to tab over to the terminal (or any other interface) just to run ginkgo -r (or any other command) again and again.
1-2 seconds is slow. Consider the existence of hundreds of tests. Worst case scenario is
save files
1 Mississippi
2 Mississippi
wait a couple of more seconds for the tests to run
It's conceivable one has to wait 5 or 6 seconds for the tests to run which is not good. Meanwhile I've moved on to new tests which are going to cause another 2 second delay (again worst case). At some point one would just have to sit back and wait for the tests to catch up which is not ideal.
I'm not saying I run all tests all the time. But running all tests does happen enough to make it a concern.
Love your work. I've learned a lot about Go from your code.
from ginkgo.
@ereichert I've made good progress on this and will push it to master in the next few days.
Here's the UI I'm planning on:
ginkgo -watch /path/to/package
will watch for changes in the specified package and rerun the tests if any are detected.
ginkgo -watch -r
will monitor all packages detected (recursively) under the current directory.
Any changes you make to any of those packages will automatically retrigger tests for those packages. (Note: if package A depends on package B and you change B ginkgo won't rerun A's tests -- just B's.)
One limitation to my current implementation: if you add a new package ginkgo -watch -r
won't automatically pick it up. You'll need to ^-C and restart the watch. In your opinion, is this OK?
from ginkgo.
[In your opinion, is this OK?] Beggars can't be choosers. But I appreciate you asking.
[ginkgo -watch /path/to/package] Awesome
[ginkgo -watch -r] Perfect
[if you add a new package] I can live with the new package constraint. It's a nice to have.
[Note: if package A depends on package B and you change B ginkgo won't rerun A's tests -- just B's.] This is the only concern I have. It's definitely the case I would want to rerun tests for packages dependent on package B but only those tests in the same project.
For instance, if I'm working on a project x and x is in my namespace com.me.x and that project has com.me.x.a and com.me.x.b packages then I would want the tests for com.me.x.a to run when com.me.x.b is changed. However if com.me.y.c depends on com.me.x.b and I'm not working on com.me.y.c then I wouldn't want the tests for com.me.y.c to run when com.me.x.b changes.
And as I type this I realize how complex that may be to implement.
I'll take what I can get.
Thanks for your work on this. I wish I had more time so I could help.
from ginkgo.
yep... that would be pretty complex ;)
i have ginkgo -watch
working on master now. give it a whirl and let me know if it's working for you!
from ginkgo.
Unfortunately, I don't get to use Go at my day job. I'll try to work with it as soon as I can.
Thanks again.
Eric Reichert
from ginkgo.
(ps github injecting your phone number into the comment so i figured i'd sanitize that out....)
from ginkgo.
hey @ereichert,
i just added a -notify flag. if you're on OSX you can brew install terminal-notifier
and ginkgo -r -watch -notify
will update you as tests run in the background using desktop notifications...
from ginkgo.
That's a cool addition. I had to work this weekend so I didn't have an opportunity to test the new stuff. Going to try it out this week.
from ginkgo.
Been using the new watcher and notify for the past hour. Both are pretty great.
Thanks for this. It's fantastic.
from ginkgo.
glad you like it! like i said, it's been growing on me too. thanks for the
suggestion.
On Mon, Jan 27, 2014 at 8:15 PM, Eric Reichert [email protected]:
Been using the new watcher and notify for the past hour. Both are pretty
great.Thanks for this. It's fantastic.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/25#issuecomment-33447862
.
from ginkgo.
Gonna close this up if that's OK with you @ereichert
from ginkgo.
It's working great thus far. Thanks for doing this.
from ginkgo.
Related Issues (20)
- Junit report should have system-out HOT 1
- could not log in Eventually with fmt.Fprintf(GinkgoWriter) HOT 3
- Question: One Suite to rule them all HOT 2
- when using concurrency, a test case failure in a background go routine does not show which test case failed HOT 3
- Add cli flag to fail when no tests were run HOT 1
- `ginko -p 2` does not complain about having an extra argument
- How to integrate with xgo? HOT 7
- when watching, add ability to ignore hidden files (including tests!) HOT 5
- Report Portal and Gingko integration plugin
- Implement generic transformer decorator: ginkgo.ContextTransformer HOT 3
- why can't generate html report? HOT 1
- CLI: add long aliases for short options
- --focus-file should work with failing test location HOT 6
- panic when passing context AND nil in a table Entry HOT 2
- Add support for Label Sets
- support outputting the time spent on each spec HOT 1
- [feature request] Test execution and reporting controller HOT 1
- [Documentation] Fix the wrong variable call in Section "Reporting Nodes - ReportBeforeSuite and ReportAfterSuite"
- It function use only check last test case param HOT 1
- Run tests in individual process HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ginkgo.