Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Chrome Logger and update Cypress and Percy #4354

Merged
merged 13 commits into from
Nov 14, 2019
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
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}>
Copy link
Member Author

@gabrieldutra gabrieldutra Nov 13, 2019

Choose a reason for hiding this comment

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

The Tooltip was still up in front of some parameter inputs after clicking in "Apply All", blocking tests to continue

<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
arikfr marked this conversation as resolved.
Show resolved Hide resolved

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",
arikfr marked this conversation as resolved.
Show resolved Hide resolved
"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",
gabrieldutra marked this conversation as resolved.
Show resolved Hide resolved
"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