summaryrefslogtreecommitdiff
path: root/cli/tools/coverage.rs
AgeCommit message (Collapse)Author
2022-01-11fix(coverage): merge coverage ranges (#13334)Bartek Iwańczuk
Covered ranges were not merged and thus it appeared that some lines might be uncovered. To fix this I used "v8-coverage" that takes care of merging the ranges properly. With this change, coverage collected from a file by multiple entrypoints is now correctly calculated. I ended up forking https://github.com/demurgos/v8-coverage and adding "cli/tools/coverage/merge.rs" and "cli/tools/coverage/range_tree.rs".
2022-01-10fix(coverage): don't type check (#13324)Bartek Iwańczuk
This commit changes "deno coverage" command not to type check. Instead of relying on infrastructure for module loading in "deno run"; the code now directly reaches into cache for original and transpiled sources. In case sources are not available the error is returned to the user, suggesting to first run "deno test --coverage" command.
2022-01-07chore: update copyright to 2022 (#13306)Ryan Dahl
Co-authored-by: Erfan Safari <erfanshield@outlook.com>
2021-12-23fix(coverage): use only string byte indexes and 0-indexed line numbers (#13190)David Sherret
2021-12-20refactor: Use dedicated flags structures (#13148)Bartek Iwańczuk
2021-12-17fix(cli/tools/coverage): Split sources by char index (#13114)Nayeem Rahman
2021-12-07feat(cli): use deno fmt for lock and coverage files (#13018)WenheLI
2021-11-16fix(cli): short-circuit in prepare_module_load() (#12604)Nayeem Rahman
2021-10-11refactor: integrate deno_graph into CLI (#12369)Kitson Kelly
2021-10-06Revert "fix(cli): ensure empty lines don't count towards coverage (#11957)" ↵Bartek Iwańczuk
(#12348) This reverts commit d5b38a992933db5cb2d0221e9d82af191022dad5.
2021-10-06fix(cli): ensure empty lines don't count towards coverage (#11957)Casper Beyer
2021-09-24refactor: Rename ProgramState to ProcState (#12204)Ryan Dahl
Move Arc into struct
2021-09-07refactor(lsp): use deno_ast and cache swc ASTs (#11780)David Sherret
2021-08-06refactor: make `ParsedModule` implement `Sync` (#11581)David Sherret
2021-07-30chore: upgrade Rust to 1.54.0 (#11554)Yusuke Tanaka
2021-07-26fix(cli): side-load test modules (#11515)Casper Beyer
This fixes a regression introduced in 1.9 where test modules became main modules by side loading them in a generated module.
2021-07-08refactor(cli/tools/coverage): strongly type inspector values (#11326)Casper Beyer
2021-06-29fix(cli): pretty print coverage files (#11157)Casper Beyer
2021-05-26refactor: move JsRuntimeInspector to deno_core (#10763)Bartek Iwańczuk
This commit moves implementation of "JsRuntimeInspector" to "deno_core" crate. To achieve that following changes were made: * "Worker" and "WebWorker" no longer own instance of "JsRuntimeInspector", instead it is now owned by "deno_core::JsRuntime". * Consequently polling of inspector is no longer done in "Worker"/"WebWorker", instead it's done in "deno_core::JsRuntime::poll_event_loop". * "deno_core::JsRuntime::poll_event_loop" and "deno_core::JsRuntime::run_event_loop", now accept "wait_for_inspector" boolean that tells if event loop should still be "pending" if there are active inspector sessions - this change fixes the problem that inspector disconnects from the frontend and process exits once the code has stopped executing.
2021-05-26refactor: Rewrite Inspector implementation (#10725)Bartek Iwańczuk
This commit refactors implementation of inspector. The intention is to be able to move inspector implementation to "deno_core". Following things were done to make that possible: * "runtime/inspector.rs" was split into "runtime/inspector/mod.rs" and "runtime/inspector/server.rs", separating inspector implementation from Websocket server implementation. * "DenoInspector" was renamed to "JsRuntimeInspector" and reference to "server" was removed from the structure, making it independent of Websocket server used to connect to Chrome Devtools. * "WebsocketSession" was renamed to "InspectorSession" and rewritten in such a way that it's not tied to Websockets anymore; instead it accepts a pair of "proxy" channel ends that allow to integrate the session with different "transports". * "InspectorSession" was renamed to "LocalInspectorSession" to better indicate that it's an "in-memory" session and doesn't require Websocket server. It was also rewritten in such a way that it uses "InspectorSession" from previous point instead of reimplementing "v8::inspector::ChannelImpl" trait; this is done by using the "proxy" channels to communicate with the V8 session. Consequently "LocalInspectorSession" is now a frontend to "InspectorSession". This introduces a small inconvenience that awaiting responses for "LocalInspectorSession" requires to concurrently poll worker's event loop. This arises from the fact that "InspectorSession" is now owned by "JsRuntimeInspector", which in turn is owned by "Worker" or "WebWorker". To ease this situation "Worker::with_event_loop" helper method was added, that takes a future and concurrently polls it along with the event loop (using "tokio::select!" macro inside a loop).
2021-05-17fix: static import permissions in dynamic importsLuca Casonato
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2021-03-25upgrade: Rust 1.51.0 (#9895)Yusuke Tanaka
2021-03-08fix(coverage): ensure single line functions don't yield false positives (#9717)Casper Beyer
2021-03-01feat(cli): represent type dependencies in info (#9630)Kitson Kelly
Fixes #7927
2021-02-24feat: add "deno coverage" subcommand (#8664)Casper Beyer
This commit adds a new subcommand called "coverage" which can generate code coverage reports to stdout in multiple formats from code coverage profiles collected to disk. Currently this supports outputting a pretty printed diff and the lcov format for interoperability with third-party services and tools. Code coverage is still collected via other subcommands that run and collect code coverage such as "deno test --coverage=<directory>" but that command no longer prints a pretty printed report at the end of a test run with coverage collection enabled. The restrictions on which files that can be reported on has also been relaxed and are fully controllable with the include and exclude regular expression flags on the coverage subcommand. Co-authored-by: Luca Casonato <lucacasonato@yahoo.com>
2021-02-17Make ModuleSpecifier a type alias, not wrapper struct (#9531)Ryan Dahl
2021-01-29fix(cli/coverage): display mapped instrumentation line counts (#9310)Casper Beyer
2021-01-28fix(coverage): use source maps when printing pretty reports (#9278)Casper Beyer
This commits makes use of source maps and the original source when printing lacking line coverage in the pretty printer. Only the executable lines are checked as before (as non-executable lines will always be ignored anyways). The lines then mapped to the appropriate source line when a source map is present.
2021-01-20fix(coverage): ignore comments (#8639)Casper Beyer
This commit fixes coverage collection by ignoring comments when tallying up line counts.
2021-01-11chore: update copyright to 2021 (#9092)Yusuke Tanaka
2021-01-07fix(coverage): report partial lines as uncovered (#9033)Casper Beyer
2021-01-07fix(coverage): do not store source inline in raw reports (#9025)Casper Beyer
When we were doing single process in-memory reports getting the source from the runtime was practical, but now that we're writing to disk this conflicts with the format tools taking raw v8 coverage dumps expect.
2021-01-04fix(coverage): merge duplicate reports (#8942)Casper Beyer
Merging multiple runs isn't quite right because we rely on a 0 count to signal that a block hasn't been called. Other tools like c8 expect this to be true as-well so we need to do our best to merge coverage files rather than duplicating them.
2020-12-21feat(unstable): record raw coverage into a directory (#8642)Casper Beyer
2020-12-13refactor: deno_runtime crate (#8640)Bartek Iwańczuk
This commit moves Deno JS runtime, ops, permissions and inspector implementation to new "deno_runtime" crate located in "runtime/" directory. Details in "runtime/README.md". Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2020-11-24feat(test): horizontal separator between disjoint runs of lines (#8484)Valentin Anger
Places a newline between non-consecutive line block in coverage report to improve readability.
2020-11-19refactor(cli): move tooling to cli/tools/ (#8424)Bartek Iwańczuk
This commit moves following tools into a single "tools" module located at "cli/tools/mod.rs": - formatter - linter - test runner - coverage collector - installer - binary upgrader - repl