зеркало из https://github.com/microsoft/Briefcase.git
use service principal secret during build
skip test if credentials are missing
This commit is contained in:
Родитель
08aa8e7036
Коммит
99760447a2
|
@ -8,13 +8,15 @@ steps:
|
|||
|
||||
- script: |
|
||||
cd python
|
||||
python install -e .[extra]
|
||||
pip install -e .[extra]
|
||||
displayName: 'Install Package'
|
||||
|
||||
- script: |
|
||||
cd python
|
||||
pytest --junitxml=junit/test-unitttest.xml
|
||||
displayName: 'Python Unit Tests'
|
||||
env:
|
||||
myserviceprincipal1: $(test_service_principal_secret)
|
||||
|
||||
- task: PublishTestResults@2
|
||||
condition: succeededOrFailed()
|
||||
|
|
|
@ -10,13 +10,18 @@ def test_subdir():
|
|||
os.chdir(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
|
||||
@pytest.mark.skipif(os.environ.get('myserviceprincipal1') is None,
|
||||
reason='Environment variable myserviceprincipal1 must be set to service principals secret')
|
||||
def test_service_principal(test_subdir):
|
||||
|
||||
ws = pyworkspace.Workspace()
|
||||
|
||||
svc1 = ws['myvault1']
|
||||
assert len(svc1.get_secret("workspacetest1")) > 0
|
||||
|
||||
|
||||
@pytest.mark.skipif(os.environ.get('myserviceprincipal1') is None,
|
||||
reason='Environment variable myserviceprincipal1 must be set to service principals secret')
|
||||
def test_service_csv1(test_subdir):
|
||||
ws = pyworkspace.Workspace()
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче