Skip to content

Commit

Permalink
Fix integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
paulovmr committed Sep 16, 2024
1 parent 05e7490 commit eb0e037
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 72 deletions.
2 changes: 1 addition & 1 deletion tests/integration/launcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('Elyra launcher is in use', () => {
);
// One specific runtime pipeline editor extension is available
cy.get(
'.jp-LauncherCard[data-category="Elyra"][title="Kubeflow Pipelines Pipeline Editor"]:visible'
'.jp-LauncherCard[data-category="Elyra"][title="Data Science Pipeline Editor"]:visible'
);
// Script editor extension is available
cy.get(
Expand Down
67 changes: 0 additions & 67 deletions tests/integration/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -557,44 +557,6 @@ describe('Pipeline Editor tests', () => {
cy.readFile('build/cypress-tests/generic-test.py');
});

it('should export Airflow pipeline as python dsl', () => {
// Install runtime configuration
cy.installRuntimeConfig({ type: 'airflow' });

cy.openFile('generic-test.pipeline');

// try to export valid pipeline
cy.findByRole('button', { name: /export pipeline/i }).click();

// check label for generic pipeline
cy.get('.jp-Dialog-header').contains('Export pipeline');

cy.findByLabelText(/runtime platform/i).select('APACHE_AIRFLOW');

cy.findByLabelText(/runtime configuration/i)
.select('airflow_test_runtime')
.should('have.value', 'airflow_test_runtime');

// overwrite existing genric-test.py file
cy.findByLabelText(/export pipeline as/i)
.select('Airflow domain-specific language Python code')
.should('have.value', 'py');

cy.findByLabelText(/replace if file already exists/i)
.check()
.should('be.checked');

// actual export requires minio
cy.contains('Ok').click();

// validate job was executed successfully, this can take a while in ci
cy.findByText(/pipeline export succeeded/i, { timeout: 30000 }).should(
'be.visible'
);

cy.readFile('build/cypress-tests/helloworld.py');
});

it('should export pipeline with custom filename', () => {
// Install runtime configuration
cy.installRuntimeConfig({ type: 'kfp' });
Expand Down Expand Up @@ -707,30 +669,6 @@ describe('Pipeline Editor tests', () => {
cy.findByRole('button', { name: /cancel/i }).click();
});

it('airflow pipeline should display expected export options', () => {
cy.createPipeline({ type: 'airflow', emptyPipeline });
cy.savePipeline();

cy.installRuntimeConfig({ type: 'airflow' });

// Validate all export options are available
cy.findByRole('button', { name: /export pipeline/i }).click();
cy.findByRole('option', { name: /python/i }).should('have.value', 'py');
cy.findByRole('option', { name: /yaml/i }).should('not.exist');

// Dismiss dialog
cy.findByRole('button', { name: /cancel/i }).click();
});

//error dialog tests
it('saving runtime config with missing required fields should error', () => {
cy.createRuntimeConfig({ type: 'invalid' });
cy.get('.jp-Dialog-header').contains('Error making request');

// Dismiss dialog
cy.findByRole('button', { name: /ok/i }).click();
});

it('exporting generic pipeline with invalid runtime config should produce request error', () => {
cy.createPipeline({ emptyPipeline });
cy.savePipeline();
Expand Down Expand Up @@ -790,11 +728,6 @@ describe('Pipeline Editor tests', () => {
cy.get('.toolbar-icon-label').contains(/runtime: kubeflow pipelines/i);
});

it('airflow pipeline toolbar should display expected runtime', () => {
cy.createPipeline({ type: 'airflow' });
cy.get('.toolbar-icon-label').contains(/runtime: apache airflow/i);
});

it('should block unsupported files', () => {
cy.createPipeline({ emptyPipeline });
cy.dragAndDropFileToPipeline('invalid.txt');
Expand Down
8 changes: 4 additions & 4 deletions tests/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ Cypress.Commands.add('createRuntimeConfig', ({ type } = {}): void => {
cy.findByRole('button', { name: /create new runtime/i }).click();

if (type === 'kfp') {
cy.findByRole('menuitem', { name: /kubeflow pipelines/i }).click();
cy.findByRole('menuitem', { name: /data science pipelines/i }).click();
} else {
cy.findByRole('menuitem', { name: /apache airflow/i }).click();
}

cy.findByLabelText(/^display name/i).type(`${type} Test Runtime`);

if (type === 'kfp') {
cy.findByLabelText(/kubeflow .* endpoint\*/i).type(
cy.findByLabelText(/data science .* endpoint\*/i).type(
'https://kubernetes-service.ibm.com/pipeline'
);
} else {
Expand Down Expand Up @@ -117,7 +117,7 @@ Cypress.Commands.add('createExampleComponentCatalog', ({ type } = {}): void => {

if (type === 'kfp') {
cy.findByRole('menuitem', {
name: /new kubeflow pipelines example components catalog/i
name: /new data science pipelines example components catalog/i
}).click();
} else {
cy.findByRole('menuitem', {
Expand All @@ -144,7 +144,7 @@ Cypress.Commands.add(
switch (type) {
case 'kfp':
cy.get(
'.jp-LauncherCard[data-category="Elyra"][title="Kubeflow Pipelines Pipeline Editor"]'
'.jp-LauncherCard[data-category="Elyra"][title="Data Science Pipeline Editor"]'
).click();
break;
case 'airflow':
Expand Down

0 comments on commit eb0e037

Please sign in to comment.