Fix: do not lose the tox_environment value in func tests

The current code always overrides tox_environment when running
functional tests, but the correct behavior is to add
the discovered environment variables to tox_environments,
while keeping the user-specified value for it.

The current behavior breaks the devstack-tox-functional children
jobs, like openstacksdk-functional-devstack-ironic, which set
tox_environment.

Change-Id: I5dc9054a1495ca0ef7745c08316441ab153956f4
This commit is contained in:
Luigi Toscano 2020-10-11 21:59:07 +02:00
parent 8e74a617df
commit 906d824a19
4 changed files with 5 additions and 6 deletions

View File

@ -8,5 +8,4 @@
- test-setup
- ensure-tox
- get-devstack-os-environment
- role: tox
tox_environment: "{{ os_env_vars|default({}) }}"
- tox

View File

@ -1,5 +1,4 @@
- hosts: all
roles:
- get-devstack-os-environment
- role: tox
tox_environment: "{{ os_env_vars|default({}) }}"
- tox

View File

@ -3,3 +3,4 @@ openrc_file: "{{ devstack_base_dir }}/devstack/openrc"
openrc_user: admin
openrc_project: admin
openrc_enable_export: false
tox_environment: {}

View File

@ -9,6 +9,6 @@
executable: "/bin/bash"
register: env_os
- name: Save the OS_ environment variables as a fact
- name: Append the the OS_ environment variables to tox_environment
set_fact:
os_env_vars: "{{ env_os.stdout|from_yaml }}"
tox_environment: "{{ env_os.stdout|from_yaml|default({})|combine(tox_environment) }}"