Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
superbenchmark
Commits
d32b96eb
Unverified
Commit
d32b96eb
authored
Feb 04, 2021
by
Yifan Xiong
Committed by
GitHub
Feb 04, 2021
Browse files
Setup: Add Test - Add Codecov (#9)
Add code coverage configuration.
parent
b1a42c38
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
38 additions
and
6 deletions
+38
-6
.editorconfig
.editorconfig
+1
-1
README.md
README.md
+2
-1
azure-pipelines.yml
azure-pipelines.yml
+11
-3
codecov.yml
codecov.yml
+12
-0
setup.py
setup.py
+2
-1
test.dockerfile
test.dockerfile
+2
-0
tests/test_example.py
tests/test_example.py
+8
-0
No files found.
.editorconfig
View file @
d32b96eb
...
...
@@ -11,7 +11,7 @@ insert_final_newline = true
[*.py]
max_line_length = 120
[*.yaml]
[*.
{yml,
yaml
}
]
indent_size = 2
[*.json]
...
...
README.md
View file @
d32b96eb
...
...
@@ -2,6 +2,7 @@
[

](https://dev.azure.com/msrasrg/SuperBenchmark/_build?definitionId=77)
[

](https://github.com/microsoft/superbenchmark/actions?query=workflow%3ALint)
[

](https://codecov.io/gh/microsoft/superbenchmark/branch/dev)
SuperBench is a benchmarking and diagnosis tool for AI infrastructure,
...
...
azure-pipelines.yml
View file @
d32b96eb
...
...
@@ -7,13 +7,14 @@
# https://aka.ms/yaml
trigger
:
-
master
-
dev
-
master
-
dev
resources
:
-
repo
:
self
-
repo
:
self
variables
:
imageName
:
test
tag
:
'
$(Build.BuildId)'
steps
:
...
...
@@ -22,5 +23,12 @@ steps:
inputs
:
command
:
build
dockerfile
:
'
$(Build.SourcesDirectory)/test.dockerfile'
repository
:
$(imageName)
tags
:
|
$(tag)
-
script
:
|
ci_env=`bash <(curl -s https://codecov.io/env)`
docker run $ci_env --entrypoint /bin/bash $(imageName):$(tag) -c 'bash <(curl -s https://codecov.io/bash)'
displayName
:
Report coverage results
env
:
CODECOV_TOKEN
:
$(codecovToken)
codecov.yml
0 → 100644
View file @
d32b96eb
codecov
:
require_ci_to_pass
:
yes
coverage
:
status
:
project
:
default
:
target
:
80%
threshold
:
1%
branches
:
-
main
-
dev
setup.py
View file @
d32b96eb
...
...
@@ -99,7 +99,7 @@ class Tester(Command):
def
run
(
self
):
"""Run pytest."""
errno
=
os
.
system
(
'python3 -m pytest -v'
)
errno
=
os
.
system
(
'python3 -m pytest -v
--cov=superbench --cov-report=xml --cov-report=term-missing tests/
'
)
sys
.
exit
(
0
if
errno
==
0
else
1
)
...
...
@@ -143,6 +143,7 @@ setup(
'flake8-docstrings>=1.5.0'
,
'pydocstyle>=5.1.1'
,
'pytest>=6.2.2'
,
'pytest-cov>=2.11.1'
,
],
},
package_data
=
{},
...
...
test.dockerfile
View file @
d32b96eb
...
...
@@ -5,6 +5,8 @@ FROM ubuntu:18.04
# Install the python3.7 and pip
RUN
apt-get update
&&
apt-get
install
-y
\
git
\
curl
\
python3.7-dev
\
python3-pip
...
...
tests/test_example.py
View file @
d32b96eb
...
...
@@ -6,6 +6,8 @@
Get it from https://docs.pytest.org/en/stable/.
"""
import
superbench
def
inc
(
x
):
"""Increase an integer.
...
...
@@ -22,3 +24,9 @@ def inc(x):
def
test_answer
():
"""Test inc function."""
assert
inc
(
3
)
==
4
def
test_superbench
():
"""Test SuperBench."""
assert
(
superbench
.
__version__
==
'0.0.0'
)
assert
(
superbench
.
__author__
==
'Microsoft'
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment