diff --git a/.circleci/config.yml b/.circleci/config.yml index ac7e5bb0d1..1242d7cf18 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -73,6 +73,8 @@ jobs: command: | npm run cypress start docker-compose run cypress node ./cypress/cypress.js db-seed + # Make sure the API key is the same so Percy snapshots are consistent + docker-compose -p cypress run postgres psql -U postgres -h postgres -c "update users set api_key = 'secret' where email ='admin@redash.io';" - run: name: Execute Cypress tests command: npm run cypress run-ci diff --git a/cypress/cypress.js b/cypress/cypress.js index 3363b437e1..0dda6e4cff 100644 --- a/cypress/cypress.js +++ b/cypress/cypress.js @@ -36,7 +36,10 @@ function runCypressCI() { if (process.env.PERCY_TOKEN_ENCODED) { process.env.PERCY_TOKEN = atob(`${process.env.PERCY_TOKEN_ENCODED}`); } - execSync('docker-compose run cypress ./node_modules/.bin/percy exec -- ./node_modules/.bin/cypress run --browser chrome', { stdio: 'inherit' }); + execSync( + 'docker-compose run cypress ./node_modules/.bin/percy exec -- ./node_modules/.bin/cypress run --browser chrome', + { stdio: 'inherit' }, + ); } const command = process.argv[2] || 'all';