This commit is contained in:
Jianjie Liu (MAIDAP) 2021-01-25 16:13:16 -05:00
Родитель 5b87f4eddb
Коммит a9620f5152
5 изменённых файлов: 46 добавлений и 30 удалений

Просмотреть файл

@ -35,31 +35,20 @@ steps:
displayName: 'Use Python $(python.version)'
- bash: |
python -m venv .venv
displayName: 'Create virtual environment'
- bash: |
if [[ '$(Agent.OS)' == Windows* ]]
then
source .venv/Scripts/activate
else
source .venv/bin/activate
fi
pip install --upgrade pip
pip install setuptools wheel
pip install -r requirements.txt
pip install pytest==5.3.5 pytest-cov==2.8.1
python -m pip install --upgrade pip
python -m pip install setuptools wheel
python -m pip install -r requirements.txt
python -m pip install -r requirements-dev.txt
workingDirectory: $(Build.SourcesDirectory)
displayName: 'Install dependencies'
- bash: |
if [[ '$(Agent.OS)' == Windows* ]]
then
source .venv/Scripts/activate
else
source .venv/bin/activate
fi
python -m pytest tests --cov=genalog --doctest-modules --junitxml=junit/test-results.xml --cov-report=xml --cov-report=html
python -m flake8
workingDirectory: $(Build.SourcesDirectory)
displayName: 'Run Linter (flake8)'
- bash: |
python -m pytest tests
env:
BLOB_KEY : $(BLOB_KEY)
SEARCH_SERVICE_KEY: $(SEARCH_SERVICE_KEY)
@ -86,12 +75,6 @@ steps:
displayName: 'Publish test coverage'
- bash: |
if [[ '$(Agent.OS)' == Windows* ]]
then
source .venv/Scripts/activate
else
source .venv/bin/activate
fi
python setup.py bdist_wheel --build-number $(Build.BuildNumber) --dist-dir dist
workingDirectory: $(Build.SourcesDirectory)
displayName: 'Building wheel package'

Просмотреть файл

@ -1,2 +0,0 @@
[pytest]
junit_family=xunit1

3
requirements-dev.txt Normal file
Просмотреть файл

@ -0,0 +1,3 @@
pytest
pytest-cov
flake8

Просмотреть файл

@ -13,7 +13,7 @@ with open("README.md", "r", encoding="utf8") as fh:
setuptools.setup(
name="genalog",
install_requires=requirements,
install_requires=requirements,
version=BUILD_VERSION,
author="Team Enki",
author_email="ta_nerds@microsoft.com",

32
tox.ini Normal file
Просмотреть файл

@ -0,0 +1,32 @@
; [tox]
; envlist = flake8, py36 # add other python versions if necessary
; [testenv]
; # Reading additional dependencies to run the test
; # https://tox.readthedocs.io/en/latest/example/basic.html#depending-on-requirements-txt-or-defining-constraints
; deps = -rdev-requirements.txt
; commands =
; pytest
; [testenv:flake8]
; deps = flake8
; skip_install = True
; commands = flake8 .
; # Configurations for running pytest
[pytest]
junit_family=xunit2
testpaths =
tests
addopts =
-rsx --cov=genalog --cov-report=html --cov-report=term-missing --cov-report=xml --junitxml=junit/test-results.xml
[flake8]
max-line-length = 140
exclude =
build, dist
.env*,.venv* # local virtual environments
.tox
; [mypy]
; ignore_missing_imports = True