Skip to content

Commit

Permalink
(CI) more robust testing
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthijsBurgh committed Oct 31, 2023
1 parent 6176aaf commit fe64d97
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 20 deletions.
4 changes: 2 additions & 2 deletions __tests__/build.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const isWin = process.platform === 'win32'
jest.setTimeout(isWin ? 60000 : 30000)
const { isCI } = require('ci-info')
jest.setTimeout(isCI ? 60000 : 30000)

const runTests = require('./build.helper.js').runTests

Expand Down
4 changes: 2 additions & 2 deletions __tests__/playwright/build.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { test } = require('@playwright/test')
const isWin = process.platform === 'win32'
const { isCI } = require('ci-info')
test.setTimeout(30000)
test.slow(isWin)
test.slow(isCI)

const runTests = require('./build.helper.js').runTests

Expand Down
4 changes: 2 additions & 2 deletions __tests__/playwright/buildTS.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { test } = require('@playwright/test')
const isWin = process.platform === 'win32'
const { isCI } = require('ci-info')
test.setTimeout(30000)
test.slow(isWin)
test.slow(isCI)

const runTests = require('./build.helper.js').runTests

Expand Down
4 changes: 2 additions & 2 deletions __tests__/playwright/serve.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { test } = require('@playwright/test')
const isWin = process.platform === 'win32'
const { isCI } = require('ci-info')
test.setTimeout(30000)
test.slow(isWin)
test.slow(isCI)

const runTests = require('./serve.helper.js').runTests

Expand Down
4 changes: 2 additions & 2 deletions __tests__/playwright/serveTS.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { test } = require('@playwright/test')
const isWin = process.platform === 'win32'
const { isCI } = require('ci-info')
test.setTimeout(30000)
test.slow(isWin)
test.slow(isCI)

const runTests = require('./serve.helper.js').runTests

Expand Down
4 changes: 2 additions & 2 deletions __tests__/playwright/testWithPlaywright.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { test } from '@playwright/test'
const isWin = process.platform === 'win32'
const { isCI } = require('ci-info')
test.setTimeout(20000)
test.slow(isWin)
test.slow(isCI)

const runTestWithPlaywright = require('./testWithPlaywright.helper.js')

Expand Down
4 changes: 2 additions & 2 deletions __tests__/serve.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const isWin = process.platform === 'win32'
jest.setTimeout(isWin ? 60000 : 30000)
const { isCI } = require('ci-info')
jest.setTimeout(isCI ? 60000 : 30000)

const runTests = require('./serve.helper.js').runTests
test('electron:serve', async () => {
Expand Down
4 changes: 2 additions & 2 deletions __tests__/serveTS.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const isWin = process.platform === 'win32'
jest.setTimeout(isWin ? 60000 : 30000)
const { isCI } = require('ci-info')
jest.setTimeout(isCI ? 60000 : 30000)

const runTests = require('./serve.helper.js').runTests
test('electron:serve-ts', async () => {
Expand Down
4 changes: 2 additions & 2 deletions __tests__/testWithPlaywright.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const isWin = process.platform === 'win32'
jest.setTimeout(isWin ? 30000 : 15000)
const { isCI } = require('ci-info')
jest.setTimeout(isCI ? 30000 : 15000)

const createPlaywrightProject = require('./testWithPlaywright.helper.js')

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"@vue/cli-test-utils": "^5.0.5",
"@vue/eslint-config-typescript": "^12.0.0",
"@vuepress/plugin-google-analytics": "^1.8.0",
"ci-info": "^4.0.0",
"electron": "^27.0.0",
"electron-devtools-installer": "^3.1.0",
"electron-playwright-helpers": "^1.5.5",
Expand Down
6 changes: 4 additions & 2 deletions playwright.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { defineConfig } from '@playwright/test'
import { isCI, GITHUB_ACTIONS } from 'ci-info'

export default defineConfig({
maxFailures: 2,
reporter: process.env.CI ? 'github' : 'list',
reporter: isCI ? (GITHUB_ACTIONS ? 'github' : 'dot') : 'list',
testDir: './__tests__/playwright/',
testMatch: ['**/*.spec.js']
testMatch: ['**/*.spec.js'],
workers: isCI ? 1 : undefined
})
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5039,6 +5039,11 @@ ci-info@^3.2.0:
resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.3.0.tgz#b4ed1fb6818dea4803a55c623041f9165d2066b2"
integrity sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw==

ci-info@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-4.0.0.tgz#65466f8b280fc019b9f50a5388115d17a63a44f2"
integrity sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==

cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3:
version "1.0.4"
resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de"
Expand Down

0 comments on commit fe64d97

Please sign in to comment.