Skip to content

Commit

Permalink
[chore] Remove visual regression testing for now (#1443)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjoerge committed Aug 13, 2019
1 parent 620e202 commit 614fbf0
Show file tree
Hide file tree
Showing 111 changed files with 3,088 additions and 3,985 deletions.
87 changes: 1 addition & 86 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ const through = require('through2')
const chalk = require('chalk')
const globby = require('globby')
const mergeStream = require('merge-stream')
const backstop = require('backstopjs')
const waitPort = require('wait-port')
const kill = require('kill-port')
const {promisify} = require('util')

const stat = promisify(fs.stat)
Expand Down Expand Up @@ -212,8 +209,7 @@ const STUDIOS = [
{name: 'example-studio', port: '3335'},
{name: 'blog-studio', port: '3336'},
{name: 'ecommerce-studio', port: '3337'},
{name: 'clean-studio', port: '3338'},
{name: 'backstop-test-studio', port: '5000'}
{name: 'clean-studio', port: '3338'}
]

STUDIOS.forEach(studio => {
Expand Down Expand Up @@ -251,84 +247,3 @@ exports.storybook = series(
proc.stderr.pipe(process.stderr)
})
)

exports.backstop = function(cb) {
childProcess.exec('docker -v', err => {
if (err) {
throw new gutil.PluginError({
plugin: 'backstop',
message: gutil.colors.red('Please install Docker on your computer. https://www.docker.com/')
})
}
})

const params = {
host: 'localhost',
port: 5000,
timeout: 100 * 60 * 10
}

parallel(exports['backstop-test-studio'], async () => {
let open
try {
open = await waitPort(params)
} catch (err) {
kill(params.port)
throw new gutil.PluginError({
plugin: 'backstop',
message: `An unknown error occured while waiting for the port: ${err}`
})
}

if (!open) {
kill(params.port)
throw new gutil.PluginError({
plugin: 'backstop',
message: 'The backstop-studio did not start'
})
}

try {
await backstop('test', {
docker: true,
config: './test/backstop/backstop.js'
})

await kill(params.port)
gutil.log(gutil.colors.green('Backstop test success'))
// eslint-disable-next-line no-process-exit
process.exit(0)
} catch (err) {
kill(params.port)
throw new gutil.PluginError({
plugin: 'backstop',
message: 'Tests failed'
})
}

cb()
})()
}

exports['backstop:approve'] = cb => {
backstop('approve', {
docker: true,
config: './test/backstop/backstop.js'
})
}

exports['backstop:reference'] = async cb => {
try {
await backstop('reference', {
docker: true,
config: './test/backstop/backstop.js'
})

gutil.log(gutil.colors.green('References created'))
} catch (err) {
throw new gutil.PluginError({
plugin: 'backstop',
message: 'Making references failed'
})
}
}
1 change: 0 additions & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"ci": false,
"packages": [
"packages/@sanity/*",
"packages/backstop-test-studio",
"packages/blog-studio",
"packages/clean-studio",
"packages/create-sanity",
Expand Down
7 changes: 0 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,13 @@
"ecommerce-studio": "gulp ecommerce-studio",
"test-studio": "gulp test-studio",
"clean-studio": "gulp clean-studio",
"backstop-test-studio": "gulp backstop-test-studio",
"example-studio": "gulp example-studio",
"movies-studio": "gulp movies-studio",
"blog-studio": "gulp blog-studio",
"stylelint": "stylelint \"**/*.css\"",
"stylelint:fix": "stylelint \"**/*.css\" --fix",
"test": "echo 'Run `npm run test-all` to run `npm test` for every package'",
"test-all": "lerna run test --concurrency=2 --stream",
"test:backstop": "gulp backstop",
"test:backstop:approve": "gulp backstop:approve",
"test:backstop:reference": "gulp backstop:reference",
"updated": "lerna updated",
"watch": "gulp watch",
"release-notes": "node scripts/printReleaseNotesTemplate.js",
Expand All @@ -57,7 +53,6 @@
"babel-plugin-css-modules-transform": "^1.6.2",
"babel-plugin-istanbul": "^5.1.4",
"babel-plugin-lodash": "^3.3.4",
"backstopjs": "^4.1.9",
"boxen": "^4.1.0",
"chalk": "^2.3.0",
"deepmerge": "^3.3.0",
Expand Down Expand Up @@ -86,7 +81,6 @@
"gulp-watch": "^5.0.1",
"hard-rejection": "^2.1.0",
"husky": "^2.5.0",
"kill-port": "^1.3.2",
"lerna": "^3.13.1",
"merge-stream": "^2.0.0",
"minimist": "^1.2.0",
Expand All @@ -100,7 +94,6 @@
"stylelint-config-standard": "^18.0.0",
"through2": "^3.0.1",
"typescript": "^3.2.2",
"wait-port": "^0.2.2",
"yarn": "^1.3.2"
},
"husky": {
Expand Down
12 changes: 0 additions & 12 deletions packages/backstop-test-studio/.gitignore

This file was deleted.

8 changes: 0 additions & 8 deletions packages/backstop-test-studio/config/.checksums

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions packages/backstop-test-studio/config/@sanity/storybook.json

This file was deleted.

116 changes: 0 additions & 116 deletions packages/backstop-test-studio/data/norway.js

This file was deleted.

60 changes: 0 additions & 60 deletions packages/backstop-test-studio/package.json

This file was deleted.

Loading

0 comments on commit 614fbf0

Please sign in to comment.