.tripleo/history created when running unit tests

Bug #1704380 reported by Julie Pichon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
Medium
Julie Pichon

Bug Description

Running the python-tripleoclient unit tests results in a .tripleo/history file being created and left on the system. It also seems to make a test fail with py35 sometimes, though I haven't been able to reproduce consistently, maybe it was a fluke:

======================================================================
FAIL: tripleoclient.tests.v1.overcloud_deploy.test_overcloud_deploy.TestDeployOvercloud.test_tht_deploy_with_plan_environment_file
tags: worker-1
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jpichon/devel/python-tripleoclient/tripleoclient/utils.py", line 72, in store_cli_param
    os.mkdir(history_path)
FileExistsError: [Errno 17] File exists: '/home/jpichon/.tripleo'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/jpichon/devel/python-tripleoclient/.tox/py35/lib/python3.5/site-packages/mock/mock.py", line 1305, in patched
    return func(*args, **keywargs)
  File "/home/jpichon/devel/python-tripleoclient/tripleoclient/tests/v1/overcloud_deploy/test_overcloud_deploy.py", line 390, in test_tht_deploy_with_plan_environment_file
    self.cmd.take_action(parsed_args)
  File "/home/jpichon/devel/python-tripleoclient/tripleoclient/v1/overcloud_deploy.py", line 806, in take_action
    utils.store_cli_param(parsed_args)
  File "/home/jpichon/devel/python-tripleoclient/tripleoclient/utils.py", line 76, in store_cli_param
    raise OSError(messages)
OSError: Unable to create TripleO history directory:

Regardless, we should probably mock the file creation calls and avoid creating and leaving files on the system when running unit tests.

Changed in tripleo:
milestone: pike-3 → pike-rc1
Changed in tripleo:
milestone: pike-rc1 → queens-1
Changed in tripleo:
milestone: queens-1 → queens-2
Changed in tripleo:
milestone: queens-2 → queens-3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to python-tripleoclient (master)

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

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

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

Changed in tripleo:
assignee: nobody → Julie Pichon (jpichon)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to python-tripleoclient (master)

Reviewed: https://review.openstack.org/521057
Committed: https://git.openstack.org/cgit/openstack/python-tripleoclient/commit/?id=51a5eb928c3c0c0ea7d216c0a03dda1af6b07068
Submitter: Zuul
Branch: master

commit 51a5eb928c3c0c0ea7d216c0a03dda1af6b07068
Author: Julie Pichon <email address hidden>
Date: Fri Nov 17 10:34:53 2017 +0000

    Fix truncated error message

    The second part of the message with the error details would never get
    displayed.

    Change-Id: Id1725d6d0028aab907263c1d867d64bb15df77f1
    Related-Bug: #1704380
    Related-Bug: #1732751

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to python-tripleoclient (stable/pike)

Related fix proposed to branch: stable/pike
Review: https://review.openstack.org/521813

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

Reviewed: https://review.openstack.org/521065
Committed: https://git.openstack.org/cgit/openstack/python-tripleoclient/commit/?id=176349dd3d3dcb2990e5f4afdb56736f18fd823d
Submitter: Zuul
Branch: master

commit 176349dd3d3dcb2990e5f4afdb56736f18fd823d
Author: Julie Pichon <email address hidden>
Date: Fri Nov 17 11:27:39 2017 +0000

    Mock creation of ~/.tripleo directory

    It's already specifically tested in test_utils.py and was leaving
    ~/.tripleo directories on developer machines after running the
    tests. Randomly failing to create the directory would also sometime
    cause other unit tests to fail.

    Change-Id: I54c5dfd98a71c2544215ececc61d28cbd17218a6
    Closes-Bug: #1732751
    Closes-Bug: #1704380

Changed in tripleo:
status: In Progress → Fix Released
tags: added: in-stable-pike
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to python-tripleoclient (stable/pike)

Reviewed: https://review.openstack.org/521813
Committed: https://git.openstack.org/cgit/openstack/python-tripleoclient/commit/?id=2539361403ccc98344631d8bae2a3abcc990ed7a
Submitter: Zuul
Branch: stable/pike

commit 2539361403ccc98344631d8bae2a3abcc990ed7a
Author: Julie Pichon <email address hidden>
Date: Fri Nov 17 10:34:53 2017 +0000

    Fix truncated error message

    The second part of the message with the error details would never get
    displayed.

    Change-Id: Id1725d6d0028aab907263c1d867d64bb15df77f1
    Related-Bug: #1704380
    Related-Bug: #1732751
    (cherry picked from commit 51a5eb928c3c0c0ea7d216c0a03dda1af6b07068)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-tripleoclient (stable/pike)

Fix proposed to branch: stable/pike
Review: https://review.openstack.org/522188

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-tripleoclient (stable/pike)

Reviewed: https://review.openstack.org/522188
Committed: https://git.openstack.org/cgit/openstack/python-tripleoclient/commit/?id=dfc4e9989675046572e2cd68e42d8066eaada576
Submitter: Zuul
Branch: stable/pike

commit dfc4e9989675046572e2cd68e42d8066eaada576
Author: Julie Pichon <email address hidden>
Date: Fri Nov 17 11:27:39 2017 +0000

    Mock creation of ~/.tripleo directory

    It's already specifically tested in test_utils.py and was leaving
    ~/.tripleo directories on developer machines after running the
    tests. Randomly failing to create the directory would also sometime
    cause other unit tests to fail.

    Change-Id: I54c5dfd98a71c2544215ececc61d28cbd17218a6
    Closes-Bug: #1732751
    Closes-Bug: #1704380
    (cherry picked from commit 176349dd3d3dcb2990e5f4afdb56736f18fd823d)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-tripleoclient 8.1.0

This issue was fixed in the openstack/python-tripleoclient 8.1.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-tripleoclient 7.3.6

This issue was fixed in the openstack/python-tripleoclient 7.3.6 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.