]> source.dussan.org Git - sonarqube.git/commit
Speed up unit tests by improving indexing in unit tests
authorDuarte Meneses <duarte.meneses@sonarsource.com>
Fri, 27 Nov 2020 02:34:42 +0000 (20:34 -0600)
committersonartech <sonartech@sonarsource.com>
Mon, 30 Nov 2020 20:07:06 +0000 (20:07 +0000)
commit736bfc4d5ae032edaf556ee8a41efc1d9b9ce4f9
treed17ef789c14df37e5cbe5692356b1d771ade26aa
parent59adbb849b1ce3338e6299dea939c454df7d0cdb
Speed up unit tests by improving indexing in unit tests

* Unit tests no longer use the LargeSizeHandler for indexing. This handler is designed for indexing large amounts of data and is slower for the data sets used in unit tests.
* Insert all data in DB before indexing in unit tests (there is a huge overhead in each call to index)
37 files changed:
server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/issue/ScmAccountToUserLoaderTest.java
server/sonar-db-dao/src/testFixtures/java/org/sonar/db/TestDbImpl.java
server/sonar-server-common/src/main/java/org/sonar/server/component/index/ComponentIndexer.java
server/sonar-server-common/src/main/java/org/sonar/server/issue/index/IssueIndexer.java
server/sonar-server-common/src/main/java/org/sonar/server/measure/index/ProjectMeasuresIndexer.java
server/sonar-server-common/src/main/java/org/sonar/server/qualityprofile/index/ActiveRuleIndexer.java
server/sonar-server-common/src/main/java/org/sonar/server/rule/index/RuleIndexer.java
server/sonar-server-common/src/main/java/org/sonar/server/user/index/UserIndexer.java
server/sonar-server-common/src/main/java/org/sonar/server/view/index/ViewIndexer.java
server/sonar-server-common/src/test/java/org/sonar/server/component/index/ComponentIndexerTest.java
server/sonar-server-common/src/test/java/org/sonar/server/measure/index/ProjectMeasuresIndexerTest.java
server/sonar-server-common/src/test/java/org/sonar/server/qualityprofile/index/ActiveRuleIndexerTest.java
server/sonar-server-common/src/test/java/org/sonar/server/rule/index/RuleIndexerTest.java
server/sonar-server-common/src/test/java/org/sonar/server/user/index/UserIndexerTest.java
server/sonar-server-common/src/test/java/org/sonar/server/view/index/ViewIndexerTest.java
server/sonar-webserver-auth/src/test/java/org/sonar/server/user/UserUpdaterUpdateTest.java
server/sonar-webserver-core/src/test/java/org/sonar/server/telemetry/TelemetryDataLoaderImplTest.java
server/sonar-webserver-es/src/main/java/org/sonar/server/permission/index/PermissionIndexer.java
server/sonar-webserver-es/src/test/java/org/sonar/server/component/index/ComponentIndexSearchTest.java
server/sonar-webserver-es/src/test/java/org/sonar/server/permission/index/PermissionIndexerTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/component/ws/SearchActionTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/component/ws/SearchProjectsActionTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/component/ws/SuggestionsActionTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/hotspot/ws/SearchActionTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/issue/ws/AuthorsActionTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/issue/ws/SearchActionComponentsTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/issue/ws/SearchActionFacetsTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/issue/ws/SearchActionTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/issue/ws/TagsActionTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/qualityprofile/QProfileRuleImplTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/qualityprofile/ws/ChangeParentActionTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/qualityprofile/ws/InheritanceActionTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/qualityprofile/ws/QProfilesWsMediumTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/qualityprofile/ws/ShowActionTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/rule/ws/SearchActionTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/user/ws/CreateActionTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/user/ws/SearchActionTest.java