rhtyd commented on issue #4711:
URL: https://github.com/apache/cloudstack/issues/4711#issuecomment-781972616


   Errors on master cc @shwstppr 
   
   ```
   > npm run test:unit
   
   > [email protected] test:unit /home/rohit/lab/apache/cloudstack/ui
   > vue-cli-service test:unit
   
   Browserslist: caniuse-lite is outdated. Please run:
   npx browserslist@latest --update-db
   Browserslist: caniuse-lite is outdated. Please run:
   npx browserslist@latest --update-db
   Browserslist: caniuse-lite is outdated. Please run:
   npx browserslist@latest --update-db
   Browserslist: caniuse-lite is outdated. Please run:
   npx browserslist@latest --update-db
    PASS  tests/unit/components/view/ActionButton.spec.js
    PASS  tests/unit/components/widgets/Status.spec.js
    FAIL  tests/unit/views/compute/MigrateWizard.spec.js
     ● Views > compute > MigrateWizard.vue › Methods › submitForm() › check api 
is called when selectedHost.requiresStorageMotion is true
   
       expect(jest.fn()).toHaveBeenCalledWith(...expected)
   
       Expected: {"data": {}, "method": "GET", "params": {"command": 
"migrateVirtualMachineWithVolume", "hostid": "test-host-id", "response": 
"json", "virtualmachineid": "test-resource-id"}, "url": "/"}
       Received
              1
                 Object {
                   "data": URLSearchParams {},
                   "method": "GET",
                   "params": Object {
               -     "command": "migrateVirtualMachineWithVolume",
               -     "hostid": "test-host-id",
               +     "command": "findHostsForMigration",
               +     "keyword": "",
               +     "page": 1,
               +     "pagesize": 10,
                     "response": "json",
                     "virtualmachineid": "test-resource-id",
                   },
                   "url": "/",
                 },
              2
               @@ -1,10 +1,10 @@
                 Object {
                   "data": URLSearchParams {},
                   "method": "GET",
                   "params": Object {
               -     "command": "migrateVirtualMachineWithVolume",
               +     "command": "migrateSystemVm",
                     "hostid": "test-host-id",
                     "response": "json",
                     "virtualmachineid": "test-resource-id",
                   },
                   "url": "/",,
   
       Number of calls: 2
   
         367 |         setTimeout(() => {
         368 |           expect(mockAxios).toHaveBeenCalled()
       > 369 |           expect(mockAxios).toHaveBeenCalledWith({
             |                             ^
         370 |             url: '/',
         371 |             method: 'GET',
         372 |             data: new URLSearchParams(),
   
         at tests/unit/views/compute/MigrateWizard.spec.js:369:29
         at Timeout.callback [as _onTimeout] 
(node_modules/jsdom/lib/jsdom/browser/Window.js:678:19)
   
     ● Views > compute > MigrateWizard.vue › Methods › submitForm() › check api 
is called when selectedHost.requiresStorageMotion is false
   
       expect(jest.fn()).toHaveBeenCalledWith(...expected)
   
       Expected: {"data": {}, "method": "GET", "params": {"command": 
"migrateVirtualMachine", "hostid": "test-host-id", "response": "json", 
"virtualmachineid": "test-resource-id"}, "url": "/"}
       Received
              1
                 Object {
                   "data": URLSearchParams {},
                   "method": "GET",
                   "params": Object {
               -     "command": "migrateVirtualMachine",
               -     "hostid": "test-host-id",
               +     "command": "findHostsForMigration",
               +     "keyword": "",
               +     "page": 1,
               +     "pagesize": 10,
                     "response": "json",
                     "virtualmachineid": "test-resource-id",
                   },
                   "url": "/",
                 },
              2
               @@ -1,10 +1,10 @@
                 Object {
                   "data": URLSearchParams {},
                   "method": "GET",
                   "params": Object {
               -     "command": "migrateVirtualMachine",
               +     "command": "migrateSystemVm",
                     "hostid": "test-host-id",
                     "response": "json",
                     "virtualmachineid": "test-resource-id",
                   },
                   "url": "/",,
   
       Number of calls: 2
   
         419 |         setTimeout(() => {
         420 |           expect(mockAxios).toHaveBeenCalled()
       > 421 |           expect(mockAxios).toHaveBeenCalledWith({
             |                             ^
         422 |             url: '/',
         423 |             method: 'GET',
         424 |             data: new URLSearchParams(),
   
         at tests/unit/views/compute/MigrateWizard.spec.js:421:29
         at Timeout.callback [as _onTimeout] 
(node_modules/jsdom/lib/jsdom/browser/Window.js:678:19)
   
     ● Views > compute > MigrateWizard.vue › Methods › submitForm() › check 
store dispatch `AddAsyncJob` and $pollJob have successMethod() is called with 
requiresStorageMotion is true
   
       expect(jest.fn()).toHaveBeenCalled()
   
       Expected number of calls: >= 1
       Received number of calls:    0
   
         470 | 
         471 |         setTimeout(() => {
       > 472 |           expect(actions.AddAsyncJob).toHaveBeenCalled()
             |                                       ^
         473 |           expect(mocks.$pollJob).toHaveBeenCalled()
         474 |           
expect(wrapper.emitted()['close-action'][0]).toEqual([])
         475 | 
   
         at tests/unit/views/compute/MigrateWizard.spec.js:472:39
         at Timeout.callback [as _onTimeout] 
(node_modules/jsdom/lib/jsdom/browser/Window.js:678:19)
   
     ● Views > compute > MigrateWizard.vue › Methods › submitForm() › check 
store dispatch `AddAsyncJob` and $pollJob have successMethod() is called with 
requiresStorageMotion is false
   
       expect(jest.fn()).toHaveBeenCalled()
   
       Expected number of calls: >= 1
       Received number of calls:    0
   
         513 | 
         514 |         setTimeout(() => {
       > 515 |           expect(actions.AddAsyncJob).toHaveBeenCalled()
             |                                       ^
         516 |           expect(mocks.$pollJob).toHaveBeenCalled()
         517 |           
expect(wrapper.emitted()['close-action'][0]).toEqual([])
         518 | 
   
         at tests/unit/views/compute/MigrateWizard.spec.js:515:39
         at Timeout.callback [as _onTimeout] 
(node_modules/jsdom/lib/jsdom/browser/Window.js:678:19)
   
     ● Views > compute > MigrateWizard.vue › Methods › submitForm() › check 
store dispatch `AddAsyncJob` and $pollJob have errorMethod() is called
   
       expect(jest.fn()).toHaveBeenCalled()
   
       Expected number of calls: >= 1
       Received number of calls:    0
   
         556 | 
         557 |         setTimeout(() => {
       > 558 |           expect(actions.AddAsyncJob).toHaveBeenCalled()
             |                                       ^
         559 |           expect(mocks.$pollJob).toHaveBeenCalled()
         560 |           
expect(wrapper.emitted()['close-action'][0]).toEqual([])
         561 | 
   
         at tests/unit/views/compute/MigrateWizard.spec.js:558:39
         at Timeout.callback [as _onTimeout] 
(node_modules/jsdom/lib/jsdom/browser/Window.js:678:19)
   
     ● Views > compute > MigrateWizard.vue › Methods › submitForm() › check 
store dispatch `AddAsyncJob` and $pollJob have catchMethod() is called
   
       expect(jest.fn()).toHaveBeenCalled()
   
       Expected number of calls: >= 1
       Received number of calls:    0
   
         593 | 
         594 |         setTimeout(() => {
       > 595 |           expect(actions.AddAsyncJob).toHaveBeenCalled()
             |                                       ^
         596 |           expect(mocks.$pollJob).toHaveBeenCalled()
         597 |           
expect(wrapper.emitted()['close-action'][0]).toEqual([])
         598 | 
   
         at tests/unit/views/compute/MigrateWizard.spec.js:595:39
         at Timeout.callback [as _onTimeout] 
(node_modules/jsdom/lib/jsdom/browser/Window.js:678:19)
   
    FAIL  tests/unit/views/AutogenView.spec.js (30.504s)
     ● Console
   
       console.error node_modules/vue/dist/vue.runtime.common.dev.js:621
         [Vue warn]: Error in nextTick: "Error: 
expect(jest.fn()).toHaveBeenCalledWith(...expected)
         
         - Expected
         + Received
         
           Object {
             "data": URLSearchParams {},
             "method": "GET",
             "params": Object {
               "command": "testApiNameCase1",
         -     "id": "test-id-value",
         +     "id": undefined,
               "response": "json",
             },
             "url": "/",
           },
         
         Number of calls: 1"
         
         found in
         
         ---> <Resource>
                <Root>
       console.error node_modules/vue/dist/vue.runtime.common.dev.js:1884
         JestAssertionError: expect(jest.fn()).toHaveBeenCalledWith(...expected)
         
         - Expected
         + Received
         
           Object {
             "data": URLSearchParams {},
             "method": "GET",
             "params": Object {
               "command": "testApiNameCase1",
         -     "id": "test-id-value",
         +     "id": undefined,
               "response": "json",
             },
             "url": "/",
           },
         
         Number of calls: 1
             at VueComponent.call 
(/home/rohit/lab/apache/cloudstack/ui/tests/unit/views/AutogenView.spec.js:2167:29)
             at Array.<anonymous> 
(/home/rohit/lab/apache/cloudstack/ui/node_modules/vue/dist/vue.runtime.common.dev.js:1976:12)
             at flushCallbacks 
(/home/rohit/lab/apache/cloudstack/ui/node_modules/vue/dist/vue.runtime.common.dev.js:1902:5)
 {
           matcherResult: { message: [Function], pass: false }
         }
       console.error node_modules/vue/dist/vue.runtime.common.dev.js:621
         [Vue warn]: Error in nextTick: "Error: 
expect(jest.fn()).toHaveBeenCalledWith(...expected)
         
         - Expected
         + Received
         
           Object {
             "data": URLSearchParams {},
             "method": "GET",
             "params": Object {
               "command": "testApiNameCase1",
         -     "id": "test-id-value",
         +     "id": undefined,
               "response": "json",
             },
             "url": "/",
           },
         
         Number of calls: 1"
         
         found in
         
         ---> <Resource>
                <Root>
       console.error node_modules/vue/dist/vue.runtime.common.dev.js:1884
         JestAssertionError: expect(jest.fn()).toHaveBeenCalledWith(...expected)
         
         - Expected
         + Received
         
           Object {
             "data": URLSearchParams {},
             "method": "GET",
             "params": Object {
               "command": "testApiNameCase1",
         -     "id": "test-id-value",
         +     "id": undefined,
               "response": "json",
             },
             "url": "/",
           },
         
         Number of calls: 1
             at VueComponent.call 
(/home/rohit/lab/apache/cloudstack/ui/tests/unit/views/AutogenView.spec.js:2218:29)
             at Array.<anonymous> 
(/home/rohit/lab/apache/cloudstack/ui/node_modules/vue/dist/vue.runtime.common.dev.js:1976:12)
             at flushCallbacks 
(/home/rohit/lab/apache/cloudstack/ui/node_modules/vue/dist/vue.runtime.common.dev.js:1902:5)
 {
           matcherResult: { message: [Function], pass: false }
         }
       console.error node_modules/vue/dist/vue.runtime.common.dev.js:621
         [Vue warn]: Error in nextTick: "Error: 
expect(jest.fn()).toHaveBeenCalledWith(...expected)
         
         - Expected
         + Received
         
           Object {
             "data": URLSearchParams {},
             "method": "GET",
             "params": Object {
         -     "column1": false,
         +     "column1": undefined,
               "command": "testApiNameCase1",
               "response": "json",
             },
             "url": "/",
           },
         
         Number of calls: 1"
         
         found in
         
         ---> <Resource>
                <Root>
       console.error node_modules/vue/dist/vue.runtime.common.dev.js:1884
         JestAssertionError: expect(jest.fn()).toHaveBeenCalledWith(...expected)
         
         - Expected
         + Received
         
           Object {
             "data": URLSearchParams {},
             "method": "GET",
             "params": Object {
         -     "column1": false,
         +     "column1": undefined,
               "command": "testApiNameCase1",
               "response": "json",
             },
             "url": "/",
           },
         
         Number of calls: 1
             at VueComponent.call 
(/home/rohit/lab/apache/cloudstack/ui/tests/unit/views/AutogenView.spec.js:2266:29)
             at Array.<anonymous> 
(/home/rohit/lab/apache/cloudstack/ui/node_modules/vue/dist/vue.runtime.common.dev.js:1976:12)
             at flushCallbacks 
(/home/rohit/lab/apache/cloudstack/ui/node_modules/vue/dist/vue.runtime.common.dev.js:1902:5)
 {
           matcherResult: { message: [Function], pass: false }
         }
   
     ● Views > AutogenView.vue › Methods › execSubmit() › check api is called 
with params has item id equal resource.id
   
       : Timeout - Async callback was not invoked within the 5000ms timeout 
specified by jest.setTimeout.Timeout - Async callback was not invoked within 
the 5000ms timeout specified by jest.setTimeout.Error:
   
         2130 |       })
         2131 | 
       > 2132 |       it('check api is called with params has item id equal 
resource.id', (done) => {
              |       ^
         2133 |         wrapper = factory({
         2134 |           data: {
         2135 |             showAction: true,
   
         at new Spec (node_modules/jest-jasmine2/build/jasmine/Spec.js:116:22)
         at Suite.<anonymous> (tests/unit/views/AutogenView.spec.js:2132:7)
         at Suite.<anonymous> (tests/unit/views/AutogenView.spec.js:2098:5)
         at Suite.<anonymous> (tests/unit/views/AutogenView.spec.js:228:3)
         at Object.<anonymous> (tests/unit/views/AutogenView.spec.js:88:1)
   
     ● Views > AutogenView.vue › Methods › execSubmit() › check api is called 
when form has input key not exist in currentAction.params
   
       expect(jest.fn()).toHaveBeenCalledWith(...expected)
   
       - Expected
       + Received
   
         Object {
           "data": URLSearchParams {},
           "method": "GET",
           "params": Object {
             "command": "testApiNameCase1",
       -     "id": "test-id-value",
       +     "id": undefined,
             "response": "json",
           },
           "url": "/",
         },
   
       Number of calls: 1
   
         2165 | 
         2166 |           expect(mockAxios).toHaveBeenCalledTimes(1)
       > 2167 |           expect(mockAxios).toHaveBeenCalledWith({
              |                             ^
         2168 |             url: '/',
         2169 |             method: 'GET',
         2170 |             data: new URLSearchParams(),
   
         at VueComponent.call (tests/unit/views/AutogenView.spec.js:2167:29)
         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 › execSubmit() › check api is called 
when form has input key not exist in currentAction.params
   
       : Timeout - Async callback was not invoked within the 5000ms timeout 
specified by jest.setTimeout.Timeout - Async callback was not invoked within 
the 5000ms timeout specified by jest.setTimeout.Error:
   
         2180 |       })
         2181 | 
       > 2182 |       it('check api is called when form has input key not exist 
in currentAction.params', (done) => {
              |       ^
         2183 |         wrapper = factory({
         2184 |           data: {
         2185 |             showAction: true,
   
         at new Spec (node_modules/jest-jasmine2/build/jasmine/Spec.js:116:22)
         at Suite.<anonymous> (tests/unit/views/AutogenView.spec.js:2182:7)
         at Suite.<anonymous> (tests/unit/views/AutogenView.spec.js:2098:5)
         at Suite.<anonymous> (tests/unit/views/AutogenView.spec.js:228:3)
         at Object.<anonymous> (tests/unit/views/AutogenView.spec.js:88:1)
   
     ● Views > AutogenView.vue › Methods › execSubmit() › check api is called 
when form has input key exist in currentAction.params, type is boolean and 
value is undefined
   
       expect(jest.fn()).toHaveBeenCalledWith(...expected)
   
       - Expected
       + Received
   
         Object {
           "data": URLSearchParams {},
           "method": "GET",
           "params": Object {
             "command": "testApiNameCase1",
       -     "id": "test-id-value",
       +     "id": undefined,
             "response": "json",
           },
           "url": "/",
         },
   
       Number of calls: 1
   
         2216 | 
         2217 |           expect(mockAxios).toHaveBeenCalledTimes(1)
       > 2218 |           expect(mockAxios).toHaveBeenCalledWith({
              |                             ^
         2219 |             url: '/',
         2220 |             method: 'GET',
         2221 |             data: new URLSearchParams(),
   
         at VueComponent.call (tests/unit/views/AutogenView.spec.js:2218:29)
         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 › execSubmit() › check api is called 
when form has input key exist in currentAction.params, type is boolean and 
value is undefined
   
       : Timeout - Async callback was not invoked within the 5000ms timeout 
specified by jest.setTimeout.Timeout - Async callback was not invoked within 
the 5000ms timeout specified by jest.setTimeout.Error:
   
         2231 |       })
         2232 | 
       > 2233 |       it('check api is called when form has input key exist in 
currentAction.params, type is boolean and value is undefined', (done) => {
              |       ^
         2234 |         wrapper = factory({
         2235 |           data: {
         2236 |             showAction: true,
   
         at new Spec (node_modules/jest-jasmine2/build/jasmine/Spec.js:116:22)
         at Suite.<anonymous> (tests/unit/views/AutogenView.spec.js:2233:7)
         at Suite.<anonymous> (tests/unit/views/AutogenView.spec.js:2098:5)
         at Suite.<anonymous> (tests/unit/views/AutogenView.spec.js:228:3)
         at Object.<anonymous> (tests/unit/views/AutogenView.spec.js:88:1)
   
     ● Views > AutogenView.vue › Methods › execSubmit() › check api is called 
when form has input key exist in currentAction.params, type is boolean and 
value is null
   
       expect(jest.fn()).toHaveBeenCalledWith(...expected)
   
       - Expected
       + Received
   
         Object {
           "data": URLSearchParams {},
           "method": "GET",
           "params": Object {
       -     "column1": false,
       +     "column1": undefined,
             "command": "testApiNameCase1",
             "response": "json",
           },
           "url": "/",
         },
   
       Number of calls: 1
   
         2264 | 
         2265 |           expect(mockAxios).toHaveBeenCalledTimes(1)
       > 2266 |           expect(mockAxios).toHaveBeenCalledWith({
              |                             ^
         2267 |             url: '/',
         2268 |             method: 'GET',
         2269 |             data: new URLSearchParams(),
   
         at VueComponent.call (tests/unit/views/AutogenView.spec.js:2266:29)
         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)
   
   
   =============================== Coverage summary 
===============================
   Statements   : 4.61% ( 707/15335 )
   Branches     : 5.64% ( 436/7725 )
   Functions    : 2.42% ( 122/5049 )
   Lines        : 4.61% ( 703/15250 )
   
================================================================================
   Test Suites: 2 failed, 2 passed, 4 total
   Tests:       10 failed, 124 passed, 134 total
   Snapshots:   0 total
   Time:        43.108s
   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/rohit/.npm/_logs/2021-02-19T10_04_15_669Z-debug.log
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to