kaliber5 / ember-fastboot-addon-tests

Addon testing support for Fastboot compatibility
MIT License
25 stars 9 forks source link

Timeout when adding package with prompts #15

Open kimroen opened 7 years ago

kimroen commented 7 years ago

The installer for an addon might try to add some files to your addon. If the addon already has those files, you'll get prompts like these:

Overwrite path/to/file.js? (Yndeh)

This is fine in normal circumstances, but if you specify this addon as a package to be installed in your setupTest, the test will time out on this prompt with not much to go on:

index "before all" hook:
     Error: Timeout of 600000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.

I'm having a hard time coming up with suggestions on how to resolve this, because the various use cases will surely want to handle it in different ways. In my case, I don't want to overwrite the file, because I've supplied the file in my fixture the way I want to have it.

kimroen commented 7 years ago

The particular use case I am having is in this PR: https://github.com/kimroen/ember-cli-document-title/pull/62

I'm trying to add ember-cli-head as a dependecy in the test, which requires me to create an app/templates/head.hbs file. The test times out on the prompt Overwrite app/templates/head.hbs? (Yndeh).

This can be seen by turning on debug for both ember-fastboot-addon-tests and ember-cli-addon-tests:

DEBUG=ember-fastboot-addon-tests,ember-cli-addon-tests ember fastboot:test

If I kill the right ember process at the right time, the test completes.

simonihmig commented 7 years ago

I see that this is a problem, had this in my mind already, but I don't see an easy solution as well...

The underlying problem is more related to ember-cli-addon-tests, which does the heavy lifting here. Created an issue there: https://github.com/tomdale/ember-cli-addon-tests/issues/157

kimroen commented 7 years ago

Thank you for raising the issue in the appropriate place. I'll try to think of a workaround for now, but I'd be very curious about what a good API could be from the perspective of this addon.