Visual diff tests seed-stabilized by default (#12965)

* Seed-stabilization by default

* Hide right-column of topology viz route

* Remove seedless run from thee test:* suite

* Related evals paths render too late

* Vis:Hidden another topo viz unstable item
This commit is contained in:
Phil Renaud
2022-05-12 16:09:19 -04:00
committed by GitHub
parent f0031cf163
commit 11472408e1
4 changed files with 23 additions and 3 deletions

View File

@@ -2,6 +2,11 @@ version: 1
snapshot:
# Hide high-variability data from Percy snapshots; helps make sure that randomized data doesn't cause a visual diff.
percy-css: |
table td {
.topo-viz {
display: none;
}
.related-evaluations path,
.related-evaluations circle
.dashboard-metric {
visibility: hidden;
}

View File

@@ -6,6 +6,12 @@ if (process.env.USE_MIRAGE) {
USE_MIRAGE = process.env.USE_MIRAGE == 'true';
}
let USE_PERCY = true;
if (process.env.USE_PERCY) {
USE_PERCY = process.env.USE_PERCY == 'true';
}
module.exports = function (environment) {
let ENV = {
modulePrefix: 'nomad-ui',
@@ -31,6 +37,10 @@ module.exports = function (environment) {
mirageWithRegions: true,
showStorybookLink: process.env.STORYBOOK_LINK === 'true',
},
percy: {
enabled: USE_PERCY,
},
};
if (environment === 'development') {

View File

@@ -3,7 +3,11 @@ import config from 'nomad-ui/config/environment';
const searchIncludesSeed = window.location.search.includes('faker-seed');
if (config.environment !== 'test' || searchIncludesSeed) {
if (
config.environment !== 'test' ||
config.percy.enabled ||
searchIncludesSeed
) {
if (searchIncludesSeed) {
const params = new URLSearchParams(window.location.search);
const seed = parseInt(params.get('faker-seed'));

View File

@@ -22,7 +22,8 @@
"test": "npm-run-all lint test:*",
"test:ember": "percy exec -- ember test",
"local:qunitdom": "ember test --server --query=dockcontainer",
"local:exam": "ember exam --server --load-balance --parallel=4"
"local:exam": "ember exam --server --load-balance --parallel=4",
"seedless-test": "USE_PERCY=false ember test"
},
"husky": {
"hooks": {