Skip to content

Commit 80f9853

Browse files
committed
add sonar's support
1 parent 2cc8012 commit 80f9853

File tree

482 files changed

+1006
-119768
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

482 files changed

+1006
-119768
lines changed

.idea/libraries/Maven__junit_junit_4_12.xml

Lines changed: 0 additions & 13 deletions
This file was deleted.

.idea/libraries/Maven__junit_junit_4_13.xml

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/libraries/Maven__org_junit_platform_junit_platform_launcher_1_7_2.xml

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/libraries/Maven__org_junit_vintage_junit_vintage_engine_5_7_2.xml

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# 开放测试套件(Open Testing Suite)
22

33
## Java 版本和许可证
4-
当前使用 Java 11,Java 8 也没什么问题,稍后调整 Java 8, 11, 16 都支持,采用 Apache v2 许可证。
4+
当前使用 Java 11,Java 8 也没问题,稍后调整 Java 8, 11, 16 都支持,采用 Apache v2 许可证。
55

66
## 测试用例,通过 mvn 构建
77

@@ -26,6 +26,23 @@ mvn clean install checkstyle:checkstyle surefire-report:report site
2626

2727
Build the thing right 和 Build the right thing.
2828

29+
## Sonar
30+
已支持 Sonar,可通过 Sonar 进行代码质量和代码安全的审查和编码规则制定等。
31+
32+
![sonar](docs/images/open-testing-suite-sonar.png)
33+
34+
### 1、容器安装
35+
docker-compose -f src/main/docker/sonar.yml up -d
36+
37+
### 2、运行 (若此步骤不能执行,就试试4)
38+
mvn clean verify sonar:sonar
39+
40+
### 3、重新运行并初始化,属性从 sonar-project.properties 文件中加载。
41+
mvn initialize sonar:sonar
42+
43+
### 4、登录 sonar 创建类似的项目配置信息和token
44+
mvn sonar:sonar -Dsonar.projectKey=open-testing-suite -Dsonar.host.url=http://localhost:9001 -Dsonar.login=2e784a3d2405dd8f4dabc8c03fc6375185286e53
45+
2946
## 参与
3047
欢迎大家提交更多测试用例和应用场景,将 TDD & BDD 更好融入整个研发流程。
3148

19.8 KB
Loading

software.whitebox.iml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,17 @@
1111
</content>
1212
<orderEntry type="inheritedJdk" />
1313
<orderEntry type="sourceFolder" forTests="false" />
14-
<orderEntry type="library" name="Maven: org.junit.jupiter:junit-jupiter-engine:5.7.2" level="project" />
15-
<orderEntry type="library" name="Maven: org.apiguardian:apiguardian-api:1.1.0" level="project" />
16-
<orderEntry type="library" name="Maven: org.junit.platform:junit-platform-engine:1.7.2" level="project" />
17-
<orderEntry type="library" name="Maven: org.opentest4j:opentest4j:1.2.0" level="project" />
18-
<orderEntry type="library" name="Maven: org.junit.platform:junit-platform-commons:1.7.2" level="project" />
19-
<orderEntry type="library" name="Maven: org.junit.jupiter:junit-jupiter-api:5.7.2" level="project" />
14+
<orderEntry type="library" scope="TEST" name="Maven: org.junit.platform:junit-platform-launcher:1.7.2" level="project" />
15+
<orderEntry type="library" scope="TEST" name="Maven: org.apiguardian:apiguardian-api:1.1.0" level="project" />
16+
<orderEntry type="library" scope="TEST" name="Maven: org.junit.platform:junit-platform-engine:1.7.2" level="project" />
17+
<orderEntry type="library" scope="TEST" name="Maven: org.opentest4j:opentest4j:1.2.0" level="project" />
18+
<orderEntry type="library" scope="TEST" name="Maven: org.junit.platform:junit-platform-commons:1.7.2" level="project" />
19+
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-engine:5.7.2" level="project" />
20+
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-api:5.7.2" level="project" />
21+
<orderEntry type="library" scope="TEST" name="Maven: org.junit.vintage:junit-vintage-engine:5.7.2" level="project" />
22+
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.13" level="project" />
2023
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-params:5.7.2" level="project" />
2124
<orderEntry type="library" scope="TEST" name="Maven: org.powermock:powermock-module-junit4:1.6.5" level="project" />
22-
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
2325
<orderEntry type="library" scope="TEST" name="Maven: org.powermock:powermock-module-junit4-common:1.6.5" level="project" />
2426
<orderEntry type="library" scope="TEST" name="Maven: org.powermock:powermock-core:1.6.5" level="project" />
2527
<orderEntry type="library" scope="TEST" name="Maven: org.javassist:javassist:3.20.0-GA" level="project" />

sonar-project.properties

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
sonar.projectKey=OpenTestingSuite
2+
sonar.projectName=Open Testing Suite
3+
sonar.projectVersion=1.0
4+
5+
sonar.sources=src/main/
6+
sonar.host.url=http://localhost:9001
7+
8+
sonar.test.inclusions=src/test/**/*.*, src/main/webapp/app/**/*.spec.ts
9+
sonar.coverage.jacoco.xmlReportPaths=target/site/**/jacoco*.xml
10+
sonar.java.codeCoveragePlugin=jacoco
11+
sonar.junit.reportPaths=target/surefire-reports,target/failsafe-reports
12+
sonar.testExecutionReportPaths=target/test-results/jest/TESTS-results-sonar.xml
13+
sonar.javascript.lcov.reportPaths=target/test-results/lcov.info
14+
15+
sonar.sourceEncoding=UTF-8
16+
sonar.exclusions=src/main/webapp/content/**/*.*, src/main/webapp/i18n/*.js, target/classes/static/**/*.*
17+
18+
sonar.issue.ignore.multicriteria=S3437,S4502,S4684,UndocumentedApi
19+
# Rule https://rules.sonarsource.com/java/RSPEC-3437 is ignored, as a JPA-managed field cannot be transient
20+
sonar.issue.ignore.multicriteria.S3437.resourceKey=src/main/java/**/*
21+
sonar.issue.ignore.multicriteria.S3437.ruleKey=squid:S3437
22+
# Rule https://rules.sonarsource.com/java/RSPEC-1176 is ignored, as we want to follow "clean code" guidelines and classes, methods and arguments names should be self-explanatory
23+
sonar.issue.ignore.multicriteria.UndocumentedApi.resourceKey=src/main/java/**/*
24+
sonar.issue.ignore.multicriteria.UndocumentedApi.ruleKey=squid:UndocumentedApi
25+
# Rule https://rules.sonarsource.com/java/RSPEC-4502 is ignored, as for JWT tokens we are not subject to CSRF attack
26+
sonar.issue.ignore.multicriteria.S4502.resourceKey=src/main/java/**/*
27+
sonar.issue.ignore.multicriteria.S4502.ruleKey=squid:S4502
28+
# Rule https://rules.sonarsource.com/java/RSPEC-4684
29+
sonar.issue.ignore.multicriteria.S4684.resourceKey=src/main/java/**/*
30+
sonar.issue.ignore.multicriteria.S4684.ruleKey=java:S4684

src/main/docker/sonar.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: '3.8'
2+
services:
3+
opentestingsuite-sonar:
4+
image: sonarqube:8.9.1-community
5+
6+
environment:
7+
- sonar.forceAuthentication=false
8+
9+
ports:
10+
- 127.0.0.1:9001:9000

target/checkstyle-cachefile

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)