-
Notifications
You must be signed in to change notification settings - Fork 12
/
azure-pipelines-userTests.yml
129 lines (125 loc) · 4.04 KB
/
azure-pipelines-userTests.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
parameters:
- name: POST_RESULT
displayName: Post GitHub comment with results
type: boolean
default: true
- name: DIAGNOSTIC_OUTPUT
displayName: Log diagnostic data
type: boolean
default: false
- name: TOP_REPOS
displayName: Whether to query Github for top TS repos by stars. If false, uses the user test suite.
type: boolean
default: false
- name: REPO_COUNT
displayName: Number of repositories to run on for when TOP_REPOS is set to true.
type: number
default: 100
- name: OLD_TS_REPO_URL
displayName: Old Typscript Repo Url
type: string
default: https://github.com/microsoft/TypeScript.git
- name: OLD_HEAD_REF
displayName: Old head reference
type: string
default: main
- name: DISTINCT_ID
displayName: Distinct ID
type: string
- name: REQUESTING_USER
displayName: User to tag when the results are ready
type: string
- name: SOURCE_ISSUE
displayName: PR ID in github
type: number
- name: STATUS_COMMENT
displayName: Typescript-bot comment ID indicating that the run started
type: number
- name: MACHINE_COUNT
displayName: Machine Count
type: number
default: 16
values:
- 1
- 2
- 4
- 8
- 16
- name: ENTRYPOINT
displayName: TypeScript entrypoint
type: string
default: tsc
values:
- tsc
- tsserver
- name: PRNG_SEED
displayName: Pseudo-random number generator seed
type: string
default: 'n/a'
pr: none
trigger: none
pool:
name: TypeScript-1ES-Large
vmImage: ubuntu-22.04
variables:
Codeql.Enabled: false
skipComponentGovernanceDetection: true
jobs:
- job: ListRepos
steps:
- task: UseNode@1
inputs:
version: '20.x'
displayName: 'Install Node.js'
- script: |
npm ci
npm run build
mkdir artifacts
- script: node dist/listTopRepos TypeScript ${{ parameters.REPO_COUNT }} 0 artifacts/repos.json
condition: eq('${{ parameters.TOP_REPOS }}', 'true')
env:
GITHUB_PAT: $(GITHUB_PAT)
displayName: 'List top TS repos'
- script: node dist/listUserTestRepos ./userTests artifacts/repos.json
condition: ne('${{ parameters.TOP_REPOS }}', 'true')
displayName: 'List user test repos'
- publish: artifacts
artifact: RepoList
- job: DetectNewErrors
dependsOn: ListRepos
timeoutInMinutes: 360
strategy:
parallel: ${{ parameters.MACHINE_COUNT }}
steps:
- download: current
artifact: RepoList
- task: UseNode@1
inputs:
version: '20.x'
displayName: 'Install Node.js'
- script: |
npm ci
npm run build
npm install -g pnpm
mkdir 'RepoResults$(System.JobPositionInPhase)'
node dist/checkUserTestRepos ${{ parameters.ENTRYPOINT }} ${{ parameters.OLD_TS_REPO_URL }} ${{ parameters.OLD_HEAD_REF }} ${{ parameters.SOURCE_ISSUE }} ${{ parameters.TOP_REPOS }} '$(Pipeline.Workspace)/RepoList/repos.json' $(System.TotalJobsInPhase) $(System.JobPositionInPhase) 'RepoResults$(System.JobPositionInPhase)' ${{ parameters.DIAGNOSTIC_OUTPUT }} ${{ parameters.PRNG_SEED }}
displayName: 'Run user tests'
env:
GITHUB_PAT: $(GITHUB_PAT)
- publish: 'RepoResults$(System.JobPositionInPhase)'
artifact: 'RepoResults$(System.JobPositionInPhase)'
- job: ReportNewErrors
dependsOn: DetectNewErrors
steps:
- download: current
- task: UseNode@1
inputs:
version: '20.x'
displayName: 'Install Node.js'
- script: |
npm ci
npm run build
node dist/postGithubComments ${{ parameters.ENTRYPOINT }} ${{ parameters.REQUESTING_USER }} ${{ parameters.SOURCE_ISSUE }} ${{ parameters.STATUS_COMMENT }} ${{ parameters.DISTINCT_ID }} ${{ parameters.TOP_REPOS }} '$(Pipeline.Workspace)' '$(System.TeamFoundationCollectionUri)$(System.TeamProject)/_build/results?buildId=$(Build.BuildId)&view=artifacts&type=publishedArtifacts' ${{ parameters.POST_RESULT }} ${{ parameters.REPO_COUNT }} '$(System.TeamFoundationCollectionUri)$(System.TeamProject)/_apis/build/builds/$(Build.BuildId)/artifacts'
displayName: 'Update PR comment with new errors'
env:
GITHUB_PAT: $(GITHUB_PAT)