Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
csentry
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anders Harrisson
csentry
Commits
15d5e2a6
Commit
15d5e2a6
authored
7 years ago
by
Benjamin Bertrand
Browse files
Options
Downloads
Patches
Plain Diff
Add code analysis stage using sonar-scanner
Create unit test and coverage report with pytest
parent
737f9f58
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+3
-0
3 additions, 0 deletions
.gitignore
.gitlab-ci.yml
+15
-1
15 additions, 1 deletion
.gitlab-ci.yml
sonar-project.properties
+11
-0
11 additions, 0 deletions
sonar-project.properties
with
29 additions
and
1 deletion
.gitignore
+
3
−
0
View file @
15d5e2a6
...
...
@@ -7,3 +7,6 @@ settings*.cfg
.cache
.coverage
/docs/_build
.scannerwork
coverage.xml
junit.xml
This diff is collapsed.
Click to expand it.
.gitlab-ci.yml
+
15
−
1
View file @
15d5e2a6
...
...
@@ -15,6 +15,7 @@ variables:
stages
:
-
build
-
test
-
analyse
-
release
-
deploy
...
...
@@ -38,7 +39,20 @@ test:
-
redis:4.0
before_script
:
[]
script
:
-
pytest --cov=app -v
-
pytest --junitxml=junit.xml --cov-report xml:coverage.xml --cov=app -v
artifacts
:
paths
:
-
junit.xml
-
coverage.xml
expire_in
:
1 hour
analyse
:
<<
:
*runner_tags
stage
:
analyse
image
:
registry.esss.lu.se/ics-docker/sonar-scanner:3
before_script
:
[]
script
:
-
sonar-scanner -Dsonar.login=$SONARQUBE_TOKEN -Dsonar.projectVersion=$CI_COMMIT_REF_NAME
release-image
:
<<
:
*runner_tags
...
...
This diff is collapsed.
Click to expand it.
sonar-project.properties
0 → 100644
+
11
−
0
View file @
15d5e2a6
# must be unique in a given SonarQube instance
sonar.projectKey
=
csentry
# this is the name displayed in the SonarQube UI.
sonar.projectName
=
CSEntry
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
# This property is optional if sonar.modules is set.
sonar.sources
=
app
sonar.python.xunit.reportPath
=
junit.xml
sonar.python.coverage.reportPath
=
coverage.xml
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment