Skip to content

Commit

Permalink
versatile-data-kit: pre-commit hook for (S)CSS/JS/TS/HTML formatting (#…
Browse files Browse the repository at this point in the history
…1684)

We need a formatting pre-commit hook, to cover the new tech stack added
with the Frontend component.

Adding and configured a pre-commit hook.

Testing done: tested locally; ci/cd

---------

Signed-off-by: ivakoleva <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
2 people authored and yonitoo committed Mar 1, 2023
1 parent 75fb99f commit 1bdda95
Show file tree
Hide file tree
Showing 481 changed files with 49,124 additions and 26,006 deletions.
17 changes: 5 additions & 12 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,15 +139,8 @@ repos:
- --use-current-year
- --license-filepath
- NOTICE.txt
# License header create issues in helm chart yaml files
# https://github.com/helm/helm/issues/4409
# - id: insert-license
# files: \.yml$
# args:
# - --license-filepath
# - NOTICE.txt
# - id: insert-license
# files: \.yaml$
# args:
# - --license-filepath
# - NOTICE.txt
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.7.1
hooks:
- id: prettier
types_or: [scss, css, javascript, ts, html]
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,31 @@

/// <reference types="cypress" />

import { AppPage } from '../../support/pages/app/app.po';
import { AppPage } from "../../support/pages/app/app.po";

describe('App Page', { tags: ['@dataPipelines'] }, () => {
describe("App Page", { tags: ["@dataPipelines"] }, () => {
before(() => {
return AppPage.recordHarIfSupported()
.then(() => cy.clearLocalStorageSnapshot('app'))
.then(() => AppPage.login())
.then(() => cy.saveLocalStorage('app'));
.then(() => cy.clearLocalStorageSnapshot("app"))
.then(() => AppPage.login())
.then(() => cy.saveLocalStorage("app"));
});

after(() => {
AppPage.saveHarIfSupported();
});

beforeEach(() => {
cy.restoreLocalStorage('app');
cy.restoreLocalStorage("app");
});

it('App Page - Main Title Component have text: Data Pipelines', () => {
it("App Page - Main Title Component have text: Data Pipelines", () => {
AppPage.navigateTo();

const page = AppPage.getPage();

page
.waitForInitialPageLoad();
page.waitForInitialPageLoad();

page
.getMainTitle()
.should('have.text', 'Data Pipelines');
page.getMainTitle().should("have.text", "Data Pipelines");
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -4,139 +4,130 @@
*/

/// <reference types="cypress" />
import { DataPipelinesBasePO } from '../../../support/application/data-pipelines-base.po';
import { GettingStartedPage } from '../../../support/pages/app/getting-started/getting-started.po';
import { DataJobsHealthPanelComponentPO } from '../../../support/pages/app/getting-started/data-jobs-health-panel-component.po';
import { DataJobManageDetailsPage } from '../../../support/pages/app/lib/manage/data-job-details.po';
import { DataJobManageExecutionsPage } from '../../../support/pages/app/lib/manage/data-job-executions.po';
import { applyGlobalEnvSettings } from '../../../support/helpers/commands.helpers';

describe('Getting Started Page', { tags: ['@dataPipelines'] }, () => {
import { DataPipelinesBasePO } from "../../../support/application/data-pipelines-base.po";
import { GettingStartedPage } from "../../../support/pages/app/getting-started/getting-started.po";
import { DataJobsHealthPanelComponentPO } from "../../../support/pages/app/getting-started/data-jobs-health-panel-component.po";
import { DataJobManageDetailsPage } from "../../../support/pages/app/lib/manage/data-job-details.po";
import { DataJobManageExecutionsPage } from "../../../support/pages/app/lib/manage/data-job-executions.po";
import { applyGlobalEnvSettings } from "../../../support/helpers/commands.helpers";

describe("Getting Started Page", { tags: ["@dataPipelines"] }, () => {
let testJob;

before(() => {
return DataPipelinesBasePO.recordHarIfSupported()
.then(() => cy.clearLocalStorageSnapshot('getting-started'))
.then(() => DataPipelinesBasePO.login())
.then(() => cy.saveLocalStorage('getting-started'))
.then(() => cy.prepareLongLivedFailingTestJob())
.then(() => cy.createExecutionsLongLivedFailingTestJob())
.then(() => cy.fixture('e2e-cy-dp-failing.job.json'))
.then((failingTestJob) => {
testJob = applyGlobalEnvSettings(failingTestJob);

return cy.wrap({ context: 'getting-started.spec::before()', action: 'continue' });
});
.then(() => cy.clearLocalStorageSnapshot("getting-started"))
.then(() => DataPipelinesBasePO.login())
.then(() => cy.saveLocalStorage("getting-started"))
.then(() => cy.prepareLongLivedFailingTestJob())
.then(() => cy.createExecutionsLongLivedFailingTestJob())
.then(() => cy.fixture("e2e-cy-dp-failing.job.json"))
.then((failingTestJob) => {
testJob = applyGlobalEnvSettings(failingTestJob);

return cy.wrap({
context: "getting-started.spec::before()",
action: "continue",
});
});
});

after(() => {
DataPipelinesBasePO.saveHarIfSupported();
});

beforeEach(() => {
cy.restoreLocalStorage('getting-started');
cy.restoreLocalStorage("getting-started");

DataPipelinesBasePO.initBackendRequestInterceptor();
});

it('Main Title Component have text: Get Started with Data Pipelines', () => {
GettingStartedPage
.navigateTo()
it("Main Title Component have text: Get Started with Data Pipelines", () => {
GettingStartedPage.navigateTo()
.getMainTitle()
.should('have.text', 'Get Started with Data Pipelines');
.should("have.text", "Get Started with Data Pipelines");
});

describe('Data Jobs Health Overview Panel', () => {
it('Verify Widgets rendered correct data and failing jobs navigates correctly', () => {
GettingStartedPage
.navigateTo();
describe("Data Jobs Health Overview Panel", () => {
it("Verify Widgets rendered correct data and failing jobs navigates correctly", () => {
GettingStartedPage.navigateTo();

let dataJobsHealthPanel = DataJobsHealthPanelComponentPO
.getComponent();
dataJobsHealthPanel
.waitForViewToRender();
dataJobsHealthPanel
.getDataJobsHealthPanel()
.scrollIntoView();
let dataJobsHealthPanel =
DataJobsHealthPanelComponentPO.getComponent();
dataJobsHealthPanel.waitForViewToRender();
dataJobsHealthPanel.getDataJobsHealthPanel().scrollIntoView();

dataJobsHealthPanel
.getExecutionsSuccessPercentage()
.should('be.gte', 0)
.should('be.lte', 100);
.should("be.gte", 0)
.should("be.lte", 100);
dataJobsHealthPanel
.getNumberOfFailedExecutions()
.should('be.gte', 2);
dataJobsHealthPanel
.getExecutionsTotal()
.should('be.gte', 2);
.should("be.gte", 2);
dataJobsHealthPanel.getExecutionsTotal().should("be.gte", 2);

dataJobsHealthPanel
.getAllFailingJobs()
.should('have.length.gte', 1);
.should("have.length.gte", 1);

dataJobsHealthPanel
.getAllMostRecentFailingJobsExecutions()
.should('have.length.gte', 1);
.should("have.length.gte", 1);

// navigate to failing job details
dataJobsHealthPanel
.navigateToFailingJobDetails(testJob.job_name);
dataJobsHealthPanel.navigateToFailingJobDetails(testJob.job_name);

const dataJobManageDetailsPage = DataJobManageDetailsPage
.getPage();
const dataJobManageDetailsPage = DataJobManageDetailsPage.getPage();
dataJobManageDetailsPage
.getMainTitle()
.should('contain.text', testJob.job_name);
.should("contain.text", testJob.job_name);
dataJobManageDetailsPage
.getDetailsTab()
.should('be.visible')
.should('have.class', 'active');
.should("be.visible")
.should("have.class", "active");
dataJobManageDetailsPage
.getExecutionsTab()
.should('exist')
.should('not.have.class', 'active');
.should("exist")
.should("not.have.class", "active");
dataJobManageDetailsPage
.showMoreDescription()
.getDescriptionFull()
.should('contain.text', testJob.description);
.should("contain.text", testJob.description);
});

it('Verify most recent failing executions Widget navigates correctly', () => {
GettingStartedPage
.navigateTo();
it("Verify most recent failing executions Widget navigates correctly", () => {
GettingStartedPage.navigateTo();

let dataJobsHealthPanel = DataJobsHealthPanelComponentPO
.getComponent();
dataJobsHealthPanel
.waitForViewToRender();
dataJobsHealthPanel
.getDataJobsHealthPanel()
.scrollIntoView();
let dataJobsHealthPanel =
DataJobsHealthPanelComponentPO.getComponent();
dataJobsHealthPanel.waitForViewToRender();
dataJobsHealthPanel.getDataJobsHealthPanel().scrollIntoView();

dataJobsHealthPanel
.getAllMostRecentFailingJobsExecutions()
.should('have.length.gte', 1);
.should("have.length.gte", 1);

// navigate to most recent failing job executions
dataJobsHealthPanel
.navigateToMostRecentFailingJobExecutions(testJob.job_name);
dataJobsHealthPanel.navigateToMostRecentFailingJobExecutions(
testJob.job_name
);

const dataJobManageExecutionsPage = DataJobManageExecutionsPage
.getPage();
const dataJobManageExecutionsPage =
DataJobManageExecutionsPage.getPage();
dataJobManageExecutionsPage
.getMainTitle()
.should('contain.text', testJob.job_name);
.should("contain.text", testJob.job_name);
dataJobManageExecutionsPage
.getDetailsTab()
.should('be.visible')
.should('not.have.class', 'active');
.should("be.visible")
.should("not.have.class", "active");
dataJobManageExecutionsPage
.getExecutionsTab()
.should('be.visible')
.should('have.class', 'active');
.should("be.visible")
.should("have.class", "active");
dataJobManageExecutionsPage
.getDataGridRows()
.should('have.length.gte', 1);
.should("have.length.gte", 1);
});
});
});
Loading

0 comments on commit 1bdda95

Please sign in to comment.