There is no easy way to run unit and integration tests for OSTF

Bug #1404892 reported by Sebastian Kalinowski
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Committed
Medium
Sebastian Kalinowski

Bug Description

It's very hard to run tests for code in OSTF (it's not about HealthCheck tests that are run after deployment) and there is a lack of documentation to create a development environment and how to test changes in code.

It should use similar approach like run_test.sh from fuel-web and make better use of tox - it will also make easy to run tests for every change in OSTF code.

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

Fix proposed to branch: master
Review: https://review.openstack.org/143448

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

Fix proposed to branch: master
Review: https://review.openstack.org/144734

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on fuel-main (master)

Change abandoned by Sebastian Kalinowski (<email address hidden>) on branch: master
Review: https://review.openstack.org/144734
Reason: All jobs' configurations were moved to different repo.

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

Fix proposed to branch: master
Review: https://review.openstack.org/144742

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

Reviewed: https://review.openstack.org/144742
Committed: https://git.openstack.org/cgit/stackforge/fuel-ostf/commit/?id=c0e9862e6ab8d846b0db4d3e3ded6142ee3a5f3e
Submitter: Jenkins
Branch: master

commit c0e9862e6ab8d846b0db4d3e3ded6142ee3a5f3e
Author: Sebastian Kalinowski <email address hidden>
Date: Fri Jan 2 13:45:04 2015 +0100

    Made run_tests.sh use tox to run checks

    Now run_tests.sh script will use tox to run PEP8 checks.
    This will allow to use run_tests.sh in Jenkins build scripts and
    that step is required to further improvements of OSTF tests.

    Change-Id: I51012b2d633557141baebd5669db256dd5e99efd
    Partial-Bug: #1404892

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

Fix proposed to branch: master
Review: https://review.openstack.org/144950

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on fuel-ostf (master)

Change abandoned by Sebastian Kalinowski (<email address hidden>) on branch: master
Review: https://review.openstack.org/143448
Reason: Divided into smaller patches: https://review.openstack.org/#/q/topic:bug/1404892,n,z

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

Fix proposed to branch: master
Review: https://review.openstack.org/144966

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

Fix proposed to branch: master
Review: https://review.openstack.org/145445

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

