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

Change error when importing v1 pipeline #3650

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class PipelineImportModal extends Modal {
}

findSubmitButton() {
return this.findFooter().findByTestId('import-button');
return this.findFooter().findByTestId('modal-submit-button');
}

findUploadPipelineRadio() {
Expand Down Expand Up @@ -56,7 +56,7 @@ class PipelineImportModal extends Modal {
}

findImportModalError() {
return this.find().findByTestId('import-modal-error');
return this.find().findByTestId('error-message-alert');
}

mockCreatePipelineAndVersion(params: CreatePipelineAndVersionKFData, namespace: string) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class PipelineImportModal extends Modal {
}

findSubmitButton() {
return this.findFooter().findByRole('button', { name: 'Upload', hidden: true });
return cy.findByTestId('modal-submit-button');
}

findVersionNameInput() {
Expand Down Expand Up @@ -51,7 +51,7 @@ class PipelineImportModal extends Modal {
}

findImportModalError() {
return this.find().findByTestId('import-modal-error');
return this.find().findByTestId('error-message-alert');
}

selectPipelineByName(name: string) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import type { PipelineKF, PipelineVersionKF } from '~/concepts/pipelines/kfTypes
import { tablePagination } from '~/__tests__/cypress/cypress/pages/components/Pagination';
import { verifyRelativeURL } from '~/__tests__/cypress/cypress/utils/url';
import { pipelineRunsGlobal } from '~/__tests__/cypress/cypress/pages/pipelines/pipelineRunsGlobal';
import { argoAlert } from '~/__tests__/cypress/cypress/pages/pipelines/argoAlert';

const projectName = 'test-project-name';
const initialMockPipeline = buildMockPipeline({ display_name: 'Test pipeline' });
Expand All @@ -43,6 +44,7 @@ const initialMockPipelineVersion = buildMockPipelineVersion({
const pipelineYamlPath = './cypress/tests/mocked/pipelines/mock-upload-pipeline.yaml';
const argoWorkflowPipeline = './cypress/tests/mocked/pipelines/argo-workflow-pipeline.yaml';
const tooLargePipelineYAMLPath = './cypress/tests/mocked/pipelines/not-a-pipeline-2-megabytes.yaml';
const v1PipelineYamlPath = './cypress/tests/mocked/pipelines/v1-pipeline.yaml';

describe('Pipelines', () => {
it('Empty state', () => {
Expand Down Expand Up @@ -644,6 +646,26 @@ describe('Pipelines', () => {
pipelineImportModal.findImportModalError().contains('Unsupported pipeline version');
});

it('fails to import a v1 pipeline', () => {
initIntercepts({});
pipelinesGlobal.visit(projectName);

// Open the "Import pipeline" modal
pipelinesGlobal.findImportPipelineButton().click();

// Fill out the "Import pipeline" modal and submit
pipelineImportModal.shouldBeOpen();
pipelineImportModal.fillPipelineName('New pipeline');
pipelineImportModal.fillPipelineDescription('New pipeline description');
pipelineImportModal.uploadPipelineYaml(v1PipelineYamlPath);
pipelineImportModal.submit();

pipelineImportModal.findImportModalError().should('exist');
pipelineImportModal.findImportModalError().contains('Pipeline update and recompile required');
argoAlert.findCloudServiceReleaseNotesLink().should('exist');
argoAlert.findSelfManagedReleaseNotesLink().should('exist');
});

it('imports a new pipeline by url', () => {
initIntercepts({});
pipelinesGlobal.visit(projectName);
Expand Down
Loading
Loading