Code Monkey home page Code Monkey logo

Comments (13)

onsi avatar onsi commented on May 20, 2024

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.

ereichert avatar ereichert commented on May 20, 2024

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.

onsi avatar onsi commented on May 20, 2024

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

ereichert avatar ereichert commented on May 20, 2024

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

onsi avatar onsi commented on May 20, 2024

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.

ereichert avatar ereichert commented on May 20, 2024

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.

onsi avatar onsi commented on May 20, 2024

(ps github injecting your phone number into the comment so i figured i'd sanitize that out....)

from ginkgo.

onsi avatar onsi commented on May 20, 2024

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.

ereichert avatar ereichert commented on May 20, 2024

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.

ereichert avatar ereichert commented on May 20, 2024

Been using the new watcher and notify for the past hour. Both are pretty great.

Thanks for this. It's fantastic.

from ginkgo.

onsi avatar onsi commented on May 20, 2024

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.

onsi avatar onsi commented on May 20, 2024

Gonna close this up if that's OK with you @ereichert

from ginkgo.

ereichert avatar ereichert commented on May 20, 2024

It's working great thus far. Thanks for doing this.

from ginkgo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.