Skip to content

Commit

Permalink
test: disable flaky tests on windows (#4101)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasholzer authored Jan 21, 2022
1 parent 5ba83d8 commit 2c28f21
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
10 changes: 9 additions & 1 deletion tests/command.init.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const { readFile } = require('fs').promises
const process = require('process')

const test = require('ava')
const cleanDeep = require('clean-deep')
Expand All @@ -10,6 +11,13 @@ const { CONFIRM, DOWN, answerWithValue, handleQuestions } = require('./utils/han
const { withMockApi } = require('./utils/mock-api')
const { withSiteBuilder } = require('./utils/site-builder')

// TODO: Flaky tests enable once fixed
/**
* As some of the tests are flaky on windows machines I will skip them for now
* @type {import('ava').TestInterface}
*/
const windowsSkip = process.platform === 'win32' ? test.skip : test

const assertNetlifyToml = async (t, tomlDir, { command, functions, publish }) => {
// assert netlify.toml was created with user inputs
const netlifyToml = toml.parse(await readFile(`${tomlDir}/netlify.toml`, 'utf8'))
Expand Down Expand Up @@ -388,7 +396,7 @@ test('netlify init existing Next.js site with existing plugins', async () => {
})
})

test('netlify init monorepo root and sub directory without netlify.toml', async (t) => {
windowsSkip('netlify init monorepo root and sub directory without netlify.toml', async (t) => {
const initQuestions = [
{
question: 'Create & configure a new site',
Expand Down
11 changes: 10 additions & 1 deletion tests/command.link.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const process = require('process')

const test = require('ava')

const { isFileAsync } = require('../src/lib/fs')
Expand All @@ -6,6 +8,13 @@ const callCli = require('./utils/call-cli')
const { getCLIOptions, withMockApi } = require('./utils/mock-api')
const { withSiteBuilder } = require('./utils/site-builder')

// TODO: Flaky tests enable once fixed
/**
* As some of the tests are flaky on windows machines I will skip them for now
* @type {import('ava').TestInterface}
*/
const windowsSkip = process.platform === 'win32' ? test.skip : test

test('should create gitignore in repository root when is root', async (t) => {
await withSiteBuilder('repo', async (builder) => {
await builder.withGit().buildAsync()
Expand All @@ -18,7 +27,7 @@ test('should create gitignore in repository root when is root', async (t) => {
})
})

test('should create gitignore in repository root when cwd is subdirectory', async (t) => {
windowsSkip('should create gitignore in repository root when cwd is subdirectory', async (t) => {
await withSiteBuilder('monorepo', async (builder) => {
const projectPath = 'projects/project1'
await builder.withGit().withNetlifyToml({ config: {}, pathPrefix: projectPath }).buildAsync()
Expand Down

1 comment on commit 2c28f21

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📊 Benchmark results

Package size: 357 MB

Please sign in to comment.