purescript-deprecated / gulp-purescript

Gulp plugin providing PureScript compiler tasks
34 stars 8 forks source link

Timing for run sequence #11

Closed Fresheyeball closed 9 years ago

Fresheyeball commented 10 years ago

Not sure if this is on gulp-purescript or is some other problem, but take a look at this file. The 2000ms timeout is my work around for 'test:unit' firing before its ready. It seems like gulp-purescript is not accurately reporting when work is completed.

ethul commented 10 years ago

Thanks for reporting. I will take a look.

ethul commented 10 years ago

Does it work if you return the streams in your gulp tasks?

gulp.task('build:test', function(){
  return gulp.src(src)
    .pipe(gulpif(/purs/, psc))
    .pipe(concat(dest.file))
    .pipe(gulp.dest(dest.path));
});

...

gulp.task('test:unit',function(){
    return gulp.src(dest.path+dest.file).pipe(karma); 
});

I gave it a quick try, and it seems to work for me adding the returns.

Fresheyeball commented 10 years ago

Unfortunately, that did not help.

ethul commented 10 years ago

Are you getting a specific error when you run gulp test? Also, is this an intermittent issue or does it happen every time?

I just tried it again and the tests seem to pass without the setTimeout or the returns. I am running purescript 0.5.4.1 and node 0.10.30. Are you on these versions?

Fresheyeball commented 10 years ago

I get the following error every time, and very reproducible.

JS 1.9.7 (Linux): Executed 0 of 0 ERROR (0.04 secs / 0 secs)
[03:55:22] 'test:unit' errored after 1.34 s
[03:55:22] Error in plugin 'gulp-karma'
karma exited with code 1
Error running task sequence: { task: 'test:unit',
  message: 'test:unit stream',
  duration: 1.336513534,
  hrDuration: [ 1, 336513534 ],
  err: 
   { [Error: karma exited with code 1]
     plugin: 'gulp-karma',
     showStack: false,
     message: 'karma exited with code 1' } }
The command "gulp test" exited with 1.
Done. Your build exited with 1.

here are the versions on my box: psc 0.5.4.1 node v0.10.25


when I add in the timeout all works well

ethul commented 10 years ago

Thanks for the details. I've yet to see this error running the tests for purescript-timers. Are you able to update to node 0.10.30 and try that?

ethul commented 9 years ago

@Fresheyeball Have you seen this error crop up again on the newest gulp-purescript version? Thanks!

ethul commented 9 years ago

Closing. We can reopen or bring up a new issue if we start seeing this again.