Skip to content

Conversation

@utchoang
Copy link

@utchoang utchoang commented Feb 22, 2021

Description

Fixes #4711
For 4.15 branch

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

UI test
After fix:
image

How Has This Been Tested?

@rohityadavcloud rohityadavcloud changed the base branch from master to 4.15 February 22, 2021 07:59
Copy link
Member

@rohityadavcloud rohityadavcloud left a comment

Choose a reason for hiding this comment

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

Let's wait for travis job#1 that runs UI unit tests to pass

@rohityadavcloud rohityadavcloud added this to the 4.15.1.0 milestone Feb 22, 2021
Copy link
Contributor

@shwstppr shwstppr left a comment

Choose a reason for hiding this comment

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

Lgtm

@rohityadavcloud
Copy link
Member

Just checked, sorry @utchoang tests are still failing which I suspect could be due to some distro specific pkgs or dependencies (npm/nodejs?). See Travis's first job: https://travis-ci.com/github/apache/cloudstack/jobs/484968060

To check, you'll need to open the first job log from the PR, and then click on the $ ./tools/travis/install.sh... block. For example:

> [email protected] lint /home/travis/build/apache/cloudstack/ui
> vue-cli-service lint
 DONE  No lint errors found!
> [email protected] test:unit /home/travis/build/apache/cloudstack/ui
> vue-cli-service test:unit
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db
[vue-jest]: Less are not currently compiled by vue-jest
 FAIL  tests/unit/views/AutogenView.spec.js (21.516s)
  ● Console
    console.error node_modules/vue/dist/vue.runtime.common.dev.js:621
      [Vue warn]: Error in nextTick: "Error: expect(received).toEqual(expected) // deep equality
      
      - Expected
      + Received
      
        Array [
          Object {
      -     "name": "id",
      +     "name": "column1",
            "type": "string",
          },
          Object {
      -     "name": "name",
      +     "name": "column2",
            "type": "string",
          },
          Object {
      -     "name": "column1",
      +     "name": "column3",
            "type": "string",
          },
          Object {
      -     "name": "column2",
      +     "name": "name",
            "type": "string",
          },
          Object {
      -     "name": "column3",
      +     "name": "id",
            "type": "string",
          },
        ]"
      
      found in
      
      ---> <Resource>
             <Root>
    console.error node_modules/vue/dist/vue.runtime.common.dev.js:1884
      { Error: expect(received).toEqual(expected) // deep equality
      
      - Expected
      + Received
      
        Array [
          Object {
      -     "name": "id",
      +     "name": "column1",
            "type": "string",
          },
          Object {
      -     "name": "name",
      +     "name": "column2",
            "type": "string",
          },
          Object {
      -     "name": "column1",
      +     "name": "column3",
            "type": "string",
          },
          Object {
      -     "name": "column2",
      +     "name": "name",
            "type": "string",
          },
          Object {
      -     "name": "column3",
      +     "name": "id",
            "type": "string",
          },
        ]
          at VueComponent.call (/home/travis/build/apache/cloudstack/ui/tests/unit/views/AutogenView.spec.js:1080:51)
          at Array.<anonymous> (/home/travis/build/apache/cloudstack/ui/node_modules/vue/dist/vue.runtime.common.dev.js:1976:12)
          at flushCallbacks (/home/travis/build/apache/cloudstack/ui/node_modules/vue/dist/vue.runtime.common.dev.js:1902:5)
        matcherResult:
         { actual: [ [Object], [Object], [Object], [Object], [Object] ],
           expected: [ [Object], [Object], [Object], [Object], [Object] ],
           message: [Function],
           name: 'toEqual',
           pass: false } }
    console.error node_modules/vue/dist/vue.runtime.common.dev.js:621
      [Vue warn]: Error in nextTick: "Error: expect(received).toEqual(expected) // deep equality
      
      - Expected
      + Received
      
        Array [
          Object {
      -     "name": "id",
      +     "name": "column1",
            "type": "string",
          },
          Object {
      -     "name": "name",
      +     "name": "column2",
            "type": "string",
          },
          Object {
      -     "name": "column1",
      +     "name": "column3",
            "type": "string",
          },
          Object {
      -     "name": "column2",
      +     "name": "name",
            "type": "string",
          },
          Object {
      -     "name": "column3",
      +     "name": "id",
            "type": "string",
          },
        ]"
      
      found in
      
      ---> <Resource>
             <Root>
    console.error node_modules/vue/dist/vue.runtime.common.dev.js:1884
      { Error: expect(received).toEqual(expected) // deep equality
      
      - Expected
      + Received
      
        Array [
          Object {
      -     "name": "id",
      +     "name": "column1",
            "type": "string",
          },
          Object {
      -     "name": "name",
      +     "name": "column2",
            "type": "string",
          },
          Object {
      -     "name": "column1",
      +     "name": "column3",
            "type": "string",
          },
          Object {
      -     "name": "column2",
      +     "name": "name",
            "type": "string",
          },
          Object {
      -     "name": "column3",
      +     "name": "id",
            "type": "string",
          },
        ]
          at VueComponent.call (/home/travis/build/apache/cloudstack/ui/tests/unit/views/AutogenView.spec.js:1129:51)
          at Array.<anonymous> (/home/travis/build/apache/cloudstack/ui/node_modules/vue/dist/vue.runtime.common.dev.js:1976:12)
          at flushCallbacks (/home/travis/build/apache/cloudstack/ui/node_modules/vue/dist/vue.runtime.common.dev.js:1902:5)
        matcherResult:
         { actual: [ [Object], [Object], [Object], [Object], [Object] ],
           expected: [ [Object], [Object], [Object], [Object], [Object] ],
           message: [Function],
           name: 'toEqual',
           pass: false } }
  ● Views > AutogenView.vue › Methods › execAction() › check currentAction params and paramsField when execAction() is called with args is exists
    expect(received).toEqual(expected) // deep equality
    - Expected
    + Received
      Array [
        Object {
    -     "name": "id",
    +     "name": "column1",
          "type": "string",
        },
        Object {
    -     "name": "name",
    +     "name": "column2",
          "type": "string",
        },
        Object {
    -     "name": "column1",
    +     "name": "column3",
          "type": "string",
        },
        Object {
    -     "name": "column2",
    +     "name": "name",
          "type": "string",
        },
        Object {
    -     "name": "column3",
    +     "name": "id",
          "type": "string",
        },
      ]
      1078 |           })
      1079 | 
    > 1080 |           expect(wrapper.vm.currentAction.params).toEqual([
           |                                                   ^
      1081 |             { name: 'id', type: 'string' },
      1082 |             { name: 'name', type: 'string' },
      1083 |             { name: 'column1', type: 'string' },
      at VueComponent.call (tests/unit/views/AutogenView.spec.js:1080:51)
      at Array.<anonymous> (node_modules/vue/dist/vue.runtime.common.dev.js:1976:12)
      at flushCallbacks (node_modules/vue/dist/vue.runtime.common.dev.js:1902:5)
  ● Views > AutogenView.vue › Methods › execAction() › check currentAction paramsField and listUuidOpts() is called when execAction() is called
    expect(received).toEqual(expected) // deep equality
    - Expected
    + Received
      Array [
        Object {
    -     "name": "id",
    +     "name": "column1",
          "type": "string",
        },
        Object {
    -     "name": "name",
    +     "name": "column2",
          "type": "string",
        },
        Object {
    -     "name": "column1",
    +     "name": "column3",
          "type": "string",
        },
        Object {
    -     "name": "column2",
    +     "name": "name",
          "type": "string",
        },
        Object {
    -     "name": "column3",
    +     "name": "id",
          "type": "string",
        },
      ]
      1127 |           })
      1128 | 
    > 1129 |           expect(wrapper.vm.currentAction.params).toEqual([
           |                                                   ^
      1130 |             { name: 'id', type: 'string' },
      1131 |             { name: 'name', type: 'string' },
      1132 |             { name: 'column1', type: 'string' },
      at VueComponent.call (tests/unit/views/AutogenView.spec.js:1129:51)
      at Array.<anonymous> (node_modules/vue/dist/vue.runtime.common.dev.js:1976:12)
      at flushCallbacks (node_modules/vue/dist/vue.runtime.common.dev.js:1902:5)
 PASS  tests/unit/views/compute/MigrateWizard.spec.js
 PASS  tests/unit/components/widgets/Status.spec.js
 PASS  tests/unit/components/view/ActionButton.spec.js
=============================== Coverage summary ===============================
Statements   : 4.65% ( 708/15242 )
Branches     : 5.71% ( 437/7654 )
Functions    : 2.49% ( 125/5019 )
Lines        : 4.64% ( 704/15157 )
================================================================================
Test Suites: 1 failed, 3 passed, 4 total
Tests:       2 failed, 132 passed, 134 total
Snapshots:   0 total
Time:        75.214s
Ran all test suites.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] test:unit: `vue-cli-service test:unit`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] test:unit script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     /home/travis/.npm/_logs/2021-02-22T08_05_34_939Z-debug.log

@utchoang
Copy link
Author

@rhtyd All test passed!
image

@rohityadavcloud
Copy link
Member

LGTM, verified on Travis

> vue-cli-service test:unit
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db
[vue-jest]: Less are not currently compiled by vue-jest
 PASS  tests/unit/views/AutogenView.spec.js (22.849s)
 PASS  tests/unit/views/compute/MigrateWizard.spec.js
 PASS  tests/unit/components/widgets/Status.spec.js
 PASS  tests/unit/components/view/ActionButton.spec.js
=============================== Coverage summary ===============================
Statements   : 4.64% ( 708/15244 )
Branches     : 5.71% ( 437/7658 )
Functions    : 2.49% ( 125/5019 )
Lines        : 4.64% ( 704/15159 )
================================================================================
Test Suites: 4 passed, 4 total
Tests:       134 passed, 134 total
Snapshots:   0 total
Time:        80.745s
Ran all test suites.

@rohityadavcloud rohityadavcloud merged commit ba43825 into apache:4.15 Feb 24, 2021
@utchoang utchoang deleted the feature/fix-ui-test branch March 8, 2021 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UI test failures seen in 4.15

4 participants