Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
teknikattan-scoring-system
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package 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
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tddd96-grupp1
teknikattan-scoring-system
Commits
89effbe6
Commit
89effbe6
authored
4 years ago
by
Albin Henriksson
Browse files
Options
Downloads
Patches
Plain Diff
#7
: Added a script to client coverage report to format xml
parent
c6f6f097
No related branches found
Branches containing commit
No related tags found
1 merge request
!12
Issue/7 add test coverage report
Pipeline
#34169
failed
4 years ago
Changes
4
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitlab-ci.yml
+1
-0
1 addition, 0 deletions
.gitlab-ci.yml
.gitlab/client.gitlab-ci.yml
+17
-0
17 additions, 0 deletions
.gitlab/client.gitlab-ci.yml
client/coverage_report.py
+8
-0
8 additions, 0 deletions
client/coverage_report.py
client/src/App.tsx
+1
-1
1 addition, 1 deletion
client/src/App.tsx
with
27 additions
and
1 deletion
.gitlab-ci.yml
+
1
−
0
View file @
89effbe6
stages
:
-
setup
-
test
-
coverage_report
include
:
-
local
:
.gitlab/server.gitlab-ci.yml
...
...
This diff is collapsed.
Click to expand it.
.gitlab/client.gitlab-ci.yml
+
17
−
0
View file @
89effbe6
...
...
@@ -51,6 +51,23 @@ client:test:
-
cd client
-
npm run test:coverage
coverage
:
/All files\s*\|\s*([\d\.]+)/
artifacts
:
reports
:
path
:
client/output/coverage/jest/cobertura-coverage.xml
expire_in
:
5 min
client:coverage_report
:
image
:
python
stage
:
coverage_report
only
:
refs
:
-
dev
-
merge_requests
changes
:
-
client/**/*
script
:
-
cd client
-
python coverage_report.py
artifacts
:
reports
:
cobertura
:
client/output/coverage/jest/cobertura-coverage.xml
This diff is collapsed.
Click to expand it.
client/coverage_report.py
0 → 100644
+
8
−
0
View file @
89effbe6
import
xml.etree.ElementTree
as
et
tree
=
et
.
parse
(
'
output/coverage/jest/cobertura-coverage.xml
'
)
root
=
tree
.
getroot
()
for
package_class
in
tree
.
find
(
'
.//packages
'
):
package_class
.
set
(
'
name
'
,
'
client.
'
+
package_class
.
attrib
.
get
(
'
name
'
))
package_class
.
set
(
'
filename
'
,
'
client/
'
+
package_class
.
attrib
.
get
(
'
filename
'
))
tree
.
write
(
'
output/coverage/jest/cobertura-coverage.xml
'
)
This diff is collapsed.
Click to expand it.
client/src/App.tsx
+
1
−
1
View file @
89effbe6
...
...
@@ -6,7 +6,7 @@ import logo from './logo.svg'
interface
Message
{
message
:
string
}
//test
const
App
:
React
.
FC
=
()
=>
{
const
[
currentMessage
,
setCurrentMessage
]
=
useState
<
Message
>
()
useEffect
(()
=>
{
...
...
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