TritonDataCenter / node-manta

Node.js SDK for Manta
75 stars 54 forks source link

Proposal: use a different test framework #297

Closed geek closed 5 years ago

geek commented 7 years ago

Current issues:

  1. When there is an issue in a test you get an unhelpful FAILURES: Undone tests (or their setups/teardowns):.
  2. Cannot run a range of tests
  3. No code coverage reporting
  4. No grouping of similar tests (no describe)

Proposal: Move to lab or another compatible framework. I suggest lab because I maintain it and it has built-in code coverage support.

I am happy to migrate the tests over to lab, just let me know.

trentm commented 7 years ago

Wyatt,

Perhaps tape? We've a lot of repos using that and have generally been moving to tape when selecting something other than nodeunit. Agreed that nodeunit isn't serving us well.

$ cd ~/all-joy-repos # actually just "many" of joyent's repos, not a complete list $ ls /package.json | wc -l 102 $ grep nodeunit /package.json | wc -l 31 $ grep tape */package.json | wc -l 32

Trent

-- Trent

On Mon, Jan 9, 2017 at 7:42 PM, Wyatt Preul notifications@github.com wrote:

Current issues:

  1. When there is an issue in a test you get an unhelpful FAILURES: Undone tests (or their setups/teardowns):.
  2. Cannot run a range of tests
  3. No code coverage reporting
  4. No grouping of similar tests (no describe)

Proposal: Move to lab or another compatible framework. I suggest lab because I maintain it and it has built-in code coverage support.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/joyent/node-manta/issues/297, or mute the thread https://github.com/notifications/unsubscribe-auth/AAC3Erucjh0Eu8HxXi5g4h1O3lB894pIks5rQv4VgaJpZM4LfADR .

davepacheco commented 7 years ago

I use catest for my modules.

For what it's worth, you can run individual test files with nodeunit, but I don't think there's a way of running individual tests within files.

Would we have to rewrite all the tests to switch to lab or tape? How would we verify that the tests still test the right things?

pfmooney commented 7 years ago

When I've converted other modules from nodeunit to tape, I don't believe too much rework was required on the tests themselves. If the setup/teardown functionality in nodeunit was used, those portions needed to be converted into something that tape could handle. (It doesn't have a "native" mechanism for that.)

trentm commented 7 years ago

@pfmooney Two of node-manta's test files have setUp and tearDown usage. For imgapi's and other repos' migration to tape I've just changed those to separate "test(...)" calls at the start and end of the file, which has worked fine.

pfmooney commented 7 years ago

@trentm Yeah, I've used a custom little tape pattern in other repos which required setup/teardown on a large number of tests. The challenge of fixing that small aspect has always outweighed the problems of nodeunit.

trentm commented 5 years ago

I'm stealing this issue and replacing it with https://smartos.org/bugview/MANTA-4432 Sorry for the bug system change.