SPEC HAS NO EXPECTATIONS warnings in jasmine tests

Bug #1894127 reported by Tatiana Ovchinnikova
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Undecided
Tatiana Ovchinnikova

Bug Description

There are 23 tests which Jasmine marks with the warning "SPEC HAS NO EXPECTATIONS":

permissions service
    checkAll
        with extended permissions
            SPEC HAS NO EXPECTATIONS with promise array, adds checks for permissions
            SPEC HAS NO EXPECTATIONS with promise, adds checks for permissions
            SPEC HAS NO EXPECTATIONS with no promise, adds checks for permissions
        SPEC HAS NO EXPECTATIONS without extended permissions it returns no promises
...
textDownloadService
    SPEC HAS NO EXPECTATIONS should return promise and it resolve filename after starting download file
...
horizon.framework.util.filters
    simpleDate
        SPEC HAS NO EXPECTATIONS returns blank if nothing
        SPEC HAS NO EXPECTATIONS returns the expected time

    mediumDate
        SPEC HAS NO EXPECTATIONS returns blank if nothing
        SPEC HAS NO EXPECTATIONS returns the expected time
...
horizon.framework.util.navigations.service
    setBreadcrumb
        SPEC HAS NO EXPECTATIONS sets breadcrumb items from specified array
...
Launch Instance Model
    launchInstanceModel Factory
        Post Initialize Model
            SPEC HAS NO EXPECTATIONS getPorts at launch should not return child port
...
horizon.dashboard.identity.domains.actions.delete.service
    perform method and pass only
        SPEC HAS NO EXPECTATIONS should open the delete modal
        SPEC HAS NO EXPECTATIONS should pass and fail in a function that delete domain by item action
        SPEC HAS NO EXPECTATIONS should pass and fail in a function that delete domain by batch action
...
horizon.dashboard.identity.groups.actions.delete.service
    perform method and pass only
        SPEC HAS NO EXPECTATIONS should open the delete modal
        SPEC HAS NO EXPECTATIONS should pass and fail in a function that delete group by item action
        SPEC HAS NO EXPECTATIONS should pass and fail in a function that delete group by batch action
...
horizon.dashboard.identity.groups
    SPEC HAS NO EXPECTATIONS should load groups
...
horizon.dashboard.identity.users.actions.delete.service
    perform method and pass only
        SPEC HAS NO EXPECTATIONS should open the delete modal
        SPEC HAS NO EXPECTATIONS should pass and fail in a function that delete user by item action
        SPEC HAS NO EXPECTATIONS should pass and fail in a function that delete user by batch action
...
horizon.framework.util.timezones.service
    get timezone offset
        SPEC HAS NO EXPECTATIONS returns +0000(UTC offset) if nothing
        SPEC HAS NO EXPECTATIONS returns the timezone offset

That means in general that these tests are doing nothing since they are for the async callback functions and it's crucial to expect outputs after resolving promises.

Changed in horizon:
assignee: nobody → Tatiana Ovchinnikova (tmazur)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.opendev.org/749802

Changed in horizon:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.opendev.org/749816

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.opendev.org/750791

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.opendev.org/751375

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.opendev.org/749816
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=2fe3e92cd3b72de442ff003447dff2b8d07a185d
Submitter: Zuul
Branch: master

commit 2fe3e92cd3b72de442ff003447dff2b8d07a185d
Author: Tatiana Ovchinnikova <email address hidden>
Date: Thu Sep 3 14:20:28 2020 -0500

    Make filters tests work

    Filters JS tests have no output expectations but Jasmine Spec Runner marks
    them 'passed' only adding "SPEC HAS NO EXPECTATIONS" into the tests names.
    This patch adds expectations and fixes working tests.

    Partial-Bug: #1894127

    Change-Id: I8e434d03f80402cb4fabdffa7bfb1f2f6ddb379e

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.opendev.org/751375
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=91298f9b5f89a7d1805a3ab252398274badf4372
Submitter: Zuul
Branch: master

commit 91298f9b5f89a7d1805a3ab252398274badf4372
Author: Tatiana Ovchinnikova <email address hidden>
Date: Fri Sep 11 12:58:28 2020 -0500

    Make getPorts and setBreadcrumb tests work

    This patch adds expectations to the tests and make them work.

    Partial-Bug: #1894127

    Change-Id: Ic22033343c344a42148b0ec5a31bccb1e08478c6

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.opendev.org/752766

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.opendev.org/753432

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.opendev.org/750791
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=97aa7532e84656900a7917f3e09ed449729162e5
Submitter: Zuul
Branch: master

commit 97aa7532e84656900a7917f3e09ed449729162e5
Author: Tatiana Ovchinnikova <email address hidden>
Date: Wed Sep 9 13:54:26 2020 -0500

    Make identity tests work

    Identity JS tests have no output expectations but Jasmine Spec Runner marks
    them 'passed' only adding "SPEC HAS NO EXPECTATIONS" into the tests names.
    This patch adds callbacks to make tests asynchronous and fix it.

    Partial-Bug: #1894127

    Change-Id: I6c10c49b6a6aaee2fded8c3ef02f858208bc31b4

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.opendev.org/749802
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=3a94391142c7374836f5b77e9307bd4f5e98d818
Submitter: Zuul
Branch: master

commit 3a94391142c7374836f5b77e9307bd4f5e98d818
Author: Tatiana Ovchinnikova <email address hidden>
Date: Tue Sep 1 13:16:12 2020 -0500

    Make timezone tests work

    Timezone JS tests have no output expectations but Jasmine Spec Runner marks
    them 'passed' only adding "SPEC HAS NO EXPECTATIONS" into the tests names.
    This patch fixes it and adds one more test.

    Partial-Bug: #1894127

    Change-Id: I0d760f26d064cbc4fd019f1b51c97b88fa6c7917

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.opendev.org/753432
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=533892f080ebdf29173d11db4d12f92809d39b36
Submitter: Zuul
Branch: master

commit 533892f080ebdf29173d11db4d12f92809d39b36
Author: Tatiana Ovchinnikova <email address hidden>
Date: Tue Sep 22 14:11:12 2020 -0500

    Make text download and load groups tests work

    Currently "then" callback functions for these tests aren't called since
    digest cycles were never triggered. Jasmine Spec Runner marks them 'passed'
    only adding "SPEC HAS NO EXPECTATIONS" into their names.
    This patch triggers a digest by calling a scope's $apply functions in a
    correct place, deals with timeout properly and makes the tests work.

    Closes-Bug: #1894127

    Change-Id: I00acc4b13fa0cc05b8c6ccd2024084527562f001

Changed in horizon:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.opendev.org/752766
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=370d1739c630450d0d493ecabfb03d3ab6d6abb3
Submitter: Zuul
Branch: master

commit 370d1739c630450d0d493ecabfb03d3ab6d6abb3
Author: Tatiana Ovchinnikova <email address hidden>
Date: Fri Sep 11 13:12:35 2020 -0500

    Make permissions tests work

    Permissions JS tests are testing promises, however "then" callback functions
    aren't called since digest cycles were never triggered. Jasmine Spec Runner
    marks them 'passed' only adding "SPEC HAS NO EXPECTATIONS" into their names.
    This patch triggers a digest by calling a scope's $apply functions and makes
    the tests work.

    Partial-Bug: #1894127

    Change-Id: I2d13664df42f23f1436f6231fd3cec56475f7e8d

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/horizon 19.0.0

This issue was fixed in the openstack/horizon 19.0.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.