Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.0 Breaking Change #124

Closed
hueniverse opened this issue Jul 23, 2014 · 6 comments
Closed

4.0 Breaking Change #124

hueniverse opened this issue Jul 23, 2014 · 6 comments
Assignees
Milestone

Comments

@hueniverse
Copy link
Member

@hueniverse hueniverse commented Jul 23, 2014

Motivation:

  • Remove conflicts between a locally and a globally installed lab. Allow using a global command to run tests which directly require a local lab copy.
  • Provide a clean test API that can be scripted without having to use the runner CLI.
  • Use lab to test lab including coverage.
  • Make it easy to build fancy test runners on top without having to fork.

Changes:

  • No longer uses a global test tree. Instead, each test module exports a lab object which is collected by the runner and executed.
  • Changed -I long option from --ignore-globals to globals
  • Removed -G option
  • Failed before/beforeEach will fail all the tests they apply to
  • Any code other than tests will no longer run in protected mode (inside a domain) and will abort the entire test script by throwing an exception.

Migration notes:

Instead of:

var Lab = require('lab');
var describe = Lab.describe;

It is now:

var Lab = require('lab');
var lab = exports.lab = Lab.script();
var describe = lab.describe;
@hueniverse hueniverse added this to the 4.0.0 milestone Jul 23, 2014
@hueniverse hueniverse self-assigned this Jul 23, 2014
@othiym23

This comment has been minimized.

Copy link

@othiym23 othiym23 commented Jul 25, 2014

Although the factoring of tap is weird, I like that each TAP file is run independently by tap-runner. This turns out to be pretty important when tests are making alterations to the runtime (which is a problem I've probably had to deal with more than most, so discount its importance accordingly). It also removes conflicts between local and global tap, because the tap runner is just running the individual files and grabbing the output. I'm curious how the API change you've sketched out supports this goal.

@othiym23

This comment has been minimized.

Copy link

@othiym23 othiym23 commented Jul 25, 2014

I really like points #2 and #4 of the motivation section, and am also curious how the new API supports those goals.

In general, having the suites be individual objects, and having to do so much binding to follow the pattern I'm most comfortable with, feels a little janky (to use the technical term). I don't hate it, but it does make it feel like maybe I'm not the target user for this framework.

@hueniverse

This comment has been minimized.

Copy link
Member Author

@hueniverse hueniverse commented Jul 25, 2014

@othiym23 - Between your feedback and @phated I changed it to look almost the same as the current API.

Instead of:

var Lab = require('lab');
var describe = Lab.describe;

It is now:

var Lab = require('lab');
var lab = exports.lab = Lab.script();
var describe = lab.describe;
@othiym23

This comment has been minimized.

Copy link

@othiym23 othiym23 commented Jul 26, 2014

🙆 🎆

@hueniverse

This comment has been minimized.

Copy link
Member Author

@hueniverse hueniverse commented Jul 26, 2014

@othiym23 that's a yes?

@othiym23

This comment has been minimized.

Copy link

@othiym23 othiym23 commented Jul 26, 2014

What about "OK lady fireworks" doesn't sound positive to you? Yes, I think this is a good way to clean things up. It is also the end of a very long week and I am slightly punchy, so sorry about that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.