Skip to content

Commit

Permalink
Remove Chrome Logger and update Cypress and Percy (#4354)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrieldutra authored Nov 14, 2019
1 parent aa06b32 commit 0aebb37
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 68 deletions.
2 changes: 1 addition & 1 deletion .circleci/docker-compose.cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3'
services:
server:
build: ../
command: dev_server
command: server
depends_on:
- postgres
- redis
Expand Down
5 changes: 5 additions & 0 deletions client/app/assets/less/inc/misc.less
Original file line number Diff line number Diff line change
Expand Up @@ -234,4 +234,9 @@
.hide-in-percy, .pace {
visibility: hidden;
}

// hide tooltips in Percy
.ant-tooltip {
display: none !important;
}
}
2 changes: 1 addition & 1 deletion client/app/components/ParameterApplyButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function ParameterApplyButton({ paramCount, onClick }) {
return (
<div className="parameter-apply-button" data-show={!!paramCount} data-test="ParameterApplyButton">
<Badge count={paramCount}>
<Tooltip title={`${KeyboardShortcuts.modKey} + Enter`}>
<Tooltip title={paramCount ? `${KeyboardShortcuts.modKey} + Enter` : null}>
<span>
<Button onClick={onClick}>
<i className={`fa fa-${icon}`} /> Apply Changes
Expand Down
1 change: 1 addition & 0 deletions client/cypress/integration/dashboard/sharing_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ describe('Dashboard Sharing', () => {
createQueryAndAddWidget(this.dashboardId, unsafeQueryData, { position: secondWidgetPos }).then(() => {
cy.visit(this.dashboardUrl);
cy.logout();
cy.title().should('eq', 'Login to Redash'); // Make sure it's logged out
cy.visit(secretAddress);
cy.getByTestId('TableVisualization', { timeout: 10000 }).should('exist');
cy.contains('.alert', 'This query contains potentially unsafe parameters' +
Expand Down
10 changes: 5 additions & 5 deletions client/cypress/integration/query/parameter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ describe('Parameter', () => {
const selectCalendarDate = (date) => {
cy.getByTestId('ParameterName-test-parameter')
.find('input')
.click({ force: true });
.click();

cy.get('.ant-calendar-date-panel')
.contains('.ant-calendar-date', date)
Expand Down Expand Up @@ -337,7 +337,7 @@ describe('Parameter', () => {
cy.getByTestId('ParameterName-test-parameter')
.find('input')
.as('Input')
.click({ force: true });
.click();

cy.get('.ant-calendar-date-panel')
.contains('.ant-calendar-date', '15')
Expand All @@ -357,7 +357,7 @@ describe('Parameter', () => {
cy.getByTestId('ParameterName-test-parameter')
.find('input')
.as('Input')
.click({ force: true });
.click();

cy.get('.ant-calendar-date-panel')
.contains('Now')
Expand Down Expand Up @@ -389,7 +389,7 @@ describe('Parameter', () => {
expectDirtyStateChange(() => {
cy.getByTestId('ParameterName-test-parameter')
.find('input')
.click({ force: true });
.click();

cy.get('.ant-calendar-date-panel')
.contains('Now')
Expand All @@ -403,7 +403,7 @@ describe('Parameter', () => {
cy.getByTestId('ParameterName-test-parameter')
.find('input')
.first()
.click({ force: true });
.click();

cy.get('.ant-calendar-date-panel')
.contains('.ant-calendar-date', startDate)
Expand Down
2 changes: 1 addition & 1 deletion client/cypress/integration/visualizations/pivot_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ describe('Pivot', () => {
.get('.ace_text-input')
.first()
.focus()
.type(" UNION ALL\nSELECT 'c' AS stage1, 'c5' AS stage2, 55 AS value");
.type(" UNION ALL {enter}SELECT 'c' AS stage1, 'c5' AS stage2, 55 AS value");
cy.getByTestId('SaveButton').click();
cy.getByTestId('ExecuteButton').click();

Expand Down
6 changes: 5 additions & 1 deletion client/cypress/plugins/index.js
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
module.exports = () => {};
const percyHealthCheck = require('@percy/cypress/task'); // eslint-disable-line import/no-extraneous-dependencies, import/no-unresolved

module.exports = (on) => {
on('task', percyHealthCheck);
};
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "The frontend part of Redash.",
"main": "index.js",
"scripts": {
"start": "node --max-http-header-size=16385 ./node_modules/webpack-dev-server/bin/webpack-dev-server.js",
"start": "webpack-dev-server",
"bundle": "bin/bundle-extensions",
"clean": "rm -rf ./client/dist/",
"build": "npm run clean && NODE_ENV=production node --max-old-space-size=4096 node_modules/.bin/webpack",
Expand All @@ -16,7 +16,7 @@
"lint:ci": "npm run lint -- --format junit --output-file /tmp/test-results/eslint/results.xml",
"test": "TZ=Africa/Khartoum jest",
"test:watch": "jest --watch",
"cypress:install": "npm install --no-save cypress@3.4.1 @percy/cypress@^0.2.3 atob@2.1.2",
"cypress:install": "npm install --no-save cypress@~3.6.1 @percy/cypress@^2.2.0 atob@2.1.2",
"cypress": "node client/cypress/cypress.js"
},
"repository": {
Expand Down
2 changes: 0 additions & 2 deletions redash/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ def __init__(self, *args, **kwargs):

def create_app():
from . import authentication, extensions, handlers, limiter, mail, migrate, security
from .handlers import chrome_logger
from .handlers.webpack import configure_webpack
from .metrics import request as request_metrics
from .models import db, users
Expand All @@ -44,7 +43,6 @@ def create_app():
handlers.init_app(app)
configure_webpack(app)
extensions.init_app(app)
chrome_logger.init_app(app)
users.init_app(app)

return app
54 changes: 0 additions & 54 deletions redash/handlers/chrome_logger.py

This file was deleted.

1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ simplejson==3.16.0
ua-parser==0.8.0
user-agents==2.0
maxminddb-geolite2==2018.703
chromelogger==0.4.3
pypd==1.1.0
disposable-email-domains>=0.0.52
gevent==1.4.0
Expand Down

0 comments on commit 0aebb37

Please sign in to comment.