Skip to content

Commit 2a83336

Browse files
authored
feat: Implement the test coverage feature (#1637) (#1639)
Signed-off-by: Sheng Chen <[email protected]>
1 parent 650af8a commit 2a83336

File tree

36 files changed

+988
-71
lines changed

36 files changed

+988
-71
lines changed

.azure-pipelines/vscode-java-test-nightly.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,6 @@ extends:
6767
command: custom
6868
verbose: false
6969
customCommand: run build-plugin
70-
- task: Npm@1
71-
displayName: npm run compile
72-
inputs:
73-
command: custom
74-
verbose: false
75-
customCommand: run compile
7670
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@2
7771
displayName: ESRP CodeSigning
7872
inputs:

.azure-pipelines/vscode-java-test-rc.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,6 @@ extends:
6262
command: custom
6363
verbose: false
6464
customCommand: run build-plugin
65-
- task: Npm@1
66-
displayName: npm run compile
67-
inputs:
68-
command: custom
69-
verbose: false
70-
customCommand: run compile
7165
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@2
7266
displayName: ESRP CodeSigning
7367
inputs:

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,4 @@ node_modules
5252
resources/templates/css/**
5353
resources/templates/js/**
5454
resources/templates/fonts/**
55-
dist
56-
**/vscode.d.ts
57-
**/vscode.proposed.d.ts
55+
dist

.vscode/settings.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,7 @@
1313
"**/archetype-resources/**",
1414
"**/META-INF/maven/**",
1515
"**/test/test-projects/**"
16-
]
16+
],
17+
"java.checkstyle.version": "8.18",
18+
"java.checkstyle.configuration": "${workspaceFolder}/java-extension/build-tools/src/main/resources/checkstyle/checkstyle.xml",
1719
}

.vscodeignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ extension.bundle.ts
2121
javaConfig.json
2222
.github/**
2323
.azure-pipelines/**
24+
vscode.d.ts
2425

2526
# Ignore output of code sign
2627
server/*.md

ThirdPartyNotices.txt

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@ This project incorporates components from the projects listed below. The origina
1212
5. Eskibear/vscode-extension-telemetry-wrapper (https://github.com/Eskibear/vscode-extension-telemetry-wrapper)
1313
6. google/gson (https://github.com/google/gson)
1414
7. isaacs/node-lru-cache (https://github.com/isaacs/node-lru-cache)
15-
8. jprichardson/node-fs-extra (https://github.com/jprichardson/node-fs-extra)
16-
9. junit-team/junit5 (https://github.com/junit-team/junit5)
17-
10. lodash/lodash (https://github.com/lodash/lodash)
18-
11. microsoft/vscode-languageserver-node (https://github.com/microsoft/vscode-languageserver-node)
19-
12. ota4j-team/opentest4j (https://github.com/ota4j-team/opentest4j)
20-
13. sindresorhus/get-port (https://github.com/sindresorhus/get-port)
15+
8. jacoco/jacoco (https://github.com/jacoco/jacoco)
16+
9. jprichardson/node-fs-extra (https://github.com/jprichardson/node-fs-extra)
17+
10. junit-team/junit5 (https://github.com/junit-team/junit5)
18+
11. lodash/lodash (https://github.com/lodash/lodash)
19+
12. microsoft/vscode-languageserver-node (https://github.com/microsoft/vscode-languageserver-node)
20+
13. ota4j-team/opentest4j (https://github.com/ota4j-team/opentest4j)
21+
14. sindresorhus/get-port (https://github.com/sindresorhus/get-port)
2122

2223
%% Apache Commons Lang NOTICES AND INFORMATION BEGIN HERE
2324
=========================================
@@ -976,6 +977,25 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
976977
=========================================
977978
END OF isaacs/node-lru-cache NOTICES AND INFORMATION
978979

980+
%% jacoco/jacoco NOTICES AND INFORMATION BEGIN HERE
981+
=========================================
982+
License
983+
=======
984+
985+
Copyright (c) 2009, 2023 Mountainminds GmbH & Co. KG and Contributors
986+
987+
The JaCoCo Java Code Coverage Library and all included documentation is made
988+
available by Mountainminds GmbH & Co. KG, Munich. Except indicated below, the
989+
Content is provided to you under the terms and conditions of the Eclipse Public
990+
License Version 2.0 ("EPL"). A copy of the EPL is available at
991+
[https://www.eclipse.org/legal/epl-2.0/](https://www.eclipse.org/legal/epl-2.0/).
992+
993+
Please visit
994+
[http://www.jacoco.org/jacoco/trunk/doc/license.html](http://www.jacoco.org/jacoco/trunk/doc/license.html)
995+
for the complete license information including third party licenses and trademarks.
996+
=========================================
997+
END OF jacoco/jacoco NOTICES AND INFORMATION
998+
979999
%% jprichardson/node-fs-extra NOTICES AND INFORMATION BEGIN HERE
9801000
=========================================
9811001
(The MIT License)
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" output="target/classes" path="src/main/java">
4+
<attributes>
5+
<attribute name="optional" value="true"/>
6+
<attribute name="maven.pomderived" value="true"/>
7+
</attributes>
8+
</classpathentry>
9+
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
10+
<attributes>
11+
<attribute name="maven.pomderived" value="true"/>
12+
<attribute name="optional" value="true"/>
13+
</attributes>
14+
</classpathentry>
15+
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
16+
<attributes>
17+
<attribute name="optional" value="true"/>
18+
<attribute name="maven.pomderived" value="true"/>
19+
<attribute name="test" value="true"/>
20+
</attributes>
21+
</classpathentry>
22+
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
23+
<attributes>
24+
<attribute name="maven.pomderived" value="true"/>
25+
<attribute name="test" value="true"/>
26+
<attribute name="optional" value="true"/>
27+
</attributes>
28+
</classpathentry>
29+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
30+
<attributes>
31+
<attribute name="maven.pomderived" value="true"/>
32+
</attributes>
33+
</classpathentry>
34+
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
35+
<attributes>
36+
<attribute name="maven.pomderived" value="true"/>
37+
</attributes>
38+
</classpathentry>
39+
<classpathentry kind="src" path="target/generated-sources/annotations">
40+
<attributes>
41+
<attribute name="optional" value="true"/>
42+
<attribute name="maven.pomderived" value="true"/>
43+
<attribute name="ignore_optional_problems" value="true"/>
44+
<attribute name="m2e-apt" value="true"/>
45+
</attributes>
46+
</classpathentry>
47+
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
48+
<attributes>
49+
<attribute name="optional" value="true"/>
50+
<attribute name="maven.pomderived" value="true"/>
51+
<attribute name="ignore_optional_problems" value="true"/>
52+
<attribute name="m2e-apt" value="true"/>
53+
<attribute name="test" value="true"/>
54+
</attributes>
55+
</classpathentry>
56+
<classpathentry kind="output" path="target/classes"/>
57+
</classpath>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>coverage-test</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.m2e.core.maven2Builder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
</buildSpec>
19+
<natures>
20+
<nature>org.eclipse.jdt.core.javanature</nature>
21+
<nature>org.eclipse.m2e.core.maven2Nature</nature>
22+
</natures>
23+
<filteredResources>
24+
<filter>
25+
<id>1709104275722</id>
26+
<name></name>
27+
<type>30</type>
28+
<matcher>
29+
<id>org.eclipse.core.resources.regexFilterMatcher</id>
30+
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
31+
</matcher>
32+
</filter>
33+
</filteredResources>
34+
</projectDescription>
Binary file not shown.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
6+
<groupId>com.example</groupId>
7+
<artifactId>coverage-test</artifactId>
8+
<version>1.0-SNAPSHOT</version>
9+
10+
<properties>
11+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
12+
<maven.compiler.source>17</maven.compiler.source>
13+
<maven.compiler.target>${maven.compiler.source}</maven.compiler.target>
14+
</properties>
15+
16+
<dependencyManagement>
17+
<dependencies>
18+
<dependency>
19+
<groupId>org.junit</groupId>
20+
<artifactId>junit-bom</artifactId>
21+
<version>5.7.1</version>
22+
<type>pom</type>
23+
<scope>import</scope>
24+
</dependency>
25+
</dependencies>
26+
</dependencyManagement>
27+
28+
<dependencies>
29+
<dependency>
30+
<groupId>org.junit.jupiter</groupId>
31+
<artifactId>junit-jupiter</artifactId>
32+
<scope>test</scope>
33+
</dependency>
34+
</dependencies>
35+
36+
<build>
37+
<plugins>
38+
<plugin>
39+
<artifactId>maven-compiler-plugin</artifactId>
40+
<version>3.8.1</version>
41+
</plugin>
42+
<plugin>
43+
<artifactId>maven-surefire-plugin</artifactId>
44+
<version>2.22.2</version>
45+
</plugin>
46+
</plugins>
47+
</build>
48+
49+
</project>

0 commit comments

Comments
 (0)