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

Bug 1803257: Test pipeline v2 #4147

Merged

Conversation

sanketpathak
Copy link
Contributor

No description provided.

@openshift-ci-robot openshift-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. component/dev-console Related to dev-console labels Feb 2, 2020
@sanketpathak sanketpathak force-pushed the test-pipeline-v2 branch 2 times, most recently from 7f2c2f0 to d62796c Compare February 3, 2020 22:09
@ldimaggi
Copy link
Contributor

ldimaggi commented Feb 4, 2020

npx eslint ./packages/dev-console/integration-tests/tests/*

/home/ldimaggi/local/redhat_git/go_path/src/github.com/openshift/console/frontend/packages/dev-console/integration-tests/tests/pipeline.scenario.ts
   30:3   error  'pipelineRunName' is defined but never used                                                                                                                                                                                                   @typescript-eslint/no-unused-vars
  136:5   error  Unexpected var, use let or const instead                                                                                                                                                                                                      no-var
  136:18  error  Don't use 'String' as a type. Use string instead                                                                                                                                                                                              @typescript-eslint/ban-types
  145:12  error  Replace `pipelineTableBody.element(by.css('[data-test-id="sample-app-pipeline"]')).isPresent()).toBe(⏎······true,⏎····` with `⏎······pipelineTableBody.element(by.css('[data-test-id="sample-app-pipeline"]')).isPresent(),⏎····).toBe(true`  prettier/prettier
  151:24  error  Replace `until.visibilityOf(pipelineTableBody.element(by.css('[data-test-id="sample-app-pipeline"]')))` with `⏎······until.visibilityOf(pipelineTableBody.element(by.css('[data-test-id="sample-app-pipeline"]'))),⏎····`                     prettier/prettier
  153:67  error  Insert `⏎····`                                                                                                                                                                                                                                prettier/prettier
  155:24  error  Replace `until.visibilityOf(element(by.cssContainingText('h2',·'Pipeline·Run·Overview')))` with `⏎······until.visibilityOf(element(by.cssContainingText('h2',·'Pipeline·Run·Overview'))),⏎····`                                               prettier/prettier
  156:64  error  Insert `·`                                                                                                                                                                                                                                    prettier/prettier
  164:38  error  Unexpected string concatenation                                                                                                                                                                                                               prefer-template
  164:55  error  Replace `+runName+` with `·+·runName·+·`                                                                                                                                                                                                      prettier/prettier
  166:17  error  Delete `·`                                                                                                                                                                                                                                    prettier/prettier
  174:65  error  Replace `5000);` with `·5000);⏎····`                                                                                                                                                                                                          prettier/prettier
  177:83  error  Insert `·`                                                                                                                                                                                                                                    prettier/prettier
  185:1   error  Delete `··`                                                                                                                                                                                                                                   prettier/prettier
  188:67  error  Replace `.getText().then(function·` with `⏎······.getText()⏎······.then(function`                                                                                                                                                             prettier/prettier
  189:7   error  Insert `··`                                                                                                                                                                                                                                   prettier/prettier
  190:7   error  Insert `··`                                                                                                                                                                                                                                   prettier/prettier
  190:7   error  Unexpected var, use let or const instead                                                                                                                                                                                                      no-var
  191:1   error  Insert `··`                                                                                                                                                                                                                                   prettier/prettier
  192:7   error  Insert `··`                                                                                                                                                                                                                                   prettier/prettier
  193:5   error  Replace `})` with `··});`                                                                                                                                                                                                                     prettier/prettier
  194:5   error  Insert `;`                                                                                                                                                                                                                                    prettier/prettier

✖ 22 problems (22 errors, 0 warnings)
  21 errors and 0 warnings potentially fixable with the `--fix` option.

@ldimaggi
Copy link
Contributor

ldimaggi commented Feb 4, 2020

npx eslint ./packages/dev-console/integration-tests/views/*

/home/ldimaggi/local/redhat_git/go_path/src/github.com/openshift/console/frontend/packages/dev-console/integration-tests/views/pipeline.view.ts
  19:61  error  Replace `by.css('[data-test-id="kebab-button"]')` with `⏎··by.css('[data-test-id="kebab-button"]'),⏎`                                                                        prettier/prettier
  21:38  error  Replace `by.cssContainingText('button.pf-c-dropdown__menu-item',·'Start')` with `⏎··by.cssContainingText('button.pf-c-dropdown__menu-item',·'Start'),⏎`                      prettier/prettier
  22:39  error  Replace `by.cssContainingText('button.pf-c-dropdown__menu-item',·'Delete·Pipeline')` with `⏎··by.cssContainingText('button.pf-c-dropdown__menu-item',·'Delete·Pipeline'),⏎`  prettier/prettier
  23:36  error  Replace `by.cssContainingText('li.co-m-horizontal-nav__menu-item',·'Pipeline·Runs')` with `⏎··by.cssContainingText('li.co-m-horizontal-nav__menu-item',·'Pipeline·Runs'),⏎`  prettier/prettier
  25:93  error  Replace `by.cssContainingText('dd',·'sample-app-pipeline')` with `⏎··by.cssContainingText('dd',·'sample-app-pipeline'),⏎`                                                    prettier/prettier
  26:39  error  Delete `·`                                                                                                                                                                   prettier/prettier
  27:44  error  Unexpected string concatenation                                                                                                                                              prefer-template
  27:61  error  Replace `+name+` with `·+·name·+·`                                                                                                                                           prettier/prettier
  29:2   error  Insert `;`                                                                                                                                                                   prettier/prettier
  33:40  error  Replace `by.cssContainingText('li.co-m-horizontal-nav__menu-item',·'Logs')` with `⏎··by.cssContainingText('li.co-m-horizontal-nav__menu-item',·'Logs'),⏎`                    prettier/prettier
  35:51  error  Delete `·`                                                                                                                                                                   prettier/prettier
  43:50  error  Delete `·`                                                                                                                                                                   prettier/prettier

/home/ldimaggi/local/redhat_git/go_path/src/github.com/openshift/console/frontend/packages/dev-console/integration-tests/views/sample-app-pipeline.yaml
  7:11  error  Parsing error: Unexpected token :

/home/ldimaggi/local/redhat_git/go_path/src/github.com/openshift/console/frontend/packages/dev-console/integration-tests/views/simple-pipeline-demo.yaml
  7:11  error  Parsing error: Unexpected token :

✖ 14 problems (14 errors, 0 warnings)
  12 errors and 0 warnings potentially fixable with the `--fix` option.

@sanketpathak
Copy link
Contributor Author

/test analyze

@@ -120,4 +133,70 @@ describe('Pipeline', async () => {
true,
);
});
it('start pipeline scenario', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add a description of the test that this function performs. Also - please add comments to the code as it is not always possible to understand the action that the "user" is performing in the UI .

);
await browser.wait(until.visibilityOf(pipelineTable));
expect(
pipelineTableBody.element(by.css('[data-test-id="sample-app-pipeline"]')).isPresent(),
Copy link
Contributor

Choose a reason for hiding this comment

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

The definition of the UI element being accessed should be in the test's corresponding view file and not here in the test code.

await pipelineFilter.click();
await pipelineFilter.sendKeys('sample-app-pipeline');
await browser.wait(
until.visibilityOf(pipelineTableBody.element(by.css('[data-test-id="sample-app-pipeline"]'))),
Copy link
Contributor

Choose a reason for hiding this comment

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

The definition of the UI element being accessed should be in the test's corresponding view file and not here in the test code.

browser.sleep(5000);
await pipelineStart.click();
await browser.wait(
until.visibilityOf(element(by.cssContainingText('h2', 'Pipeline Run Overview'))),
Copy link
Contributor

Choose a reason for hiding this comment

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

The definition of the UI element being accessed should be in the test's corresponding view file and not here in the test code.

});
await pipelinecheckStatus();
await browser.wait(until.visibilityOf(pipelineTableBody));
await element(by.css('[data-test-id="sample-app-pipeline"]')).click();
Copy link
Contributor

Choose a reason for hiding this comment

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

The definition of the UI element being accessed should be in the test's corresponding view file and not here in the test code.

await element(by.css('[data-test-id="sample-app-pipeline"]')).click();
await browser.wait(until.visibilityOf(pipelineRun));
await pipelineRun.click();
const pipelines = element(by.css(`[data-test-id="${runName}"]`));
Copy link
Contributor

Choose a reason for hiding this comment

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

The definition of the UI element being accessed should be in the test's corresponding view file and not here in the test code.

await browser.wait(until.visibilityOf(pipelineActionList));
await pipelineActionList.click();
await pipelineStartLastRun.click();
await browser.wait(until.elementToBeClickable(pipelineRuns), 5000);
Copy link
Contributor

Choose a reason for hiding this comment

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

The timeout value of 5000 msec should be defined in a constant.

});
await pipelineSelect(runName).click();
await pipelineRunLogs.click();
// browser.wait(function() {
Copy link
Contributor

Choose a reason for hiding this comment

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

We should not leave commented out code in the repo.

// return element(by.className('odc-pipeline-run-logs__tasklist')).isLoaded()
// });

await browser.wait(until.presenceOf(element(by.className('odc-pipeline-run-logs__tasklist'))));
Copy link
Contributor

Choose a reason for hiding this comment

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

The definition of the UI element being accessed should be in the test's corresponding view file and not here in the test code.

// });

await browser.wait(until.presenceOf(element(by.className('odc-pipeline-run-logs__tasklist'))));
await element(by.className('odc-pipeline-run-logs__tasklist'))
Copy link
Contributor

Choose a reason for hiding this comment

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

The definition of the UI element being accessed should be in the test's corresponding view file and not here in the test code.

.getText()
.then(function(text) {
const sample = text.replace(/\s+/g, ' ');
// expect(text.replace(/\s+/g, ' ')).toContain('install-deps compile code-sanity e2e-tests');
Copy link
Contributor

Choose a reason for hiding this comment

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

More commented out code - we should remove this.

await pipelineActionList.click();
await pipelineStartLastRun.click();
await browser.wait(until.elementToBeClickable(pipelineRuns), 5000);
await browser.sleep(4000);
Copy link
Contributor

Choose a reason for hiding this comment

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

I had success if I replaced the sleep statement with:


    await browser.wait(until.elementToBeClickable(pipelineRuns), 5000);
    //// await browser.sleep(4000);
    await pipelineRuns.click();
    await browser.wait(until.visibilityOf(pipelineTableBody));

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not working on my machine

// return element(by.className('odc-pipeline-run-logs__tasklist')).isLoaded()
// });

await browser.wait(until.presenceOf(element(by.className('odc-pipeline-run-logs__tasklist'))));
Copy link
Contributor

Choose a reason for hiding this comment

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

I had success if I replaced the classname with:

await browser.wait(until.presenceOf(element(by.className('odc-pipeline-topology-graph'))));
    await element(by.className('odc-pipeline-topology-graph'))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not working for me

@@ -1,6 +1,6 @@
import { browser, $, ExpectedConditions as until, by, element } from 'protractor';

export const operatorModal = $('.pf-c-modal-box');
export const operatorModal = $('.co-catalog-page__overlay');
Copy link
Contributor

Choose a reason for hiding this comment

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

@sanketpathak FYI this change will prevent me from providing an official approval. You'll need to seek out Christian or another dev from the frontend OWNERS file... so they can get both dev-console & OLM.

Also, will this impact any integration tests in OLM?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This change is necessary as the above modal element is using pattern fly class which is quite unreliable and tests are failing because of it.

Copy link
Contributor

Choose a reason for hiding this comment

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

I wasn't directly inquiring if this was a needed change - I was inquiring if it will impact other tests. I was also mentioning because of this change, I am unable to give an approved label... so the best I can give is lgtm - the same as Len.

Copy link
Contributor

@andrewballantyne andrewballantyne left a comment

Choose a reason for hiding this comment

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

/assign

Spoke with Sanket, he'll update this PR with Len's feedback + the comments before I do my review.

Still getting used to reading protractor code, so these comments will hopefully help. Once that's done I'll try to make this review a high priority.

@spadgett
Copy link
Member

/bugzilla refresh

@openshift-ci-robot openshift-ci-robot removed the bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label Feb 20, 2020
@openshift-ci-robot
Copy link
Contributor

@spadgett: This pull request references Bugzilla bug 1803257, which is invalid:

  • expected the bug to target the "4.5.0" release, but it targets "4.4.0" instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

/bugzilla refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot added the bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. label Feb 20, 2020
@sanketpathak
Copy link
Contributor Author

/bugzilla refresh

@openshift-ci-robot openshift-ci-robot added bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. and removed bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. labels Feb 20, 2020
@openshift-ci-robot
Copy link
Contributor

@sanketpathak: This pull request references Bugzilla bug 1803257, which is valid.

In response to this:

/bugzilla refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@sanketpathak
Copy link
Contributor Author

/retest

@sanketpathak sanketpathak force-pushed the test-pipeline-v2 branch 2 times, most recently from 2c4fb37 to 948095b Compare February 20, 2020 23:48
@@ -146,7 +146,7 @@ export const NavBar = withRouter<NavBarProps>(({ pages, basePath }) => {
'co-m-horizontal-nav-item--active': matchUrl && matchUrl.isExact,
});
return (
<li className={klass} key={name}>
<li className={klass} key={name} data-test-id={`horizontal-nav-${name}`}>
Copy link
Contributor

Choose a reason for hiding this comment

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

Why isn't this on the actionable link?

Comment on lines 35 to 39
export const pipelineSelect = function(name) {
const newpipelineSelect = element(by.css(`[data-test-id="${name}"]`));
return newpipelineSelect;
};
Copy link
Contributor

Choose a reason for hiding this comment

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

export const pipelineSelect = (name) => element(by.css(`[data-test-id="${name}"]`));

@christianvogt
Copy link
Contributor

/lgtm
/approve

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 27, 2020
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: christianvogt, sanketpathak

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 27, 2020
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Feb 28, 2020

@sanketpathak: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/verify 948095b link /test verify

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit 9424e9b into openshift:master Feb 28, 2020
@openshift-ci-robot
Copy link
Contributor

@sanketpathak: All pull requests linked via external trackers have merged. Bugzilla bug 1803257 has been moved to the MODIFIED state.

In response to this:

Bug 1803257: Test pipeline v2

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@sanketpathak
Copy link
Contributor Author

/cherrypick release-4.4

@openshift-cherrypick-robot

@sanketpathak: new pull request created: #4555

In response to this:

/cherrypick release-4.4

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@spadgett spadgett added this to the v4.5 milestone Feb 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. component/core Related to console core functionality component/dev-console Related to dev-console component/olm Related to OLM lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants