Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly update environment from the importing plan #2452

Merged
merged 1 commit into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion tests/plan/import/modify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ rlJournalStart
rlPhaseStartTest "Show importing plan (modify imported plan)"
rlRun -s "tmt plan show ${importing}"
rlAssertGrep 'test "foobar" == "foobar"' $rlRun_LOG
rlAssertGrep 'environment VARIABLE: foobar' $rlRun_LOG
rlPhaseEnd

rlPhaseStartTest "Run plan ${importing}"
rlRun -s "tmt run -vv plan --name ${importing}" 0 "Run plan ${importing}"
rlRun -s "tmt run -dddvv plan --name ${importing}" 0 "Run plan ${importing}"
rlAssertGrep 'cmd: test "foobar" == "foobar"' $rlRun_LOG
rlAssertGrep "summary: 1 test passed" $rlRun_LOG
rlAssertGrep "VARIABLE: foobar" $rlRun_LOG
rlPhaseEnd

rlPhaseStartCleanup
Expand Down
3 changes: 3 additions & 0 deletions tmt/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1678,6 +1678,9 @@ def environment(self) -> EnvironmentType:
if self.my_run:
combined = self._plan_environment.copy()
combined.update(self._environment)
# Include environment of the importing plan
if self._original_plan is not None:
combined.update(self._original_plan.environment)
# Command line variables take precedence
combined.update(self.my_run.environment)
# Include path to the plan data directory
Expand Down
Loading