[OSTF] Wrong discovering tests

Bug #1359728 reported by Yaroslav Lobankov
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Released
Medium
Sebastian Kalinowski

Bug Description

FUEL RELEASE - 5.1
DEPLOYMENT MODE - multi-node

If name of a test file has combination of letters "ha", all tests in this file will be added to tests for HA mode.

If name of a test class in a test file has combination of letters "ha", all tests in this class will be added to tests for HA mode.

If name of a test in a test class has combination of letters "ha", this test will be added to tests for HA mode.

For example:
There is test file "test_sanity_sahara.py" in fuel_health/tests/sanity folder. All tests in this test file are discovered by nose as tests for sanity and ha.

From ostf.log:
2014-08-21 12:34:03 INFO (nose_discovery) fuel_health.tests.sanity.test_sanity_sahara.SanitySaharaTests.test_sanity_sahara added for sanity
2014-08-21 12:34:03 INFO (nose_discovery) fuel_health.tests.sanity.test_sanity_sahara.SanitySaharaTests.test_sanity_sahara added for ha

As the result of this I can't see the sanity test for Sahara in the "Health Check" tab on Web UI in the group "Sanity tests".

If I rename test file "test_sanity_murano.py" into "test_sanity_hamurano.py", all tests in this test file will be discovered by nose as tests for sanity and ha.

From ostf.log:
2014-08-21 13:31:29 INFO (nose_discovery) fuel_health.tests.sanity.test_sanity_hamurano.MuranoSanityTests.test_create_and_delete_service added for sanity
2014-08-21 13:31:29 INFO (nose_discovery) fuel_health.tests.sanity.test_sanity_hamurano.MuranoSanityTests.test_create_and_delete_service added for ha
2014-08-21 13:31:29 INFO (nose_discovery) fuel_health.tests.sanity.test_sanity_hamurano.MuranoSanityTests.test_get_list_categories added for sanity
2014-08-21 13:31:29 INFO (nose_discovery) fuel_health.tests.sanity.test_sanity_hamurano.MuranoSanityTests.test_get_list_categories added for ha
2014-08-21 13:31:29 INFO (nose_discovery) fuel_health.tests.sanity.test_sanity_hamurano.MuranoSanityTests.test_get_list_packages added for sanity
2014-08-21 13:31:29 INFO (nose_discovery) fuel_health.tests.sanity.test_sanity_hamurano.MuranoSanityTests.test_get_list_packages added for ha

If I rename "test_sanity_sahara.py" into "test_sanity_foo.py", class "SanitySaharaTests" into "SanityFooTests" and test "test_sanity_sahara" into "test_sanity_foo", everything will be OK.

From ostf.log:
2014-08-21 14:21:51 INFO (nose_discovery) fuel_health.tests.sanity.test_sanity_compute.SanityComputeTest.test_list_volumes added for sanity
2014-08-21 14:21:51 INFO (nose_discovery) fuel_health.tests.sanity.test_sanity_foo.SanityFooTests.test_sanity_foo added for sanity
2014-08-21 14:21:51 INFO (nose_discovery) fuel_health.tests.sanity.test_sanity_heat.SanityHeatTest.test_list_stacks added for sanity

After renaming the test file (as well as the class and the test) I can see the sanity test for Sahara in the "Health Check" tab on Web UI in the group "Sanity tests".

Tags: sahara
summary: - [OSTF] Wrong discovering cd -tests
+ [OSTF] Wrong discovering tests
description: updated
Changed in fuel:
milestone: none → 6.0
importance: Undecided → Medium
assignee: nobody → Fuel Python Team (fuel-python)
Changed in fuel:
assignee: Fuel Python Team (fuel-python) → Yaroslav Lobankov (ylobankov)
tags: added: sahara
Changed in fuel:
status: New → Triaged
Artem Roma (aroma-x)
Changed in fuel:
status: Triaged → Confirmed
assignee: Yaroslav Lobankov (ylobankov) → Artem Roma (aroma-x)
Artem Roma (aroma-x)
Changed in fuel:
assignee: Artem Roma (aroma-x) → Fuel Python Team (fuel-python)
Dmitry Pyzhov (dpyzhov)
Changed in fuel:
milestone: 6.0 → 6.1
Changed in fuel:
assignee: Fuel Python Team (fuel-python) → Sebastian Kalinowski (prmtl)
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/146870

Changed in fuel:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-ostf (master)

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

commit 70ecf3b93c406d3c77bb73d8dcbda5faf8a7fbf0
Author: Sebastian Kalinowski <email address hidden>
Date: Tue Jan 13 14:51:57 2015 +0100

    Use regex to check if test belong to test set

    When discovering available tests regular expression will
    be used to check to which test set given test belongs.
    This prevent situation when 'test_sanity_sahara' was
    assigned to 'ha' test set because of occurrence of this words in
    'sahara'

    Change-Id: If7366da29da17404af3564e031e47e7ab39ba826
    Closes-Bug: #1359728

Changed in fuel:
status: In Progress → Fix Committed
Changed in fuel:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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