Logger in fuel-qa doesn't work if fuel-qa is used as a library

Bug #1509282 reported by okosse
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Released
High
Fuel QA Team
6.1.x
Invalid
High
Fuel QA Team
7.0.x
Invalid
High
Fuel QA Team

Bug Description

If I want to use fuel-qa as a library, logger doesn't work.

Step for reproduce:
Connect fuel-qa as git submodule ( https://review.openstack.org/#/c/234281/) and run any fuel-contrail test.

Expected result:
I can see all log in terminal and log-file

Actual result:
Log-file is absent, in terminal I can see only steps:
"Create environment and set up master node ... SKIP
Prepare master node ... SKIP
Bootstrap 5 slave nodes ... SKIP
Install Contrail Plugin and create cluster ... Failure"

Tags: area-qa
okosse (okosse)
Changed in fuel:
assignee: nobody → Fuel QA Team (fuel-qa)
importance: Undecided → Critical
milestone: none → 8.0
Changed in fuel:
status: New → Confirmed
Revision history for this message
okosse (okosse) wrote :

I can get the same result, if in fuel-qa/fuelweb_test/run_tests.py in import_tests() to comment out all tests excluding one plugin test (for example contrail_plugin)

Revision history for this message
Tatyanka (tatyana-leontovich) wrote :

Alex please fix your run_test.py

Changed in fuel:
assignee: Fuel QA Team (fuel-qa) → okosse (okosse)
Revision history for this message
Nastya Urlapova (aurlapova) wrote :
Changed in fuel:
importance: Critical → High
Revision history for this message
okosse (okosse) wrote :

Tatyanka, sorry, what did you mean?

I don't understand enough fuel-qa's logic, but if I use ipdb, i can see next picture:

ipdb> from fuelweb_test import logger
ipdb> logger.info('test')
ipdb> from plugin_test import logger
ipdb> logger.info('test')
2015-10-23 14:10:46,623 - INFO <stdin>:1 -- test

There is a link from fuel-qa/fuelweb_test/__init__.py file to plugin_test/__init__.py. Another words it is the same file. But I can import it correctly only from higher folders.

We investigate this problem with Ivan Kliuk: in both case import is executed correctly.

okosse (okosse)
Changed in fuel:
assignee: okosse (okosse) → Fuel QA Team (fuel-qa)
Revision history for this message
okosse (okosse) wrote :

Each file with tests imported it itself. From fuel-qa/fuelweb_test/__init__.py. I also import from there. And so it does not work. I copied from your directory and then it works. But it works only for our tests. But, for example, when prepare_slave or deploy master node still not working

Revision history for this message
Dennis Dmitriev (ddmitriev) wrote :

Confirmed in my local environment . Logger doesn't work with fuel-qa code (even without using it as a submodule), if from import_tests() in run_test.py remove all tests except this one:

from tests.plugins.plugin_contrail import test_fuel_plugin_contrail

no longer affects: juniperopenstack
no longer affects: opencontrail
no longer affects: vmware-dvs
okosse (okosse)
Changed in fuel:
milestone: 8.0 → 7.0-updates
milestone: 7.0-updates → 8.0
Dmitry Pyzhov (dpyzhov)
tags: added: area-qa
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to fuel-plugin-contrail (stable/2.0)

Reviewed: https://review.openstack.org/239492
Committed: https://git.openstack.org/cgit/openstack/fuel-plugin-contrail/commit/?id=974981b5beb81d7d3bdf72b8a194dfd362165b10
Submitter: Jenkins
Branch: stable/2.0

commit 974981b5beb81d7d3bdf72b8a194dfd362165b10
Author: Oleksandr Kosse <email address hidden>
Date: Mon Oct 26 16:22:21 2015 +0000

    Include plugin_test to fuel-qa

    It is temporary solution.

    Change-Id: I38f9bc8cf70fb3566e56a0066b5b6310fa34ca6a
    Related-Bug: #1509282

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

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

Changed in fuel:
status: Confirmed → In Progress
Revision history for this message
Tatyanka (tatyana-leontovich) wrote :

move to invalid status for MU update according to issue is in fuel-devops and can be fixed by adding changes in logger config manually

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

Reviewed: https://review.openstack.org/241198
Committed: https://git.openstack.org/cgit/openstack/fuel-devops/commit/?id=e3073833aebec1cc032afeacabe39689d9ff11c4
Submitter: Jenkins
Branch: master

commit e3073833aebec1cc032afeacabe39689d9ff11c4
Author: Tatyana Leontovich <email address hidden>
Date: Tue Nov 3 15:39:21 2015 +0200

    Disable overriding existing loggers

    To avoid situation that devops
    logging.config overrides fuelweb_tests.logger
    setting set default value False

    Change-Id: I9eeeea20835a372221b346c6845be6f463de78c3
    Closes-Bug: #1509282

Changed in fuel:
status: In Progress → Fix Committed
Revision history for this message
Tatyanka (tatyana-leontovich) wrote :

verified by added this parameter in devops/log.yaml

Changed in fuel:
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to fuel-plugin-contrail (stable/2.0)

Related fix proposed to branch: stable/2.0
Review: https://review.openstack.org/241590

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to fuel-plugin-contrail (stable/2.0)

Reviewed: https://review.openstack.org/241590
Committed: https://git.openstack.org/cgit/openstack/fuel-plugin-contrail/commit/?id=f9f58a3fd596107c3380887588e727e01de548da
Submitter: Jenkins
Branch: stable/2.0

commit f9f58a3fd596107c3380887588e727e01de548da
Author: Oleksandr Kosse <email address hidden>
Date: Wed Nov 4 15:00:43 2015 +0200

    Return to submodules

    Change-Id: I72868c597b97a801040d493abf5f8e2392d6992a
    Related-Bug: #1509282

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.