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

[🚫 Bug] Coverage option produces not expected output #1463

Open
rH4rtinger opened this issue Aug 5, 2024 · 2 comments
Open

[🚫 Bug] Coverage option produces not expected output #1463

rH4rtinger opened this issue Aug 5, 2024 · 2 comments
Labels
bug Something isn't working
Milestone

Comments

@rH4rtinger
Copy link

Describe the bug

I have a extension that is built via webpack.

When I try to get the coverage, I needed to give the option -u, otherwise I would not get any coverage result.

The result I got was from my minified file built by webpack. This is not good for getting any coverage result, because you can not read any information from a file, that has just one line.

script in package.json:

"scripts": {
   "vscode:prepublish": "webpack --mode production --devtool hidden-source-map",
   "test:e2e:coverage": "extest setup-and-run  'out/test/e2e/**/*.test.js' -u -e ./out/e2e/extensions  --coverage"
}

This is the start of my coverage report.
image
Note that there are no more lines.

I tried switching my mode for building to development. This produced no coverage.

Expected behavior

  1. Coverage should produce any output without needing to give the -u flag.
  2. Coverage should produce a good output, even when using webpack. Or working with development flag from webpack.

Steps to reproduce

1. Built an extension with webpack
2. Try to get a coverage result

Logs

NOTE: This is the end of the log output from the webpack build with development flag on.


Shutting down the browser
[main 2024-08-05T06:40:09.786Z] Extension host with pid 25360 exited with code: 0, signal: unknown.
----------|---------|----------|---------|---------|-------------------
File      | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
----------|---------|----------|---------|---------|-------------------
All files |       0 |        0 |       0 |       0 | 
----------|---------|----------|---------|---------|-------------------

Operating System

Windows 10

Visual Studio Code

1.92.0

vscode-extension-tester

8.5.0

NodeJS

22.4.0

npm

10.8.1

@rH4rtinger rH4rtinger added bug Something isn't working new-issue New issue which was not discussed yet labels Aug 5, 2024
@TamiTakamiya
Copy link
Contributor

@rH4rtinger Our extension is also using minified js files in the production code for client (extension) and server (language server) par. For getting code coverage performed by vscode-extension-tester, we exclude them and only performed webpack on the js files used in webviews. You may want to see the webpack.conig.ts file that we are using. Could you implement a similar change to your webpack configuration file?

@rH4rtinger
Copy link
Author

I can not modify my webpack config file in the way you do, because my extension consists from just one entry point. If I remove this entry point, then nothing will build.

I created a example project with the coverage results checked in.

If you check out the extension.js coverage, you can see that the results that I get are not really informative.

@djelinek djelinek removed the new-issue New issue which was not discussed yet label Aug 13, 2024
@djelinek djelinek moved this from New to Backlog in ExTester Aug 13, 2024
@djelinek djelinek added this to the BACKLOG milestone Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Backlog
Development

No branches or pull requests

3 participants