Functional tests should not use environment variables

Bug #1479954 reported by Terry Howe
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-openstackclient
Won't Fix
Low
Vincent Legoll

Bug Description

Functional tests should probably not use environment variables at all. An environment variable set in one test may effect another test and it may be different to detect that there is a problem. Right now we are setting OS_VOLUME_API_VERSION=1, but if that same environmebnt is used to run a v2 test after that, it will run v1 and we might never know. I would think that using the --os-volume-api-version.

Tags: test
Changed in python-openstackclient:
status: New → Confirmed
importance: Undecided → Medium
importance: Medium → Low
tags: added: test
asingh (aradhana1-singh)
Changed in python-openstackclient:
assignee: nobody → asingh (aradhana1-singh)
Revision history for this message
Vincent Legoll (vincent-legoll) wrote :

Maybe still allow env. vars usage for tests, but ensure that a clean env is given to each test (fixture ?)

Revision history for this message
Steve Martinelli (stevemar) wrote :

Unassigning due to inactivity.

Vincent, yes, ideally a fixture would be used instead.

Changed in python-openstackclient:
assignee: asingh (aradhana1-singh) → nobody
status: Confirmed → Triaged
Revision history for this message
Vincent Legoll (vincent-legoll) wrote :

@stevemar: would this be worth working on ?

I ask because, I recently added an env var to cliff with tests that are fixturized with
@mock.patch.dict(os.environ, {'XXX_ENV_VAR': 'YYY_VAL'})

If this is worthwhile, I can dig through code and fix what I can find...

looks like parts of it are already fixtures : openstackclient/tests/test_shell.py
but others may miss a tearDownClass(), like functional/tests/volume/v1/common.py

Is that the way to fix this ?

Revision history for this message
Vincent Legoll (vincent-legoll) wrote :

Here is a patch for the cases I found, if this is the way to go, I'll put that through gerrit...

Revision history for this message
Vincent Legoll (vincent-legoll) wrote :

Patch on gerrit for review:
https://review.openstack.org/#/c/333807/

Changed in python-openstackclient:
assignee: nobody → Vincent Legoll (vincent-legoll)
Changed in python-openstackclient:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on python-openstackclient (master)

Change abandoned by Vincent Legoll (<email address hidden>) on branch: master
Review: https://review.openstack.org/333807
Reason: not enough time

Artem Goncharov (gtema)
Changed in python-openstackclient:
status: In Progress → Won't Fix
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.