File: tests_primary.yml

package info (click to toggle)
node-playwright 1.38.0%2Bds-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 32,720 kB
  • sloc: javascript: 114,018; sh: 899; java: 372; xml: 247; cs: 118; python: 29; makefile: 13
file content (255 lines) | stat: -rw-r--r-- 7,870 bytes parent folder | download | duplicates (2)
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
name: "tests 1"

on:
  push:
    branches:
      - main
      - release-*
  pull_request:
    paths-ignore:
      - 'browser_patches/**'
      - 'docs/**'
    branches:
      - main
      - release-*

concurrency:
  # For pull requests, cancel all currently-running jobs for this workflow
  # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency
  group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
  cancel-in-progress: true

env:
  # Force terminal colors. @see https://www.npmjs.com/package/colors
  FORCE_COLOR: 1
  FLAKINESS_CONNECTION_STRING: ${{ secrets.FLAKINESS_CONNECTION_STRING }}
  ELECTRON_SKIP_BINARY_DOWNLOAD: 1

jobs:
  test_linux:
    name: ${{ matrix.os }} (${{ matrix.browser }} - Node.js ${{ matrix.node-version }})
    strategy:
      fail-fast: false
      matrix:
        browser: [chromium, firefox, webkit]
        os: [ubuntu-22.04]
        node-version: [16]
        include:
          - os: ubuntu-22.04
            node-version: 18
            browser: chromium
          - os: ubuntu-22.04
            node-version: 20
            browser: chromium
    runs-on: ${{ matrix.os }}
    steps:
    - uses: actions/checkout@v3
    - uses: actions/setup-node@v3
      with:
        node-version: ${{ matrix.node-version }}
    - run: npm ci
      env:
        DEBUG: pw:install
        PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
    - run: npm run build
    - run: npx playwright install --with-deps ${{ matrix.browser }} chromium
    - run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run test -- --project=${{ matrix.browser }}
      env:
        PWTEST_BLOB_REPORT_NAME: "${{ matrix.browser }}-${{ matrix.os }}-node${{ matrix.node-version }}"
    - run: node tests/config/checkCoverage.js ${{ matrix.browser }}
    - run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json
      if: always()
      shell: bash
    - name: Upload blob report
      if: always()
      uses: ./.github/actions/upload-blob-report
      with:
        report_dir: blob-report

  test_linux_chromium_tot:
    name: ${{ matrix.os }} (chromium tip-of-tree)
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-20.04]
    runs-on: ${{ matrix.os }}
    steps:
    - uses: actions/checkout@v3
    - uses: actions/setup-node@v3
      with:
        node-version: 16
    - run: npm ci
      env:
        DEBUG: pw:install
        PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
    - run: npm run build
    - run: npx playwright install --with-deps chromium-tip-of-tree
    - run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run test -- --project=chromium
      env:
        PWTEST_CHANNEL: chromium-tip-of-tree
        PWTEST_BLOB_REPORT_NAME: "${{ matrix.os }}-chromium-tip-of-tree"
    - run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json
      if: always()
      shell: bash
    - name: Upload blob report
      if: always()
      uses: ./.github/actions/upload-blob-report
      with:
        report_dir: blob-report

  test_test_runner:
    name: Test Runner
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, windows-latest, macos-latest]
        node-version: [16]
        shard: [1/2, 2/2]
        include:
          - os: ubuntu-latest
            node-version: 18
            shard: 1/2
          - os: ubuntu-latest
            node-version: 18
            shard: 2/2
          - os: ubuntu-latest
            node-version: 20
            shard: 1/2
          - os: ubuntu-latest
            node-version: 20
            shard: 2/2
    runs-on: ${{ matrix.os }}
    steps:
    - uses: actions/checkout@v3
    - uses: actions/setup-node@v3
      with:
        node-version: ${{matrix.node-version}}
    - run: npm ci
      env:
        DEBUG: pw:install
    - run: npm run build
    - run: npx playwright install --with-deps
    - run: npm run ttest -- --shard ${{ matrix.shard }}
      env:
        PWTEST_BLOB_REPORT_NAME: "${{ matrix.os }}-node${{ matrix.node-version }}"
      if: matrix.os != 'ubuntu-latest'
    - run: xvfb-run npm run ttest --  --shard ${{ matrix.shard }}
      env:
        PWTEST_BLOB_REPORT_NAME: "${{ matrix.os }}-node${{ matrix.node-version }}"
      if: matrix.os == 'ubuntu-latest'
    - run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json
      if: always()
      shell: bash
    - name: Upload blob report
      if: always()
      uses: ./.github/actions/upload-blob-report
      with:
        report_dir: blob-report

  test_web_components:
    name: Web Components
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    - uses: actions/setup-node@v3
      with:
        node-version: 16
    - run: npm ci
      env:
        DEBUG: pw:install
    - run: npm run build

    - run: npx playwright install --with-deps
    - run: npm run test-html-reporter
      env:
        PWTEST_BLOB_REPORT_NAME: "web-components-html-reporter"
    - name: Upload blob report
      if: always()
      uses: ./.github/actions/upload-blob-report
      with:
        report_dir: packages/html-reporter/blob-report

    - run: npm run test-web
      if: always()
      env:
        PWTEST_BLOB_REPORT_NAME: "web-components-web"
    - name: Upload blob report
      if: always()
      uses: ./.github/actions/upload-blob-report
      with:
        report_dir: packages/web/blob-report

  test_vscode_extension:
    name: VSCode Extension
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    - uses: actions/setup-node@v3
      with:
        node-version: 16
    - run: npm ci
      env:
        DEBUG: pw:install
    - run: npm run build
    - run: npx playwright install chromium
    - name: Checkout extension
      run: git clone https://github.com/microsoft/playwright-vscode.git
    - name: Print extension revision
      run: git rev-parse HEAD
      working-directory: ./playwright-vscode
    - name: Remove @playwright/test from extension dependencies
      run: node -e "const p = require('./package.json'); delete p.devDependencies['@playwright/test']; fs.writeFileSync('./package.json', JSON.stringify(p, null, 2));"
      working-directory: ./playwright-vscode
    - name: Build extension
      run: npm install && npm run build
      working-directory: ./playwright-vscode
    - name: Run extension tests
      run: npm run test -- --workers=1
      env:
        PWTEST_BLOB_REPORT_NAME: "vscode-extension"
      working-directory: ./playwright-vscode
    - name: Upload blob report
      if: always()
      uses: ./.github/actions/upload-blob-report
      with:
        report_dir: ./playwright-vscode/blob-report

  test_package_installations:
    name: "Installation Test ${{ matrix.os }}"
    runs-on: ${{ matrix.os  }}
    strategy:
      fail-fast: false
      matrix:
        os:
        - ubuntu-latest
        - macos-latest
        - windows-latest
    timeout-minutes: 30
    steps:
    - uses: actions/checkout@v3
    - uses: actions/setup-node@v3
      with:
        node-version: 16
    - run: npm ci
      env:
        DEBUG: pw:install
    - run: npm run build
    - run: npx playwright install-deps
    - run: npm install -g yarn@1
    - run: npm install -g pnpm@8
    - run: npm run itest
      if: matrix.os != 'ubuntu-latest'
      env:
        PWTEST_BLOB_REPORT_NAME: "package-installations-${{ matrix.os }}"
    - run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run itest
      if: matrix.os == 'ubuntu-latest'
      env:
        PWTEST_BLOB_REPORT_NAME: "package-installations-${{ matrix.os }}"
    - run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json
      if: always()
      shell: bash
    - name: Upload blob report
      if: always()
      uses: ./.github/actions/upload-blob-report
      with:
        report_dir: blob-report