-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathrun-tests.yml
More file actions
54 lines (52 loc) · 2.21 KB
/
run-tests.yml
File metadata and controls
54 lines (52 loc) · 2.21 KB
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
parameters:
- name: full
type: boolean
default: false
- name: test_command
type: string
default: "make test"
- name: smoketest_command
type: string
default: "make smoketest"
steps:
- bash: |
make install-python
workingDirectory: $(Pipeline.Workspace)/s/$(SERVICE_NAME)/$(SERVICE_ARTIFACT_NAME)
displayName: Setup pytests
condition: always()
- ${{ if parameters.full }}:
# In order to run tests in prod you must supply the unique ID of an Apigee app
# that has authorized access to your service proxy.
- bash: |
export PROXY_NAME="$(FULLY_QUALIFIED_SERVICE_NAME)"
export APIGEE_ACCESS_TOKEN="$(secret.AccessToken)"
export APIGEE_APP_ID="MY APP ID"
export STATUS_ENDPOINT_API_KEY="$(STATUS_ENDPOINT_API_KEY)"
export SOURCE_COMMIT_ID="$(Build.SourceVersion)"
${{ parameters.test_command }}
workingDirectory: $(Pipeline.Workspace)/s/$(SERVICE_NAME)/$(SERVICE_ARTIFACT_NAME)
displayName: Run full test suite
- task: PublishTestResults@2
displayName: "Publish test results"
condition: always()
inputs:
testResultsFiles: "$(Pipeline.Workspace)/s/$(SERVICE_NAME)/$(SERVICE_ARTIFACT_NAME)/test-report.xml"
failTaskOnFailedTests: true
- ${{ if not(parameters.full) }}:
# In order to run tests in prod you must supply the unique ID of an Apigee app
# that has authorized access to your service proxy.
- bash: |
export PROXY_NAME="$(FULLY_QUALIFIED_SERVICE_NAME)"
export APIGEE_ACCESS_TOKEN="$(secret.AccessToken)"
export APIGEE_APP_ID="MY APP ID"
export STATUS_ENDPOINT_API_KEY="$(STATUS_ENDPOINT_API_KEY)"
export SOURCE_COMMIT_ID="$(Build.SourceVersion)"
${{ parameters.smoketest_command }}
workingDirectory: $(Pipeline.Workspace)/s/$(SERVICE_NAME)/$(SERVICE_ARTIFACT_NAME)
displayName: Run smoketests
- task: PublishTestResults@2
displayName: "Publish smoketest results"
condition: always()
inputs:
testResultsFiles: "$(Pipeline.Workspace)/s/$(SERVICE_NAME)/$(SERVICE_ARTIFACT_NAME)/smoketest-report.xml"
failTaskOnFailedTests: true