Ignore unit tests when running Playwright Electron (#5996)

* Ignore unit tests when running Playwright Electron

* Skip a couple more Windows tests for now
This commit is contained in:
Jace Browning
2025-03-25 20:59:07 -04:00
committed by GitHub
parent a15565682d
commit 736533a482
3 changed files with 17 additions and 6 deletions

View File

@ -8,6 +8,7 @@ import {
createProject, createProject,
getPlaywrightDownloadDir, getPlaywrightDownloadDir,
orRunWhenFullSuiteEnabled, orRunWhenFullSuiteEnabled,
runningOnWindows,
} from './test-utils' } from './test-utils'
import fsp from 'fs/promises' import fsp from 'fs/promises'
import fs from 'fs' import fs from 'fs'
@ -351,6 +352,9 @@ test(
'open a file in a project works and renders, open another file in the same project with errors, it should clear the scene', 'open a file in a project works and renders, open another file in the same project with errors, it should clear the scene',
{ tag: '@electron' }, { tag: '@electron' },
async ({ context, page }, testInfo) => { async ({ context, page }, testInfo) => {
if (runningOnWindows()) {
test.fixme(orRunWhenFullSuiteEnabled())
}
await context.folderSetupFn(async (dir) => { await context.folderSetupFn(async (dir) => {
const bracketDir = path.join(dir, 'bracket') const bracketDir = path.join(dir, 'bracket')
await fsp.mkdir(bracketDir, { recursive: true }) await fsp.mkdir(bracketDir, { recursive: true })
@ -1328,6 +1332,9 @@ test(
'Can load a file with CRLF line endings', 'Can load a file with CRLF line endings',
{ tag: '@electron' }, { tag: '@electron' },
async ({ context, page }, testInfo) => { async ({ context, page }, testInfo) => {
if (runningOnWindows()) {
test.fixme(orRunWhenFullSuiteEnabled())
}
await context.folderSetupFn(async (dir) => { await context.folderSetupFn(async (dir) => {
const routerTemplateDir = path.join(dir, 'router-template-slate') const routerTemplateDir = path.join(dir, 'router-template-slate')
await fsp.mkdir(routerTemplateDir, { recursive: true }) await fsp.mkdir(routerTemplateDir, { recursive: true })

View File

@ -69,28 +69,31 @@ describe('utility to bypass unreliable tests', () => {
afterAll(() => { afterAll(() => {
process.env = { ...originalEnv } process.env = { ...originalEnv }
}) })
it('always runs them on dedicated branch', () => { it('always runs them on dedicated branch', () => {
process.env.GITHUB_EVENT_NAME = 'push' process.env.GITHUB_EVENT_NAME = 'push'
process.env.GITHUB_REF = 'refs/heads/all-e2e' process.env.GITHUB_REF = 'refs/heads/all-e2e'
process.env.GITHUB_HEAD_REF = '' process.env.GITHUB_HEAD_REF = ''
process.env.GITHUB_BASE_REF = '' process.env.GITHUB_BASE_REF = ''
const condition = orRunWhenFullSuiteEnabled() const shouldSkip = orRunWhenFullSuiteEnabled()
expect(condition).toBe(false) expect(shouldSkip).toBe(false)
}) })
it('skips them on the main branch', () => { it('skips them on the main branch', () => {
process.env.GITHUB_EVENT_NAME = 'push' process.env.GITHUB_EVENT_NAME = 'push'
process.env.GITHUB_REF = 'refs/heads/main' process.env.GITHUB_REF = 'refs/heads/main'
process.env.GITHUB_HEAD_REF = '' process.env.GITHUB_HEAD_REF = ''
process.env.GITHUB_BASE_REF = '' process.env.GITHUB_BASE_REF = ''
const condition = orRunWhenFullSuiteEnabled() const shouldSkip = orRunWhenFullSuiteEnabled()
expect(condition).toBe(true) expect(shouldSkip).toBe(true)
}) })
it('skips them on pull requests', () => { it('skips them on pull requests', () => {
process.env.GITHUB_EVENT_NAME = 'pull_request' process.env.GITHUB_EVENT_NAME = 'pull_request'
process.env.GITHUB_REF = 'refs/pull/5883/merge' process.env.GITHUB_REF = 'refs/pull/5883/merge'
process.env.GITHUB_HEAD_REF = 'my-branch' process.env.GITHUB_HEAD_REF = 'my-branch'
process.env.GITHUB_BASE_REF = 'main' process.env.GITHUB_BASE_REF = 'main'
const condition = orRunWhenFullSuiteEnabled() const shouldSkip = orRunWhenFullSuiteEnabled()
expect(condition).toBe(true) expect(shouldSkip).toBe(true)
}) })
}) })

View File

@ -7,6 +7,7 @@ import { platform } from 'os'
export default defineConfig({ export default defineConfig({
timeout: 120_000, // override the default 30s timeout timeout: 120_000, // override the default 30s timeout
testDir: './e2e/playwright', testDir: './e2e/playwright',
testIgnore: '*.test.ts', // ignore unit tests
/* Run tests in files in parallel */ /* Run tests in files in parallel */
fullyParallel: true, fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */ /* Fail the build on CI if you accidentally left test.only in the source code. */