after testem change, eak doesn't re run your tests when you change them or your code #392

Closed
davidjnelson opened this Issue Dec 29, 2013 · 26 comments

Projects

None yet

6 participants

@davidjnelson

There is a discussion about this in #292 but it doesn't seem to have been resolved.

@stefanpenner
Owner

@cavneb can you look into this one?

@cavneb
cavneb commented Dec 30, 2013

I will tomorrow for sure—
Sent from Mailbox for iPhone

On Sun, Dec 29, 2013 at 12:32 PM, Stefan Penner notifications@github.com
wrote:

@cavneb can you look into this one?

Reply to this email directly or view it on GitHub:
#392 (comment)

@Pradeek
Pradeek commented Dec 30, 2013

I've had this issue as well. For some reason, if I start grunt server BEFORE testem, it seems to pick up on file changes. If i start testem first, then it doesn't. Maybe it doesn't catch the new files after the clean task?

@stefanpenner
Owner

@Pradeek that seems very likely, and could by why I didn't notice it.

@cavneb
cavneb commented Dec 30, 2013

There are a few issues still with this that seem to be messed up.

When I run grunt test:server and then try to quit testem using 'q', it won't quit. It also doesn't like it when you have testem running and then you run 'grunt' in another console (which launches test:ci:basic) because of a port conflict.

I am looking into these issues but I am not certain exactly how to fix them yet.

@Pradeek
Pradeek commented Dec 30, 2013

@cavneb I haven't had any issue with quitting testem so far.
Btw, are you using the test:server to launch the dev server? Since testem's interface blocks the command, the 'expressServer:debug' task after it never gets called until you quit testem, which is kinda useless.

@cavneb
cavneb commented Dec 30, 2013

@pradeek Is this the reason that the test:server task also fails to watch the files because it never gets past the testem:run:basic command? This would make sense.

@WMeldon
WMeldon commented Dec 30, 2013

@cavneb There are 2 "blocking" tasks in the test:server run list. watch and testem:run:basic. Once Grunt hits either of those, it stops doing anything else.

In regards to the inability to quit testem, I'm not entirely sure what's going on but it appears to "finish" the testem task and then moves on to the watch task. Problem is, it doesn't look like testem quits correctly and you end up needing to hit Ctrl Z and then manually kill the Grunt process.

I think I've fixed this before but I can't remember. I'm also not sure how best to integrate the Testem UI into a Grunt task. I generally stick to just pure information feeds with long running Grunt tasks.

Update

I did get things running slightly better by running testem and watch concurrently as the last task. The CLI UI for Testem gets a little screwed up by the output of watch but it does work. Everything is being watched, reloaded and tested as expected. You can quit testem too! Still not 100% on this solution though.

@Pradeek
Pradeek commented Dec 30, 2013

@cavneb I've removed 'watch' from the test:server task. I believe testem listens for file changes itself.

I run "grunt server" first and then start testem. grunt server also has the watch task so that takes care of it.

The problem with running testem first and then running grunt server is that after the clean task is run, testem doesn't seem to pick up the new files and therefore doesn't do anything after that.

@WMeldon Are you running the dev server along with this as well? How stable is it when everything is concurrent?

@WMeldon
WMeldon commented Dec 30, 2013

@Pradeek Yup. Both servers running on one task and both being reloaded by the watch command. It runs decently well, but like I said, the CLI UI for Testem gets mucked up by the watch output.

Honestly, due to the nature of Testem's UI, running it completely separately (a la tmux) is probably a much better approach to this. Might be wise to lighten up the test:server task though, as it is decently broken at the moment.

@WMeldon
WMeldon commented Jan 17, 2014

If you want to run both grunt server and have Testem running, you'll need to run grunt testem:run:basic separately.

To get Testem to re-run your tests after you change things, add:

  "src_files": [
    "tmp/result/**/*.*"
  ],

to your testem.json

@stefanpenner
Owner

@cavneb thoughts on @WMeldon's suggestion?

@LarsJK
LarsJK commented Jan 18, 2014

Theres an open issue with testem that it fails to re-run tests when using a custom test page.. (testem/testem#314) Probably related to this?

@cavneb
cavneb commented Jan 19, 2014

@WMeldon @stefanpenner This does appear to solve the issue. I have pushed the changes to my fork but before I send a PR, I need to figure out why it's relaunching another instance of PhantomJS.

Repro steps:

  1. Patch with my changes
  2. Run grunt server
  3. Run grunt testem:run:basic
  4. Write an additional test in the test/unit/routes/index_tests.js
  5. Save and watch an additional tab open in testem for PhantomJS.
@WMeldon
WMeldon commented Jan 20, 2014

@cavneb @stefanpenner My gut feeling would be to reduce the scope of the "src_files" as it probably doesn't need to be watching everything.

As far as the extra PhantomJS instances, I'm getting them occasionally as well. Not sure what the root cause is however.

@LarsJK
LarsJK commented Jan 20, 2014

@cavneb @WMeldon @stefanpenner Did some testing with tested.
I get the multiple PhantomJS/browser issue if I quit testem with ctrl+c. Testem won't quit the PhantomJS process, if it is not stopped with 'q'.
If you get multiple instances just quit the process with killall -KILL phantomjs
Same reason you get multiple instances?

@stefanpenner
Owner

@iUtvikler this seems like a testum bug, do you mind opening an issue their, and cross linking?

@cavneb
cavneb commented Jan 20, 2014

@iUtvikler I have always stopped my testem process with q. The issue is that it spawns an additional tab for phantomjs without restarting testem at all. I will open an issue on testem.

@WMeldon I agree that we can pull back the scope of src_files, however I think it should include almost all testable file types (js/html). Sound good?

@cavneb
cavneb commented Jan 20, 2014

@iUtvikler actually, if you wouldn't mind opening the issue with testem, that would be awesome

@WMeldon
WMeldon commented Jan 20, 2014

@cavneb Yup. I never really checked what was under that directory but it looks like it just needs to target everything with a .js.

@WMeldon
WMeldon commented Jan 20, 2014

@cavneb That should do it. 👍

@cavneb
cavneb commented Jan 20, 2014

PR: #431

@LarsJK
LarsJK commented Jan 20, 2014

@cavneb will do!

@LarsJK
LarsJK commented Jan 20, 2014

Issue on Testem: testem/testem#334

@stefanpenner
Owner

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment