-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathazure-pipelines.yml
92 lines (79 loc) · 2.55 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# Azure Pipeline using the Matrix strategy to run tests on
# 1. A transient Azure VM (for non-Philly tests)
# 2. GCR VM added as part of a named pool (for Philly tests)
trigger:
branches:
include:
- dev
- master
pr:
- dev
- master
strategy:
maxParallel: 2
matrix:
philly:
poolName: "eXperiment Tools"
vmImage: ubuntu-18.04
PHILLY_TESTS: "true"
azure:
poolName: "Azure Pipelines"
vmImage: ubuntu-18.04
PHILLY_TESTS: "false"
pool:
name: $(poolName)
vmImage: $(vmImage)
variables:
venv: $(System.DefaultWorkingDirectory)/venv
PHILLY_TESTS: $(PHILLY_TESTS)
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.6'
addToPath: true
architecture: 'x64'
- script: |
python -m venv $(venv)
export PATH=$(venv)/bin:$PATH
displayName: 'Setup and activate virtual environment'
env:
PYTHON_HOME: ""
VIRTUAL_ENV: $(env)
- script: |
pip install xtlib-internal -i https://pkgs.dev.azure.com/msresearch/e709de22-dd8c-4b66-a84e-688f2a391d01/_packaging/eXperimentTools/pypi/simple/
xtlib-internal config --reset
displayName: 'Install xtlib-internal'
condition: eq(variables['PHILLY_TESTS'], 'true')
- task: PipAuthenticate@1
displayName: 'Pip Authenticate'
inputs:
artifactFeeds: eXperimentTools/xtlib-internal
onlyAddExtraIndex: true
condition: eq(variables['PHILLY_TESTS'], 'true')
- script: |
export ENCODED_BASE_CONFIG=$(ENCODED_BASE_CONFIG)
export AZURE_CLIENT_ID=$(AZURE_CLIENT_ID)
export AZURE_TENANT_ID=$(AZURE_TENANT_ID)
export AZURE_CLIENT_SECRET=$(AZURE_CLIENT_SECRET)
export XT_GLOBAL_CONFIG=tests/xt_config.yaml
pip install -r dev_requirements.txt
pip install -e .
bash run-tests.sh
displayName: 'Run Pytest Suite without Philly Tests'
condition: eq(variables['PHILLY_TESTS'], 'false')
- script: |
export ENCODED_BASE_CONFIG=$(ENCODED_BASE_CONFIG)
export AZURE_CLIENT_ID=$(AZURE_CLIENT_ID)
export AZURE_TENANT_ID=$(AZURE_TENANT_ID)
export AZURE_CLIENT_SECRET=$(AZURE_CLIENT_SECRET)
export XT_GLOBAL_CONFIG=tests/xt_config_philly.yaml
pip install -r dev_requirements.txt
pip install -e .
bash run-tests.sh
displayName: 'Run Pytest Suite with only Philly Tests'
condition: eq(variables['PHILLY_TESTS'], 'true')
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/test-*.xml'
testRunTitle: 'Publish test results for Python $(python.version)'