Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Commit

Permalink
Merge pull request #135 from microsoft/bezeran-unit-test
Browse files Browse the repository at this point in the history
create unit-tests.yml
  • Loading branch information
saidbleik authored Jun 26, 2019
2 parents 7e7f397 + 3f84802 commit 5a529d8
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

This project uses unit, smoke and integration tests with Python files and notebooks. For more information, see a [quick introduction to unit, smoke and integration tests](https://miguelgfierro.com/blog/2018/a-beginners-guide-to-python-testing/). To manually execute the unit tests in the different environments, first **make sure you are in the correct environment as described in the [SETUP.md](/SETUP.md)**.

Tests are automatically run as part of a DevOps pipeline. The pipelines are defined in .yml files in tests/ci with filenames that align with pipeline names.

## Test execution

Click on the following menus to see more details on how to execute the unit, smoke and integration tests:
Expand Down
46 changes: 46 additions & 0 deletions tests/ci/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@

# Pull request against these branches will trigger this build
pr:
- master
- staging

#Any commit to this branch will trigger the build.
trigger:
- staging
- master

pool:
vmImage: 'ubuntu-16.04'

steps:

- bash: |
echo "##vso[task.prependpath]/usr/share/miniconda/bin"
displayName: Add Conda to PATH

- bash: |
conda remove -q -n nlp --all -y
python tools/generate_conda_file.py --gpu
conda env create -n nlp_gpu -f nlp_gpu.yaml
conda env list
source activate nlp_gpu
displayName: 'Creating Conda Environment with dependencies'

- bash: |
source activate nlp_gpu
python -m ipykernel install --user --name nlp_gpu --display-name "nlp_gpu"
# Commenting out pytest since it contains bunch of tests from other project which are not applicable.
# But keeping the line here to show how to run it once tests relevant to this project are added
# pytest --junitxml=junit/test-unitttest.xml #not running any tests for now
displayName: 'Run Unit tests'

- task: PublishTestResults@2
inputs:
testResultsFiles: '**/test-unitttest.xml'
testRunTitle: 'Test results for PyTest'

- task: ComponentGovernanceComponentDetection@0
inputs:
scanType: 'Register'
verbosity: 'Verbose'
alertWarningLevel: 'High'

0 comments on commit 5a529d8

Please sign in to comment.