Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
binary_c-python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Izzard, Robert Dr (Maths & Physics)
binary_c-python
Commits
7fe6643b
Commit
7fe6643b
authored
3 years ago
by
dh00601
Browse files
Options
Downloads
Plain Diff
Merge branch 'feature/generate_reports'
parents
65302ad1
3663a902
No related branches found
No related tags found
No related merge requests found
Pipeline
#33445
passed
3 years ago
Stage: test
Stage: deploy
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
badges/docstring_coverage.svg
+2
-2
2 additions, 2 deletions
badges/docstring_coverage.svg
badges/test_coverage.svg
+2
-2
2 additions, 2 deletions
badges/test_coverage.svg
generate_reports.sh
+42
-20
42 additions, 20 deletions
generate_reports.sh
with
46 additions
and
24 deletions
badges/docstring_coverage.svg
+
2
−
2
View file @
7fe6643b
...
...
@@ -14,7 +14,7 @@
<g
fill=
"#fff"
text-anchor=
"middle"
font-family=
"Verdana,Geneva,DejaVu Sans,sans-serif"
font-size=
"110"
>
<text
x=
"505"
y=
"150"
fill=
"#010101"
fill-opacity=
".3"
transform=
"scale(.1)"
textLength=
"890"
>
docstr-coverage
</text>
<text
x=
"505"
y=
"140"
transform=
"scale(.1)"
textLength=
"890"
>
docstr-coverage
</text>
<text
x=
"1195"
y=
"150"
fill=
"#010101"
fill-opacity=
".3"
transform=
"scale(.1)"
>
9
8
%
</text>
<text
x=
"1195"
y=
"140"
transform=
"scale(.1)"
>
9
8
%
</text>
<text
x=
"1195"
y=
"150"
fill=
"#010101"
fill-opacity=
".3"
transform=
"scale(.1)"
>
9
6
%
</text>
<text
x=
"1195"
y=
"140"
transform=
"scale(.1)"
>
9
6
%
</text>
</g>
</svg>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
badges/test_coverage.svg
+
2
−
2
View file @
7fe6643b
...
...
@@ -15,7 +15,7 @@
<g
fill=
"#fff"
text-anchor=
"middle"
font-family=
"DejaVu Sans,Verdana,Geneva,sans-serif"
font-size=
"11"
>
<text
x=
"31.5"
y=
"15"
fill=
"#010101"
fill-opacity=
".3"
>
coverage
</text>
<text
x=
"31.5"
y=
"14"
>
coverage
</text>
<text
x=
"80"
y=
"15"
fill=
"#010101"
fill-opacity=
".3"
>
7
3
%
</text>
<text
x=
"80"
y=
"14"
>
7
3
%
</text>
<text
x=
"80"
y=
"15"
fill=
"#010101"
fill-opacity=
".3"
>
7
2
%
</text>
<text
x=
"80"
y=
"14"
>
7
2
%
</text>
</g>
</svg>
This diff is collapsed.
Click to expand it.
generate_reports.sh
100644 → 100755
+
42
−
20
View file @
7fe6643b
#!/bin/bash
ding
={
realpath
binarycpython
}
echo
$ding
## Script to generate the docstring coverage
# docstr-coverage binarycpython --exclude="/home/david/projects/binary_c_root/binarycpython_dev/binary_c-python/binarycpython/tests/*" -v 3 --badge reports/docstring_coverage/docstring_coverage.svg > reports/docstring_coverage/docstring_coverage.txt 2>&1
# # Go down to the dir
# cd reports/test_coverage && coverage run --source=binarycpython ../../binary_c-python/binarycpython/tests/main.py && coverage-badge > test_coverage.svg
# cd ../../
# # Copy docstring coverage
# cp reports/docstring_coverage/docstring_coverage.svg binary_c-python/badges/docstring_coverage.svg
# cp reports/docstring_coverage/docstring_coverage.svg binary_c-python/docs/source/badges/docstring_coverage.svg
# # Copy test coverage
# cp reports/test_coverage/coverage.svg binary_c-python/badges/test_coverage.svg
# cp reports/test_coverage/coverage.svg binary_c-python/docs/source/badges/test_coverage.svg
# Script to generate the docstring coverage
NAME_CURRENT_FILE
=
"
`
realpath
\"
$0
\"
`
"
DIRNAME_CURRENT_FILE
=
$(
dirname
$NAME_CURRENT_FILE
)
TESTS_DIR
=
"
$DIRNAME_CURRENT_FILE
/binarycpython/tests"
REPORTS_DIR
=
"
$DIRNAME_CURRENT_FILE
/reports"
BADGE_DIR
=
"
$DIRNAME_CURRENT_FILE
/badges"
#
# echo "$NAME_CURRENT_FILE"
# echo "$DIRNAME_CURRENT_FILE"
# echo "$TESTS_DIR"
# echo "$REPORTS_DIR"
# echo "$BADGE_DIR"
# Create main reports directory
mkdir
-p
"
$REPORTS_DIR
"
## Docstring coverage:
command
-v
docstr-coverage
>
/dev/null 2>&1
||
{
echo
>
&2
"docstr-coverage is not installed. Aborting."
;
exit
1
;
}
#
echo
"Generating docstring report"
DOCSTRING_COV_DIR
=
"
$REPORTS_DIR
/docstring_coverage"
mkdir
-p
"
$DOCSTRING_COV_DIR
/"
docstr-coverage binarycpython
--exclude
=
"
$TESTS_DIR
/*"
-v
3
--badge
"
$DOCSTRING_COV_DIR
/docstring_coverage.svg"
>
"
$DOCSTRING_COV_DIR
/docstring_coverage.txt"
2>&1
cp
"
$DOCSTRING_COV_DIR
/docstring_coverage.svg"
"
$BADGE_DIR
/docstring_coverage.svg"
echo
"Done"
## test coverage
command
-v
coverage
>
/dev/null 2>&1
||
{
echo
>
&2
"coverage is not installed. Aborting."
;
exit
1
;
}
command
-v
coverage-badge
>
/dev/null 2>&1
||
{
echo
>
&2
"coverage-badge is not installed. Aborting."
;
exit
1
;
}
echo
"Generating test coverage html report"
TEST_COV_DIR
=
"
$REPORTS_DIR
/test_coverage"
mkdir
-p
"
$TEST_COV_DIR
/"
cd
$TEST_COV_DIR
coverage run
--source
=
binarycpython
"
$TESTS_DIR
/main.py"
coverage html
coverage-badge
>
"
$TEST_COV_DIR
/test_coverage.svg"
cd
$DIRNAME_CURRENT_FILE
cp
"
$TEST_COV_DIR
/test_coverage.svg"
"
$BADGE_DIR
/test_coverage.svg"
echo
"Done"
\ No newline at end of file
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