feature-flag experimental module metadata (#85351)

* added ansible-test integration env/set directive for aliases
* applied to module-serialization-profiles test to enable feature flag

Co-authored-by: Matt Clay <matt@mystile.com>
(cherry picked from commit 46abcfcc82)
This commit is contained in:
Matt Davis
2025-06-24 15:18:16 -07:00
committed by Matt Clay
parent 39ed1fc4bc
commit 03dc8c4260
8 changed files with 33 additions and 4 deletions
@@ -1 +1,3 @@
context/controller
env/set/A_VAR/something
env/set/A_PATH//an/absolute/path
@@ -5,3 +5,5 @@
- assert:
that:
- hello.message == 'Hello Ansibull'
- lookup('env', 'A_VAR') == 'something'
- lookup('env', 'A_PATH') == '/an/absolute/path'
@@ -1,2 +1,3 @@
context/target
shippable/posix/group1
env/set/_ANSIBLE_MODULE_METADATA/1
@@ -825,6 +825,7 @@ def integration_environment(
env.update(ANSIBLE_TEST_REMOTE_INTERPRETER='')
env.update(integration)
env.update(target.env_set)
return env
@@ -582,6 +582,14 @@ class IntegrationTarget(CompletionTarget):
else:
static_aliases = tuple()
# non-group aliases which need to be extracted before group mangling occurs
self.env_set: dict[str, str] = {
match.group('key'): match.group('value') for match in (
re.match(r'env/set/(?P<key>[^/]+)/(?P<value>.*)', alias) for alias in static_aliases
) if match
}
# modules
if self.name in modules: