Skip to content

Commit

Permalink
lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
FedeAlonso committed Jul 31, 2024
1 parent 6a949ea commit 9f3e7be
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 48 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { createOpenShiftProject, deleteOpenShiftProject } from '~/__tests__/cypress/cypress/utils/oc_commands/project';
import {
createOpenShiftProject,
deleteOpenShiftProject,
} from '~/__tests__/cypress/cypress/utils/oc_commands/project';
import { createDataConnection } from '~/__tests__/cypress/cypress/utils/oc_commands/dataConnection';
import { createDSPASecret, createDSPA } from '~/__tests__/cypress/cypress/utils/oc_commands/dspa';
import { replacePlaceholdersInYaml } from '~/__tests__/cypress/cypress/utils/yaml_files';

Check failure on line 7 in frontend/src/__tests__/cypress/cypress/tests/e2e/pipelines/pipelines.cy.ts

View workflow job for this annotation

GitHub Actions / Tests (18.x)

'replacePlaceholdersInYaml' is defined but never used
Expand Down Expand Up @@ -47,12 +50,10 @@ describe('An admin user can import and run a pipeline', { testIsolation: false }
const dspaReplacements = {
DSPA_SECRET_NAME: dspaSecretName,
NAMESPACE: projectName,
AWS_S3_BUCKET: AWS_BUCKETS.BUCKET_2.NAME
AWS_S3_BUCKET: AWS_BUCKETS.BUCKET_2.NAME,
};
createDSPA(dspaReplacements);



// cy.fixture('resources/yaml/data_connection.yml').then((yamlContent) => {
// const modifiedYamlContent = replacePlaceholdersInYaml(
// yamlContent,
Expand Down Expand Up @@ -97,7 +98,6 @@ describe('An admin user can import and run a pipeline', { testIsolation: false }
});

it('An admin User can Import and Run a Pipeline', () => {

// Login as an admin
cy.visitWithLogin('/', ADMIN_USER);

Expand All @@ -108,7 +108,7 @@ describe('An admin user can import and run a pipeline', { testIsolation: false }

// Open the project
projectListPage.findProjectLink(projectName).click();

// Increasing the timeout to ~3mins so the DSPA can be loaded
projectDetails.findImportPipelineButton(180000).click();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ export const applyOpenShiftYaml = (yamlContent: string) => {
}
return result;
});
};
};
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { replacePlaceholdersInYaml } from "../yaml_files";
import { applyOpenShiftYaml } from "./baseCommands";
import { replacePlaceholdersInYaml } from '~/__tests__/cypress/cypress/utils/yaml_files';
import { applyOpenShiftYaml } from './baseCommands';

/**
* Try to create a data connection based on the dataConnectionReplacements config
* @param dataConnectionReplacements Dictionary with the config values
* Dict Structure:
* Dict Structure:
* dataConnectionReplacements = {
* NAMESPACE: <PROJECT NAME>,
* AWS_ACCESS_KEY_ID: <AWS ACCESS KEY ID>,
Expand All @@ -13,16 +13,16 @@ import { applyOpenShiftYaml } from "./baseCommands";
* AWS_S3_ENDPOINT: <AWS ENDPOINT>,
* AWS_SECRET_ACCESS_KEY: <AWS SECRET>,
* }
* @param yamlFilePath
* @param yamlFilePath
*/
export const createDataConnection = (
dataConnectionReplacements: { [key: string]: string },
yamlFilePath: string = 'resources/yaml/data_connection.yml'
) => {
cy.fixture(yamlFilePath).then((yamlContent) => {
const modifiedYamlContent = replacePlaceholdersInYaml(yamlContent, dataConnectionReplacements);
applyOpenShiftYaml(modifiedYamlContent).then((result) => {
return result;
});
dataConnectionReplacements: { [key: string]: string },
yamlFilePath = 'resources/yaml/data_connection.yml',
) => {

Check failure on line 21 in frontend/src/__tests__/cypress/cypress/utils/oc_commands/dataConnection.ts

View workflow job for this annotation

GitHub Actions / Tests (18.x)

Missing return type on function
cy.fixture(yamlFilePath).then((yamlContent) => {
const modifiedYamlContent = replacePlaceholdersInYaml(yamlContent, dataConnectionReplacements);
applyOpenShiftYaml(modifiedYamlContent).then((result) => {
return result;
});
};
});
};
46 changes: 23 additions & 23 deletions frontend/src/__tests__/cypress/cypress/utils/oc_commands/dspa.ts
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
import { replacePlaceholdersInYaml } from "../yaml_files";
import { applyOpenShiftYaml } from "./baseCommands";
import { replacePlaceholdersInYaml } from '~/__tests__/cypress/cypress/utils/yaml_files';
import { applyOpenShiftYaml } from './baseCommands';

/**
* Try to create a DSPA Secret based on the dspaSecretReplacements config
* @param dspaSecretReplacements Dictionary with the config values
* Dict Structure:
* Dict Structure:
* dspaSecretReplacements = {
* DSPA_SECRET_NAME: <DSPA SECRET NAME>,
* NAMESPACE: <PROJECT NAME>,
* AWS_ACCESS_KEY_ID: <AWS ACCESS KEY ID>,
* AWS_SECRET_ACCESS_KEY: <AWS SECRET>,
* }
* @param yamlFilePath
* @param yamlFilePath
*/
export const createDSPASecret = (
dspaSecretReplacements: { [key: string]: string },
yamlFilePath: string = 'resources/yaml/dspa_secret.yml'
) => {
cy.fixture(yamlFilePath).then((yamlContent) => {
const modifiedYamlContent = replacePlaceholdersInYaml(yamlContent, dspaSecretReplacements);
applyOpenShiftYaml(modifiedYamlContent).then((result) => {
return result;
});
dspaSecretReplacements: { [key: string]: string },
yamlFilePath = 'resources/yaml/dspa_secret.yml',
) => {

Check failure on line 19 in frontend/src/__tests__/cypress/cypress/utils/oc_commands/dspa.ts

View workflow job for this annotation

GitHub Actions / Tests (18.x)

Missing return type on function
cy.fixture(yamlFilePath).then((yamlContent) => {
const modifiedYamlContent = replacePlaceholdersInYaml(yamlContent, dspaSecretReplacements);
applyOpenShiftYaml(modifiedYamlContent).then((result) => {
return result;
});
});
};

/**
* Try to create a DSPA based on the dspaReplacements config
* @param dspaReplacements Dictionary with the config values
* Dict Structure:
* Dict Structure:
* dspaSecretReplacements = {
* DSPA_SECRET_NAME: <DSPA SECRET NAME>,
* NAMESPACE: <PROJECT NAME>,
* AWS_S3_BUCKET: <AWS BUCKET NAME>
* }
* @param yamlFilePath
* @param yamlFilePath
*/
export const createDSPA = (
dspaReplacements: { [key: string]: string },
yamlFilePath: string = 'resources/yaml/dspa.yml'
) => {
cy.fixture(yamlFilePath).then((yamlContent) => {
const modifiedYamlContent = replacePlaceholdersInYaml(yamlContent, dspaReplacements);
applyOpenShiftYaml(modifiedYamlContent).then((result) => {
return result;
});
dspaReplacements: { [key: string]: string },
yamlFilePath = 'resources/yaml/dspa.yml',
) => {

Check failure on line 42 in frontend/src/__tests__/cypress/cypress/utils/oc_commands/dspa.ts

View workflow job for this annotation

GitHub Actions / Tests (18.x)

Missing return type on function
cy.fixture(yamlFilePath).then((yamlContent) => {
const modifiedYamlContent = replacePlaceholdersInYaml(yamlContent, dspaReplacements);
applyOpenShiftYaml(modifiedYamlContent).then((result) => {
return result;
});
};
});
};
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ export const createOpenShiftProject = (projectName: string, displayName?: string
const ocCommand = `oc new-project ${projectName} --display-name='${finalDisplayName}'`;
return cy.exec(ocCommand, { failOnNonZeroExit: false }).then((result) => {
if (result.code !== 0) {
cy.log(`ERROR provisioning ${projectName} Project
cy.log(`ERROR provisioning ${projectName} Project
stdout: ${result.stdout}
stderr: ${result.stderr}`);
throw new Error(`Command failed with code ${result.code}`);
}
throw new Error(`Command failed with code ${result.code}`);
}
return result;
});
};

/**
* Delete an Openshift Project given its name
*
Expand All @@ -29,4 +29,3 @@ export const deleteOpenShiftProject = (projectName: string) => {
const ocCommand = `oc delete project ${projectName}`;
return cy.exec(ocCommand, { failOnNonZeroExit: false }).then(() => {});

Check failure on line 30 in frontend/src/__tests__/cypress/cypress/utils/oc_commands/project.ts

View workflow job for this annotation

GitHub Actions / Tests (18.x)

Unexpected empty arrow function
};

0 comments on commit 9f3e7be

Please sign in to comment.