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

Test coverage support #129

Open
bergie opened this issue Oct 30, 2017 · 10 comments
Open

Test coverage support #129

bergie opened this issue Oct 30, 2017 · 10 comments

Comments

@bergie
Copy link
Member

bergie commented Oct 30, 2017

It would be nice to be able to get test coverage reports from fbp-spec. Something like https://www.npmjs.com/package/nyc

@bergie
Copy link
Member Author

bergie commented Oct 30, 2017

Note: nyc claims suppor for applications that spawn subprocesses so fbp-spec might be possible to make work.

@jonnor
Copy link
Contributor

jonnor commented Oct 30, 2017

Does nyc produce a report file somewhere from running the tests? Have you tried wrapping the runtime command in it to see if it just works?

@jonnor
Copy link
Contributor

jonnor commented Oct 30, 2017

Generally this is something that needs to happen on the runtime side, and in a runtime-specific manner, as how to compute coverage depends entirely on the language/execution-environment in use.

@bergie
Copy link
Member Author

bergie commented Oct 30, 2017

@jonnor tried wrapping fbp-spec (via its mocha interface) to nyc, and at least that didn't work:

noflo/noflo-core#108

Getting zero coverage for the components we test via fbp-spec (but normal coverage for the ones we test via Mocha)

@jonnor
Copy link
Contributor

jonnor commented Oct 30, 2017

@bergie what do you mean does not work? Looks fine here

noflo-core-nyc-coverage

@bergie
Copy link
Member Author

bergie commented Oct 30, 2017

@jonnor yes, see zero coverage reported for Repeat and RepeatAsync, which are fbp-spec tested. Everything else is tested via plain Mocha

@jonnor
Copy link
Contributor

jonnor commented Oct 30, 2017

@bergie ok. Does not work when running nyc infront of fbp-spec either, does not pick up any files at all.
So either subprocess tracking is off, it cannot handle the indirect file loading (though noflo.ComponentLoader seems to work for other), there is a problem with .js versus .coffee files or similar

@bergie
Copy link
Member Author

bergie commented Oct 30, 2017

@jonnor
Copy link
Contributor

jonnor commented Oct 30, 2017

Presumably that needs to be done in the process which uses the coffee files. Which would explain why it is not working in fbp-spec case: It is the runtime that requires the files (not fbp-spec), and there is no such registration there. noflo-nodejs does not have such an option either, I think?

@bergie
Copy link
Member Author

bergie commented Oct 30, 2017

@jonnor correct, we should probably add a mocha-style --require option to noflo-nodejs.

But first to verify this, it might make sense to add this manually to noflo-nodejs

Update: tried patching that to noflo-nodejs locally, and still got zero coverage

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

No branches or pull requests

2 participants