Hello guys,
In my company we use SonarQube, we have one repository with a src folder where we have web, mobile and shared folders, we have one jest config to run web ReactJS tests and another jest config to run mobile React-Native tests. Currently, we use this gitlab CI task to run SonarQube:
test-and-sonar:
stage: audit
image: docker.tag/sonar-scanner:latest
before_script:
- npm install --save-dev jest-junit
script:
- apk add nodejs build-base gcc
- npm install -D typescript
- npx jest --ci --reporters=default --reporters=jest-junit --coverage
- sonar-scanner ${SONAR_OPTS}
-Dsonar.host.url=https://sonarqube.tag
-Dsonar.jdbc.login="${SONARQUBE_TOKEN}"
-Dsonar.token="${SONARQUBE_TOKEN}"
-Dsonar.gitlab.project_id="${CI_PROJECT_PATH}"
-Dsonar.gitlab.commit_sha="${CI_COMMIT_SHA}"
-Dsonar.gitlab.ref_name="${CI_COMMIT_REF_NAME}"
-Dsonar.gitlab.user_token="${SONAR_GITLAB_TOKEN}"
-Dsonar.java.binaries=build/classes
-Dsonar.javascript.lcov.reportPaths=coverage/lcov.info
-Dsonar.sources=src,stories
-Dsonar.exclusions=android/**,ios/**,**/*.java,**/*.jar
-Dsonar.tests=__tests__
-Dsonar.test.inclusions=shared/**/*.test.tsx,shared/**/*.test.ts,web/**/*.test.tsx,web/**/*.test.ts
needs: []
dependencies: []
allow_failure: true
artifacts:
reports:
junit:
- junit.xml
only:
refs:
- master
- merge_requests
As we can see, we only run the web ReactJS tests:
- npx jest --ci --reporters=default --reporters=jest-junit --coverage
Now, we want to run also the mobile React-Native tests and also get the code coverage of SonarQube.
Is it possible to get the SonarQube code analyzes for these 2 projects?
Thanks in advance for your attention.