Fix proposed to branch: master
Review: https://review.openstack.org/145465

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to fuel-ostf (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/145520

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

Reviewed: https://review.openstack.org/144950
Committed: https://git.openstack.org/cgit/stackforge/fuel-ostf/commit/?id=7c9a83539c085180cf83f8bf9da25a91330c5898
Submitter: Jenkins
Branch: master

commit 7c9a83539c085180cf83f8bf9da25a91330c5898
Author: Sebastian Kalinowski <email address hidden>
Date: Mon Jan 5 09:38:33 2015 +0100

    Improved tox configuration

    tox.ini is now similar to the one from Nailgun's code:
     * renamed 'pep8' env
     * added 'venv' env to run any command
     * replaced pep8 script with flake8
     * flake8 conf inside tox.ini
     * updated requirements for new tox.ini

    Change-Id: I74c9b7f7bd137b6284e4e3dd5c131f348b564d78
    Partial-Bug: #1404892

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

Reviewed: https://review.openstack.org/144966
Committed: https://git.openstack.org/cgit/stackforge/fuel-ostf/commit/?id=bac8730db5c1f2db004c276a4d5c09deafe88806
Submitter: Jenkins
Branch: master

commit bac8730db5c1f2db004c276a4d5c09deafe88806
Author: Sebastian Kalinowski <email address hidden>
Date: Mon Jan 5 11:45:19 2015 +0100

    Reorganized and cleaned unit tests

    Now all tests in 'unit' directory can be easily run
     * http requests are mocked
     * do not require access to /var/log
     * do not require db access
     * "integration" tests are in separate directory
     * tox -epy26 -- fuel_plugin/testing/tests/unit/ allows
       to run tests for now (will be added to run_tests.sh in the
       future)
    Introduced requests-mock to mock requests calls
    Moved "base.py" from unitests dir to better place.

    Change-Id: I94ce611015e6d33675f94a04082da2aa6878074a
    Partial-Bug: #1404892

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

Reviewed: https://review.openstack.org/145445
Committed: https://git.openstack.org/cgit/stackforge/fuel-ostf/commit/?id=98d0287158dfb8e5994ac43bbb5d6d4f69df09c6
Submitter: Jenkins
Branch: master

commit 98d0287158dfb8e5994ac43bbb5d6d4f69df09c6
Author: Sebastian Kalinowski <email address hidden>
Date: Wed Jan 7 10:02:20 2015 +0100

    Cleaned and made integration tests working

     * can be run by tox -epy26 -- fuel_plugin/testing/tests/integration
     * removed code that mimic nailgun
     * used requests_mock to mock http requests
     * added BaseIntegrationTest class that set ups DB
     * it is possible to pass own session when creating
       Pecan app for OSTF
     * added WebTest as a requirement for tests

    Change-Id: Id73208c3b0a000c017ec44388e3cecc78d2228a5
    Partial-Bug: #1404892

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-ostf (stable/6.0)

Fix proposed to branch: stable/6.0
Review: https://review.openstack.org/147510

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-ostf (stable/5.1)

Fix proposed to branch: stable/5.1
Review: https://review.openstack.org/147511

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-ostf (stable/5.0)

Fix proposed to branch: stable/5.0
Review: https://review.openstack.org/147525

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-ostf (stable/4.1)

Fix proposed to branch: stable/4.1
Review: https://review.openstack.org/147530

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-ostf (stable/6.0)

Reviewed: https://review.openstack.org/147510
Committed: https://git.openstack.org/cgit/stackforge/fuel-ostf/commit/?id=3d2f44dcfa32d6ce0372cc64695e9edcc1913ea7
Submitter: Jenkins
Branch: stable/6.0

commit 3d2f44dcfa32d6ce0372cc64695e9edcc1913ea7
Author: Sebastian Kalinowski <email address hidden>
Date: Fri Jan 2 13:45:04 2015 +0100

    Made run_tests.sh use tox to run checks

    Now run_tests.sh script will use tox to run PEP8 checks.
    This will allow to use run_tests.sh in Jenkins build scripts and
    that step is required to further improvements of OSTF tests.

    This is a step required to unify our CI jobs configuration

    Change-Id: I51012b2d633557141baebd5669db256dd5e99efd
    Partial-Bug: #1404892
    (cherry picked from commit c0e9862e6ab8d846b0db4d3e3ded6142ee3a5f3e)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-ostf (stable/5.1)

Reviewed: https://review.openstack.org/147511
Committed: https://git.openstack.org/cgit/stackforge/fuel-ostf/commit/?id=287739872fe8dad66f7e8b74f9ab9b7df829d6b5
Submitter: Jenkins
Branch: stable/5.1

commit 287739872fe8dad66f7e8b74f9ab9b7df829d6b5
Author: Sebastian Kalinowski <email address hidden>
Date: Fri Jan 2 13:45:04 2015 +0100

    Made run_tests.sh use tox to run checks

    Now run_tests.sh script will use tox to run PEP8 checks.
    This will allow to use run_tests.sh in Jenkins build scripts and
    that step is required to further improvements of OSTF tests.

    This is a step required to unify our CI jobs configuration.

    Change-Id: I51012b2d633557141baebd5669db256dd5e99efd
    Partial-Bug: #1404892
    (cherry picked from commit c0e9862e6ab8d846b0db4d3e3ded6142ee3a5f3e)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-ostf (stable/5.0)

Reviewed: https://review.openstack.org/147525
Committed: https://git.openstack.org/cgit/stackforge/fuel-ostf/commit/?id=4bb977ba488a0a072ad8ca3b0dfbdce8c558d3c3
Submitter: Jenkins
Branch: stable/5.0

commit 4bb977ba488a0a072ad8ca3b0dfbdce8c558d3c3
Author: Sebastian Kalinowski <email address hidden>
Date: Fri Jan 2 13:45:04 2015 +0100

    Made run_tests.sh use tox to run checks

    Now run_tests.sh script will use tox to run PEP8 checks.
    This will allow to use run_tests.sh in Jenkins build scripts and
    that step is required to further improvements of OSTF tests.

    This is a step required to unify our CI jobs configuration.

    Change-Id: I51012b2d633557141baebd5669db256dd5e99efd
    Partial-Bug: #1404892
    (cherry picked from commit c0e9862e6ab8d846b0db4d3e3ded6142ee3a5f3e)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-ostf (stable/4.1)

Reviewed: https://review.openstack.org/147530
Committed: https://git.openstack.org/cgit/stackforge/fuel-ostf/commit/?id=7c8288216baa1b55b6dac7af5e038ee249b330dc
Submitter: Jenkins
Branch: stable/4.1

commit 7c8288216baa1b55b6dac7af5e038ee249b330dc
Author: Sebastian Kalinowski <email address hidden>
Date: Fri Jan 2 13:45:04 2015 +0100

    Made run_tests.sh use tox to run checks

    Now run_tests.sh script will use tox to run PEP8 checks.
    This will allow to use run_tests.sh in Jenkins build scripts and
    that step is required to further improvements of OSTF tests.

    This is a step required to unify our CI jobs configuration.

    Change-Id: I51012b2d633557141baebd5669db256dd5e99efd
    Partial-Bug: #1404892
    (cherry picked from commit c0e9862e6ab8d846b0db4d3e3ded6142ee3a5f3e)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to fuel-ostf (master)

Reviewed: https://review.openstack.org/145520
Committed: https://git.openstack.org/cgit/stackforge/fuel-ostf/commit/?id=cbe0ea30d974c6a833af3e86bf3270b057d872d6
Submitter: Jenkins
Branch: master

commit cbe0ea30d974c6a833af3e86bf3270b057d872d6
Author: Sebastian Kalinowski <email address hidden>
Date: Wed Jan 14 13:55:28 2015 +0100

    Added hacking checks to tox

    Fixed all places where hacking rules (v0.7) was failing
    Replaced ''' with """ to make them consistent

    Change-Id: I9c1c20f910df696056d2a6a91c33ff7bad266b9f
    Related-Bug: #1404892
    Closes-Bug: #1408240

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

Reviewed: https://review.openstack.org/145465
Committed: https://git.openstack.org/cgit/stackforge/fuel-ostf/commit/?id=c9100263140008abfcc2704732e98fbdfd644068
Submitter: Jenkins
Branch: master

commit c9100263140008abfcc2704732e98fbdfd644068
Author: Sebastian Kalinowski <email address hidden>
Date: Wed Jan 7 11:42:12 2015 +0100

    Extended run_tests.sh to run Python tests

    run_test.sh by default runs all available tests and checks:

     * flake8
     * unit
     * integration
     * selected tests

    Usage info is available by running command `run_tests.sh -h`.
    It is possible to run just selected tests by running
      `run_tests.sh -t selected_tests.py`.
    Integration tests require correctly set up.
    Removed fabfile and fabric requirement.

    DocImpact
    Closes-Bug: #1404892
    Change-Id: I8dbe2561aba655e698932bb7bb7c2f6f9887f9d7

Changed in fuel:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-ostf (stable/6.0)

Fix proposed to branch: stable/6.0
Review: https://review.openstack.org/161533

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on fuel-ostf (stable/6.0)

Change abandoned by Dmitry Pyzhov (<email address hidden>) on branch: stable/6.0
Review: https://review.openstack.org/161533

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.