Skip to content

[wip] Change confirmBlueprinted to test against fixtures#7557

Closed
ro0gr wants to merge 24 commits intoember-cli:masterfrom
ro0gr:new-tests
Closed

[wip] Change confirmBlueprinted to test against fixtures#7557
ro0gr wants to merge 24 commits intoember-cli:masterfrom
ro0gr:new-tests

Conversation

@ro0gr
Copy link
Copy Markdown
Contributor

@ro0gr ro0gr commented Jan 14, 2018

When worked on MU blueprints improvements I've noticed that the current confirmBlueprinted is not a very suitable tool for testing of blueprints because:

  • it does relies on blueprint internals
  • it doesn't test file contents
  • it doesn't allow to test custom logic in blueprint's index.js

This pr tries to address these issues by testing of new and addon commands output against the fixtures. I've chosen fixturify to deal with fixtures. It seems quite a convenient tool cause it efficiently serializes fs layout including file contents into a POJOs which allows us to make deep equals with ease.

I would appreciate a feedback before I've gone too far. Does it look like a good direction?

TODO:

  • split welcome tests from yarn tests
  • unify expectProject tests and "verify fixtures" tests.
  • add lodash.{get,set} to ember-cli-lodash-subset
    worked around by flattening fixturify results
  • cut number of module-unification-app fixture files by re-using app's project files
  • fix tests

'foo',
'--skip-npm',
'--skip-bower',
'--no-welcome',
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currently we have welcome only in yarn fixtures. This forces me to disable welcome when I test w/o yarn. I think we should decouple testing of welcome from yarn and drop all of this extra --no-welcome flags for npm tests.

@ro0gr ro0gr mentioned this pull request Jan 14, 2018
29 tasks
@ro0gr ro0gr changed the title [wip] Test blueprints output with fixturify [wip] Change confirmBlueprinted to test against fixtures Jan 14, 2018
@ro0gr
Copy link
Copy Markdown
Contributor Author

ro0gr commented Jan 28, 2018

I've just cleaned up (ae8cf32) MU fixtures and tests detected that few of MU blueprint files become out of sync (466cd26)

@ro0gr
Copy link
Copy Markdown
Contributor Author

ro0gr commented Jan 29, 2018

Currently I'm not sure what do CI failures try to tell me. I've tested it locally on both windows and macos machines and tests pass.

Maybe it's a call to improve a fixtures diff error message... 🤔

@ro0gr
Copy link
Copy Markdown
Contributor Author

ro0gr commented Feb 2, 2018

see #7595

@ro0gr ro0gr closed this Feb 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant