diff --git a/ansible_navigator/actions/collections.py b/ansible_navigator/actions/collections.py index dee3dabe4..a124ee47d 100644 --- a/ansible_navigator/actions/collections.py +++ b/ansible_navigator/actions/collections.py @@ -3,8 +3,9 @@ import json import os import shlex -import subprocess +import sys +from copy import deepcopy from json.decoder import JSONDecodeError from typing import Any @@ -17,6 +18,7 @@ from ..app import App from ..app_public import AppPublic from ..configuration_subsystem import ApplicationConfiguration +from ..runner.api import CommandRunner from ..steps import Step from ..ui_framework import CursesLinePart @@ -113,12 +115,7 @@ def run(self, interaction: Interaction, app: AppPublic) -> Union[Interaction, No [self._name] + shlex.split(self._interaction.action.match.groupdict()["params"] or "") ) - if self._args.execution_environment: - self._logger.debug("running execution environment") - self._try_ee() - else: - self._logger.debug("running local") - self._try_local() + self._run_runner() if not self._collections: self._prepare_to_exit(interaction) @@ -247,78 +244,74 @@ def _build_plugin_content(self): index=self.steps.current.index, ) - def _try_ee(self) -> None: - """run collection catalog in ee""" + def _run_runner(self) -> None: + """spin up runner""" + + if isinstance(self._args.set_environment_variable, dict): + set_environment_variable = deepcopy(self._args.set_environment_variable) + else: + set_environment_variable = {} + set_environment_variable.update({"ANSIBLE_NOCOLOR": "True"}) + + kwargs = { + "container_engine": self._args.container_engine, + "execution_environment_image": self._args.execution_environment_image, + "execution_environment": self._args.execution_environment, + "navigator_mode": "interactive", + "pass_environment_variable": self._args.pass_environment_variable, + "set_environment_variable": set_environment_variable, + } + if isinstance(self._args.playbook, str): playbook_dir = os.path.dirname(self._args.playbook) else: playbook_dir = os.getcwd() - self._adjacent_collection_dir = playbook_dir + "/collections" - - cmd = [self._args.container_engine, "run", "-i", "-t"] + kwargs.update({"cwd": playbook_dir}) + self._adjacent_collection_dir = os.path.join(playbook_dir, "collections") share_directory = self._args.internals.share_directory - cmd += [ - "-v", - f"{share_directory}/utils:{share_directory}/utils:z", + + pass_through_arg = [ + f"{share_directory}/utils/catalog_collections.py", + "-a", + self._adjacent_collection_dir, + "-c", + self._collection_cache_path, ] - if os.path.exists(self._adjacent_collection_dir): - cmd += ["-v", f"{self._adjacent_collection_dir}:{self._adjacent_collection_dir}:z"] + kwargs.update({"cmdline": pass_through_arg}) - cmd += ["-v", f"{self._collection_cache_path}:{self._collection_cache_path}:z"] + if self._args.execution_environment: + self._logger.debug("running collections command with execution environment enabled") + python_exec_path = "python3" - cmd += [self._args.execution_environment_image] - cmd += ["python3", f"{self._args.internals.share_directory}/utils/catalog_collections.py"] - cmd += ["-a", self._adjacent_collection_dir] - cmd += ["-c", self._collection_cache_path] + container_volume_mounts = [f"{share_directory}/utils:{share_directory}/utils:z"] + if os.path.exists(self._adjacent_collection_dir): + container_volume_mounts.append( + f"{self._adjacent_collection_dir}:{self._adjacent_collection_dir}:z" + ) - self._logger.debug("ee command: %s", " ".join(cmd)) - self._dispatch(cmd) + container_volume_mounts.append( + f"{self._collection_cache_path}:{self._collection_cache_path}:z" + ) + kwargs.update({"container_volume_mounts": container_volume_mounts}) - def _try_local(self) -> None: - """run config locally""" - if isinstance(self._args.playbook, str): - playbook_dir = os.path.dirname(self._args.playbook) else: - playbook_dir = os.getcwd() + self._logger.debug("running collections command locally") + python_exec_path = sys.executable - adjacent_collection_dir = playbook_dir + "/collections" - - cmd = ["python3", f"{self._args.internals.share_directory}/utils/catalog_collections.py"] - cmd += ["-a", adjacent_collection_dir] - cmd += ["-c", self._collection_cache_path] - self._logger.debug("local command: %s", " ".join(cmd)) - self._dispatch(cmd) - - def _dispatch(self, cmd: List[str]) -> None: - """run the individual config commands and parse""" - output = self._run_command(cmd) - if output is None: - return None - self._parse(output) - return None - - def _run_command(self, cmd) -> Union[None, subprocess.CompletedProcess]: - """run a command""" - try: - proc_out = subprocess.run( - " ".join(cmd), - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - check=True, - universal_newlines=True, - shell=True, - ) - self._logger.debug("cmd output %s", proc_out.stdout[0:100].replace("\n", " ") + "<...>") - return proc_out + self._logger.debug( + f"Invoke runner with executable_cmd: {python_exec_path}" + f" and kwargs: {kwargs}" + ) + _runner = CommandRunner(executable_cmd=python_exec_path, **kwargs) + output, error = _runner.run() - except subprocess.CalledProcessError as exc: - self._logger.debug("command execution failed: '%s'", str(exc)) - self._logger.debug("command execution failed: '%s'", exc.output) - self._logger.debug("command execution failed: '%s'", exc.stderr) - return None + if error: + msg = f"Error while running catalog collection script: {error}" + self._logger.error(msg) + if output: + self._parse(output) def _parse(self, output) -> None: """yaml load the list, and parse the dump @@ -326,17 +319,17 @@ def _parse(self, output) -> None: """ # pylint: disable=too-many-branches try: - if not output.stdout.startswith("{"): - _warnings, json_str = output.stdout.split("{", 1) + if not output.startswith("{"): + _warnings, json_str = output.split("{", 1) json_str = "{" + json_str else: - json_str = output.stdout + json_str = output parsed = json.loads(json_str) self._logger.debug("json loading output succeeded") except (JSONDecodeError, ValueError) as exc: self._logger.error("Unable to extract collection json from stdout") self._logger.debug("error json loading output: '%s'", str(exc)) - self._logger.debug(output.stdout) + self._logger.debug(output) return None for error in parsed["errors"]: @@ -352,11 +345,32 @@ def _parse(self, output) -> None: if self._args.execution_environment: if collection["path"].startswith(self._adjacent_collection_dir): collection["__type"] = "bind_mount" + elif collection["path"].startswith(os.path.dirname(self._adjacent_collection_dir)): + collection["__type"] = "bind_mount" + error = ( + f"{collection['known_as']} was mounted and catalogued in the" + " execution environment but was outside the adjacent 'collections'" + " directory. This may cause issues outside the local development" + " environment." + ) + self._logger.error(error) else: collection["__type"] = "contained" self._stats = parsed["stats"] + if parsed.get("messages"): + for msg in parsed["messages"]: + self._logger.info("[catalog_collections]: %s", msg) + + self._logger.debug("catalog collections scan path: %s", parsed["collection_scan_paths"]) for stat, value in self._stats.items(): self._logger.debug("%s: %s", stat, value) + + if not parsed["collections"]: + env = "execution" if self._args.execution_environment else "local" + error = f"No collections found in {env} environment, searched in " + error += parsed["collection_scan_paths"] + self._logger.warning(error) + return None diff --git a/share/ansible_navigator/utils/catalog_collections.py b/share/ansible_navigator/utils/catalog_collections.py index 0c8767470..25ce54859 100644 --- a/share/ansible_navigator/utils/catalog_collections.py +++ b/share/ansible_navigator/utils/catalog_collections.py @@ -32,7 +32,7 @@ from key_value_store import KeyValueStore # type: ignore -PROCESSES = multiprocessing.cpu_count() - 1 +PROCESSES = (multiprocessing.cpu_count() - 1) or 1 class CollectionCatalog: @@ -43,6 +43,7 @@ def __init__(self, directories: List[str]): self._directories = directories self._collections: OrderedDict[str, Dict] = OrderedDict() self._errors: List[Dict[str, str]] = [] + self._messages: List[str] = [] def _catalog_plugins(self, collection: Dict) -> None: """catalog the plugins within a collection""" @@ -150,6 +151,12 @@ def _one_path(self, directory: str) -> None: self._errors.append({"path": runtime_file, "error": str(exc)}) self._collections[collection["path"]] = collection + else: + msg = ( + f"collection path '{directory_path}' is ignored as it does not" + " have 'MANIFEST.json' and/or 'galaxy.yml' file(s)." + ) + self._messages.append(msg) def _find_shadows(self) -> None: """for each collection, determin which other collections are hiding it""" @@ -339,7 +346,8 @@ def main() -> Dict: stats["cache_added_success"] = 0 stats["cache_added_errors"] = 0 - collections, errors = CollectionCatalog(directories=parent_directories).process_directories() + cc_obj = CollectionCatalog(directories=parent_directories) + collections, errors = cc_obj.process_directories() stats["collection_count"] = len(collections) collection_cache_path = os.path.abspath(os.path.expanduser(args.collection_cache_path)) @@ -361,7 +369,12 @@ def main() -> Dict: del collection["plugin_chksums"][no_doc] collection_cache.close() - return {"collections": collections, "errors": errors, "stats": stats} + return { + "collections": collections, + "errors": errors, + "stats": stats, + "messages": cc_obj._messages, + } if __name__ == "__main__": @@ -375,8 +388,10 @@ def main() -> Dict: args, parent_directories = parse_args() - os.environ["ANSIBLE_COLLECTIONS_PATHS"] = ":".join(parent_directories) + collection_scan_paths = ":".join(parent_directories) + os.environ["ANSIBLE_COLLECTIONS_PATHS"] = collection_scan_paths result = main() result["stats"]["duration"] = (datetime.now() - start_time).total_seconds() + result["collection_scan_paths"] = collection_scan_paths print(json.dumps(result, default=str)) diff --git a/tests/fixtures/common/collections/ansible_collections/testorg/coll_1/galaxy.yml b/tests/fixtures/common/collections/ansible_collections/testorg/coll_1/galaxy.yml new file mode 100644 index 000000000..122124cb9 --- /dev/null +++ b/tests/fixtures/common/collections/ansible_collections/testorg/coll_1/galaxy.yml @@ -0,0 +1,8 @@ +--- +authors: + - Ansible team (ansible-navigator) +license_file: LICENSE +name: coll_1 +namespace: testorg +readme: README.md +version: 1.0.0 diff --git a/tests/fixtures/common/collections/ansible_collections/testorg/coll_2/galaxy.yml b/tests/fixtures/common/collections/ansible_collections/testorg/coll_2/galaxy.yml new file mode 100644 index 000000000..cb6159663 --- /dev/null +++ b/tests/fixtures/common/collections/ansible_collections/testorg/coll_2/galaxy.yml @@ -0,0 +1,8 @@ +--- +authors: + - Ansible team (ansible-navigator) +license_file: LICENSE +name: coll_2 +namespace: testorg +readme: README.md +version: 2.0.0 diff --git a/tests/fixtures/common/collections/ansible_collections/testorg/coll_2/plugins/lookup/lookup_2.py b/tests/fixtures/common/collections/ansible_collections/testorg/coll_2/plugins/lookup/lookup_2.py new file mode 100644 index 000000000..f8cab75fb --- /dev/null +++ b/tests/fixtures/common/collections/ansible_collections/testorg/coll_2/plugins/lookup/lookup_2.py @@ -0,0 +1,42 @@ +""" +The get_path lookup plugin +""" +from __future__ import absolute_import, division, print_function + +__metaclass__ = type + + +DOCUMENTATION = """ + name: lookup_2 + author: test + plugin_type: lookup + version_added: "2.0.0" + short_description: This is test lookup plugin + description: + - This is test lookup plugin + options: + foo: + description: + - Dummy option I(foo) + type: str + required: True + bar: + description: + - Dummy option I(bar) + default: candidate + type: str + notes: + - This is a dummy lookup plugin + """ + +EXAMPLES = """ + - name: Retrieve a value deep inside a using a path + ansible.builtin.set_fact: + value: "{{ lookup('testorg.coll_2.lookup_2', var1, var2) }}" + """ + +RETURN = """ + _raw: + description: + - One or more zero-based indices of the matching list items. + """ diff --git a/tests/fixtures/common/collections/ansible_collections/testorg/coll_2/plugins/modules/mod_2.py b/tests/fixtures/common/collections/ansible_collections/testorg/coll_2/plugins/modules/mod_2.py new file mode 100644 index 000000000..0f86f3c90 --- /dev/null +++ b/tests/fixtures/common/collections/ansible_collections/testorg/coll_2/plugins/modules/mod_2.py @@ -0,0 +1,46 @@ +from __future__ import absolute_import, division, print_function + +__metaclass__ = type + + +DOCUMENTATION = """ +module: mod_2 +author: +- test +short_description: This is a test module +description: +- This is a test module +version_added: 2.0.0 +options: + foo: + description: + - Dummy option I(foo) + type: str + bar: + description: + - Dummy option I(bar) + default: candidate + type: str + choices: + - candidate + - running + aliases: + - bam +notes: +- This is a dummy module +""" + +EXAMPLES = """ +- name: test task-1 + testorg.coll_2.mod_2: + foo: somevalue + bar: candidate +""" + +RETURN = """ +baz: + description: test return 1 + returned: success + type: list + sample: ['a','b'] +""" diff --git a/tests/fixtures/integration/actions/collections/test_direct_interactive_ee.py/test/0.json b/tests/fixtures/integration/actions/collections/test_direct_interactive_ee.py/test/0.json new file mode 100644 index 000000000..1ce6f264e --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_direct_interactive_ee.py/test/0.json @@ -0,0 +1,11 @@ +{ + "name": "test[0-ansible-navigator collections --execution-environment true --ce docker-ansible-navigator collections browse window-Collecting collection content]", + "index": 0, + "comment": "ansible-navigator collections browse window", + "output": [ + " NAME VERSION SHADOWED TYPE PATH", + "0│testorg.coll_1 1.0.0 False bind_mount FIXTURES_COLLECTION_DIR/test_direct_interactive_ee.py/collections/ansible_collections/testorg/coll_1/", + "1│testorg.coll_2 2.0.0 False bind_mount FIXTURES_COLLECTION_DIR/test_direct_interactive_ee.py/collections/ansible_collections/testorg/coll_2/", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_direct_interactive_ee.py/test/1.json b/tests/fixtures/integration/actions/collections/test_direct_interactive_ee.py/test/1.json new file mode 100644 index 000000000..fb5e6e254 --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_direct_interactive_ee.py/test/1.json @@ -0,0 +1,11 @@ +{ + "name": "test[1-:0-Browse testorg.coll_1 plugins window-None]", + "index": 1, + "comment": "Browse testorg.coll_1 plugins window", + "output": [ + " TESTORG.COLL 1 TYPE ADDED DEPRECATED DESCRIPTION", + "0│lookup_1 lookup 1.0.0 False This is test lookup plugin", + "1│mod_1 module 1.0.0 False This is a test module", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_direct_interactive_ee.py/test/10.json b/tests/fixtures/integration/actions/collections/test_direct_interactive_ee.py/test/10.json new file mode 100644 index 000000000..5a0286a2f --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_direct_interactive_ee.py/test/10.json @@ -0,0 +1,62 @@ +{ + "name": "test[10-:1-mod_2 plugin docs window-None]", + "index": 10, + "comment": "mod_2 plugin docs window", + "output": [ + "TESTORG.COLL_2.MOD_2: This is a test module", + " 0│---", + " 1│additional_information: {}", + " 2│collection_info:", + " 3│ authors:", + " 4│ - Ansible team (ansible-navigator)", + " 5│ license_file: LICENSE", + " 6│ name: testorg.coll_2", + " 7│ namespace: testorg", + " 8│ path: FIXTURES_COLLECTION_DIR/test_direct_interactive_ee.py/collections/ansible_collections/testorg/coll_2/", + " 9│ readme: README.md", + "10│ shadowed_by: []", + "11│ version: 2.0.0", + "12│doc:", + "13│ author:", + "14│ - test", + "15│ description:", + "16│ - This is a test module", + "17│ module: mod_2", + "18│ notes:", + "19│ - This is a dummy module", + "20│ options:", + "21│ bar:", + "22│ aliases:", + "23│ - bam", + "24│ choices:", + "25│ - candidate", + "26│ - running", + "27│ default: candidate", + "28│ description:", + "29│ - Dummy option I(bar)", + "30│ type: str", + "31│ foo:", + "32│ description:", + "33│ - Dummy option I(foo)", + "34│ type: str", + "35│ short_description: This is a test module", + "36│ version_added: 2.0.0", + "37│ version_added_collection: testorg.coll_2", + "38│examples: |-", + "39│ - name: test task-1", + "40│ testorg.coll_2.mod_2:", + "41│ foo: somevalue", + "42│ bar: candidate", + "43│full_name: testorg.coll_2.mod_2", + "44│metadata: null", + "45│returndocs:", + "46│ baz:", + "47│ description: test return 1", + "48│ returned: success", + "49│ sample:", + "50│ - a", + "51│ - b", + "52│ type: list", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back + previous - next [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_direct_interactive_ee.py/test/11.json b/tests/fixtures/integration/actions/collections/test_direct_interactive_ee.py/test/11.json new file mode 100644 index 000000000..7ef8de708 --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_direct_interactive_ee.py/test/11.json @@ -0,0 +1,11 @@ +{ + "name": "test[11-:back-Back to browse testorg.coll_2 plugins window-None]", + "index": 11, + "comment": "Back to browse testorg.coll_2 plugins window", + "output": [ + " TESTORG.COLL 2 TYPE ADDED DEPRECATED DESCRIPTION", + "0│lookup_2 lookup 2.0.0 False This is test lookup plugin", + "1│mod_2 module 2.0.0 False This is a test module", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_direct_interactive_ee.py/test/12.json b/tests/fixtures/integration/actions/collections/test_direct_interactive_ee.py/test/12.json new file mode 100644 index 000000000..99c9c823a --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_direct_interactive_ee.py/test/12.json @@ -0,0 +1,11 @@ +{ + "name": "test[12-:back-Back to ansible-navigator collections browse window-None]", + "index": 12, + "comment": "Back to ansible-navigator collections browse window", + "output": [ + " NAME VERSION SHADOWED TYPE PATH", + "0│testorg.coll_1 1.0.0 False bind_mount FIXTURES_COLLECTION_DIR/test_direct_interactive_ee.py/collections/ansible_collections/testorg/coll_1/", + "1│testorg.coll_2 2.0.0 False bind_mount FIXTURES_COLLECTION_DIR/test_direct_interactive_ee.py/collections/ansible_collections/testorg/coll_2/", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_direct_interactive_ee.py/test/2.json b/tests/fixtures/integration/actions/collections/test_direct_interactive_ee.py/test/2.json new file mode 100644 index 000000000..c2f9c2798 --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_direct_interactive_ee.py/test/2.json @@ -0,0 +1,53 @@ +{ + "name": "test[2-:0-lookup_1 plugin docs window-None]", + "index": 2, + "comment": "lookup_1 plugin docs window", + "output": [ + "TESTORG.COLL_1.LOOKUP_1: This is test lookup plugin", + " 0│---", + " 1│additional_information: {}", + " 2│collection_info:", + " 3│ authors:", + " 4│ - Ansible team (ansible-navigator)", + " 5│ license_file: LICENSE", + " 6│ name: testorg.coll_1", + " 7│ namespace: testorg", + " 8│ path: FIXTURES_COLLECTION_DIR/test_direct_interactive_ee.py/collections/ansible_collections/testorg/coll_1/", + " 9│ readme: README.md", + "10│ shadowed_by: []", + "11│ version: 1.0.0", + "12│doc:", + "13│ author: test", + "14│ description:", + "15│ - This is test lookup plugin", + "16│ name: lookup_1", + "17│ notes:", + "18│ - This is a dummy lookup plugin", + "19│ options:", + "20│ bar:", + "21│ default: candidate", + "22│ description:", + "23│ - Dummy option I(bar)", + "24│ type: str", + "25│ foo:", + "26│ description:", + "27│ - Dummy option I(foo)", + "28│ required: true", + "29│ type: str", + "30│ plugin_type: lookup", + "31│ short_description: This is test lookup plugin", + "32│ version_added: 1.0.0", + "33│ version_added_collection: testorg.coll_1", + "34│examples: |-", + "35│ - name: Retrieve a value deep inside a using a path", + "36│ ansible.builtin.set_fact:", + "37│ value: \"{{ lookup('testorg.coll_1.lookup_1', var1, var2) }}\"", + "38│full_name: testorg.coll_1.lookup_1", + "39│metadata: null", + "40│returndocs:", + "41│ _raw:", + "42│ description:", + "43│ - One or more zero-based indices of the matching list items.", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back + previous - next [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_direct_interactive_ee.py/test/3.json b/tests/fixtures/integration/actions/collections/test_direct_interactive_ee.py/test/3.json new file mode 100644 index 000000000..b392387b8 --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_direct_interactive_ee.py/test/3.json @@ -0,0 +1,11 @@ +{ + "name": "test[3-:back-Back to browse testorg.coll_1 plugins window-None]", + "index": 3, + "comment": "Back to browse testorg.coll_1 plugins window", + "output": [ + " TESTORG.COLL 1 TYPE ADDED DEPRECATED DESCRIPTION", + "0│lookup_1 lookup 1.0.0 False This is test lookup plugin", + "1│mod_1 module 1.0.0 False This is a test module", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_direct_interactive_ee.py/test/4.json b/tests/fixtures/integration/actions/collections/test_direct_interactive_ee.py/test/4.json new file mode 100644 index 000000000..81692d05d --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_direct_interactive_ee.py/test/4.json @@ -0,0 +1,62 @@ +{ + "name": "test[4-:1-mod_1 plugin docs window-None]", + "index": 4, + "comment": "mod_1 plugin docs window", + "output": [ + "TESTORG.COLL_1.MOD_1: This is a test module", + " 0│---", + " 1│additional_information: {}", + " 2│collection_info:", + " 3│ authors:", + " 4│ - Ansible team (ansible-navigator)", + " 5│ license_file: LICENSE", + " 6│ name: testorg.coll_1", + " 7│ namespace: testorg", + " 8│ path: FIXTURES_COLLECTION_DIR/test_direct_interactive_ee.py/collections/ansible_collections/testorg/coll_1/", + " 9│ readme: README.md", + "10│ shadowed_by: []", + "11│ version: 1.0.0", + "12│doc:", + "13│ author:", + "14│ - test", + "15│ description:", + "16│ - This is a test module", + "17│ module: mod_1", + "18│ notes:", + "19│ - This is a dummy module", + "20│ options:", + "21│ bar:", + "22│ aliases:", + "23│ - bam", + "24│ choices:", + "25│ - candidate", + "26│ - running", + "27│ default: candidate", + "28│ description:", + "29│ - Dummy option I(bar)", + "30│ type: str", + "31│ foo:", + "32│ description:", + "33│ - Dummy option I(foo)", + "34│ type: str", + "35│ short_description: This is a test module", + "36│ version_added: 1.0.0", + "37│ version_added_collection: testorg.coll_1", + "38│examples: |-", + "39│ - name: test task-1", + "40│ testorg.coll_1.mod_1:", + "41│ foo: somevalue", + "42│ bar: candidate", + "43│full_name: testorg.coll_1.mod_1", + "44│metadata: null", + "45│returndocs:", + "46│ baz:", + "47│ description: test return 1", + "48│ returned: success", + "49│ sample:", + "50│ - a", + "51│ - b", + "52│ type: list", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back + previous - next [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_direct_interactive_ee.py/test/5.json b/tests/fixtures/integration/actions/collections/test_direct_interactive_ee.py/test/5.json new file mode 100644 index 000000000..915999e72 --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_direct_interactive_ee.py/test/5.json @@ -0,0 +1,11 @@ +{ + "name": "test[5-:back-Back to browse testorg.coll_1 plugins window-None]", + "index": 5, + "comment": "Back to browse testorg.coll_1 plugins window", + "output": [ + " TESTORG.COLL 1 TYPE ADDED DEPRECATED DESCRIPTION", + "0│lookup_1 lookup 1.0.0 False This is test lookup plugin", + "1│mod_1 module 1.0.0 False This is a test module", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_direct_interactive_ee.py/test/6.json b/tests/fixtures/integration/actions/collections/test_direct_interactive_ee.py/test/6.json new file mode 100644 index 000000000..097d0f9b1 --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_direct_interactive_ee.py/test/6.json @@ -0,0 +1,11 @@ +{ + "name": "test[6-:back-Back to ansible-navigator collections browse window-None]", + "index": 6, + "comment": "Back to ansible-navigator collections browse window", + "output": [ + " NAME VERSION SHADOWED TYPE PATH", + "0│testorg.coll_1 1.0.0 False bind_mount FIXTURES_COLLECTION_DIR/test_direct_interactive_ee.py/collections/ansible_collections/testorg/coll_1/", + "1│testorg.coll_2 2.0.0 False bind_mount FIXTURES_COLLECTION_DIR/test_direct_interactive_ee.py/collections/ansible_collections/testorg/coll_2/", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_direct_interactive_ee.py/test/7.json b/tests/fixtures/integration/actions/collections/test_direct_interactive_ee.py/test/7.json new file mode 100644 index 000000000..0e26aef9e --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_direct_interactive_ee.py/test/7.json @@ -0,0 +1,11 @@ +{ + "name": "test[7-:1-Browse testorg.coll_2 plugins window-None]", + "index": 7, + "comment": "Browse testorg.coll_2 plugins window", + "output": [ + " TESTORG.COLL 2 TYPE ADDED DEPRECATED DESCRIPTION", + "0│lookup_2 lookup 2.0.0 False This is test lookup plugin", + "1│mod_2 module 2.0.0 False This is a test module", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_direct_interactive_ee.py/test/8.json b/tests/fixtures/integration/actions/collections/test_direct_interactive_ee.py/test/8.json new file mode 100644 index 000000000..668eb25e4 --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_direct_interactive_ee.py/test/8.json @@ -0,0 +1,53 @@ +{ + "name": "test[8-:0-lookup_2 plugin docs window-None]", + "index": 8, + "comment": "lookup_2 plugin docs window", + "output": [ + "TESTORG.COLL_2.LOOKUP_2: This is test lookup plugin", + " 0│---", + " 1│additional_information: {}", + " 2│collection_info:", + " 3│ authors:", + " 4│ - Ansible team (ansible-navigator)", + " 5│ license_file: LICENSE", + " 6│ name: testorg.coll_2", + " 7│ namespace: testorg", + " 8│ path: FIXTURES_COLLECTION_DIR/test_direct_interactive_ee.py/collections/ansible_collections/testorg/coll_2/", + " 9│ readme: README.md", + "10│ shadowed_by: []", + "11│ version: 2.0.0", + "12│doc:", + "13│ author: test", + "14│ description:", + "15│ - This is test lookup plugin", + "16│ name: lookup_2", + "17│ notes:", + "18│ - This is a dummy lookup plugin", + "19│ options:", + "20│ bar:", + "21│ default: candidate", + "22│ description:", + "23│ - Dummy option I(bar)", + "24│ type: str", + "25│ foo:", + "26│ description:", + "27│ - Dummy option I(foo)", + "28│ required: true", + "29│ type: str", + "30│ plugin_type: lookup", + "31│ short_description: This is test lookup plugin", + "32│ version_added: 2.0.0", + "33│ version_added_collection: testorg.coll_2", + "34│examples: |-", + "35│ - name: Retrieve a value deep inside a using a path", + "36│ ansible.builtin.set_fact:", + "37│ value: \"{{ lookup('testorg.coll_2.lookup_2', var1, var2) }}\"", + "38│full_name: testorg.coll_2.lookup_2", + "39│metadata: null", + "40│returndocs:", + "41│ _raw:", + "42│ description:", + "43│ - One or more zero-based indices of the matching list items.", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back + previous - next [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_direct_interactive_ee.py/test/9.json b/tests/fixtures/integration/actions/collections/test_direct_interactive_ee.py/test/9.json new file mode 100644 index 000000000..3c0a0aa93 --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_direct_interactive_ee.py/test/9.json @@ -0,0 +1,11 @@ +{ + "name": "test[9-:back-Back to browse testorg.coll_2 plugins window-None]", + "index": 9, + "comment": "Back to browse testorg.coll_2 plugins window", + "output": [ + " TESTORG.COLL 2 TYPE ADDED DEPRECATED DESCRIPTION", + "0│lookup_2 lookup 2.0.0 False This is test lookup plugin", + "1│mod_2 module 2.0.0 False This is a test module", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_direct_interactive_noee.py/test/0.json b/tests/fixtures/integration/actions/collections/test_direct_interactive_noee.py/test/0.json new file mode 100644 index 000000000..e61dca3e3 --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_direct_interactive_noee.py/test/0.json @@ -0,0 +1,11 @@ +{ + "name": "test[0-ansible-navigator collections --execution-environment false-ansible-navigator collections browse window-Collecting collection content]", + "index": 0, + "comment": "ansible-navigator collections browse window", + "output": [ + " NAME VERSION SHADOWED PATH", + "0│testorg.coll_1 1.0.0 False FIXTURES_COLLECTION_DIR/test_direct_interactive_noee.py/collections/ansible_collections/testorg/coll_1/", + "1│testorg.coll_2 2.0.0 False FIXTURES_COLLECTION_DIR/test_direct_interactive_noee.py/collections/ansible_collections/testorg/coll_2/", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_direct_interactive_noee.py/test/1.json b/tests/fixtures/integration/actions/collections/test_direct_interactive_noee.py/test/1.json new file mode 100644 index 000000000..fb5e6e254 --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_direct_interactive_noee.py/test/1.json @@ -0,0 +1,11 @@ +{ + "name": "test[1-:0-Browse testorg.coll_1 plugins window-None]", + "index": 1, + "comment": "Browse testorg.coll_1 plugins window", + "output": [ + " TESTORG.COLL 1 TYPE ADDED DEPRECATED DESCRIPTION", + "0│lookup_1 lookup 1.0.0 False This is test lookup plugin", + "1│mod_1 module 1.0.0 False This is a test module", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_direct_interactive_noee.py/test/10.json b/tests/fixtures/integration/actions/collections/test_direct_interactive_noee.py/test/10.json new file mode 100644 index 000000000..3cd4c391e --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_direct_interactive_noee.py/test/10.json @@ -0,0 +1,62 @@ +{ + "name": "test[10-:1-mod_2 plugin docs window-None]", + "index": 10, + "comment": "mod_2 plugin docs window", + "output": [ + "TESTORG.COLL_2.MOD_2: This is a test module", + " 0│---", + " 1│additional_information: {}", + " 2│collection_info:", + " 3│ authors:", + " 4│ - Ansible team (ansible-navigator)", + " 5│ license_file: LICENSE", + " 6│ name: testorg.coll_2", + " 7│ namespace: testorg", + " 8│ path: FIXTURES_COLLECTION_DIR/test_direct_interactive_noee.py/collections/ansible_collections/testorg/coll_2/", + " 9│ readme: README.md", + "10│ shadowed_by: []", + "11│ version: 2.0.0", + "12│doc:", + "13│ author:", + "14│ - test", + "15│ description:", + "16│ - This is a test module", + "17│ module: mod_2", + "18│ notes:", + "19│ - This is a dummy module", + "20│ options:", + "21│ bar:", + "22│ aliases:", + "23│ - bam", + "24│ choices:", + "25│ - candidate", + "26│ - running", + "27│ default: candidate", + "28│ description:", + "29│ - Dummy option I(bar)", + "30│ type: str", + "31│ foo:", + "32│ description:", + "33│ - Dummy option I(foo)", + "34│ type: str", + "35│ short_description: This is a test module", + "36│ version_added: 2.0.0", + "37│ version_added_collection: testorg.coll_2", + "38│examples: |-", + "39│ - name: test task-1", + "40│ testorg.coll_2.mod_2:", + "41│ foo: somevalue", + "42│ bar: candidate", + "43│full_name: testorg.coll_2.mod_2", + "44│metadata: null", + "45│returndocs:", + "46│ baz:", + "47│ description: test return 1", + "48│ returned: success", + "49│ sample:", + "50│ - a", + "51│ - b", + "52│ type: list", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back + previous - next [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_direct_interactive_noee.py/test/11.json b/tests/fixtures/integration/actions/collections/test_direct_interactive_noee.py/test/11.json new file mode 100644 index 000000000..7ef8de708 --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_direct_interactive_noee.py/test/11.json @@ -0,0 +1,11 @@ +{ + "name": "test[11-:back-Back to browse testorg.coll_2 plugins window-None]", + "index": 11, + "comment": "Back to browse testorg.coll_2 plugins window", + "output": [ + " TESTORG.COLL 2 TYPE ADDED DEPRECATED DESCRIPTION", + "0│lookup_2 lookup 2.0.0 False This is test lookup plugin", + "1│mod_2 module 2.0.0 False This is a test module", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_direct_interactive_noee.py/test/12.json b/tests/fixtures/integration/actions/collections/test_direct_interactive_noee.py/test/12.json new file mode 100644 index 000000000..22942d0b2 --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_direct_interactive_noee.py/test/12.json @@ -0,0 +1,11 @@ +{ + "name": "test[12-:back-Back to ansible-navigator collections browse window-None]", + "index": 12, + "comment": "Back to ansible-navigator collections browse window", + "output": [ + " NAME VERSION SHADOWED PATH", + "0│testorg.coll_1 1.0.0 False FIXTURES_COLLECTION_DIR/test_direct_interactive_noee.py/collections/ansible_collections/testorg/coll_1/", + "1│testorg.coll_2 2.0.0 False FIXTURES_COLLECTION_DIR/test_direct_interactive_noee.py/collections/ansible_collections/testorg/coll_2/", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_direct_interactive_noee.py/test/2.json b/tests/fixtures/integration/actions/collections/test_direct_interactive_noee.py/test/2.json new file mode 100644 index 000000000..9dbd361f8 --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_direct_interactive_noee.py/test/2.json @@ -0,0 +1,53 @@ +{ + "name": "test[2-:0-lookup_1 plugin docs window-None]", + "index": 2, + "comment": "lookup_1 plugin docs window", + "output": [ + "TESTORG.COLL_1.LOOKUP_1: This is test lookup plugin", + " 0│---", + " 1│additional_information: {}", + " 2│collection_info:", + " 3│ authors:", + " 4│ - Ansible team (ansible-navigator)", + " 5│ license_file: LICENSE", + " 6│ name: testorg.coll_1", + " 7│ namespace: testorg", + " 8│ path: FIXTURES_COLLECTION_DIR/test_direct_interactive_noee.py/collections/ansible_collections/testorg/coll_1/", + " 9│ readme: README.md", + "10│ shadowed_by: []", + "11│ version: 1.0.0", + "12│doc:", + "13│ author: test", + "14│ description:", + "15│ - This is test lookup plugin", + "16│ name: lookup_1", + "17│ notes:", + "18│ - This is a dummy lookup plugin", + "19│ options:", + "20│ bar:", + "21│ default: candidate", + "22│ description:", + "23│ - Dummy option I(bar)", + "24│ type: str", + "25│ foo:", + "26│ description:", + "27│ - Dummy option I(foo)", + "28│ required: true", + "29│ type: str", + "30│ plugin_type: lookup", + "31│ short_description: This is test lookup plugin", + "32│ version_added: 1.0.0", + "33│ version_added_collection: testorg.coll_1", + "34│examples: |-", + "35│ - name: Retrieve a value deep inside a using a path", + "36│ ansible.builtin.set_fact:", + "37│ value: \"{{ lookup('testorg.coll_1.lookup_1', var1, var2) }}\"", + "38│full_name: testorg.coll_1.lookup_1", + "39│metadata: null", + "40│returndocs:", + "41│ _raw:", + "42│ description:", + "43│ - One or more zero-based indices of the matching list items.", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back + previous - next [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_direct_interactive_noee.py/test/3.json b/tests/fixtures/integration/actions/collections/test_direct_interactive_noee.py/test/3.json new file mode 100644 index 000000000..b392387b8 --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_direct_interactive_noee.py/test/3.json @@ -0,0 +1,11 @@ +{ + "name": "test[3-:back-Back to browse testorg.coll_1 plugins window-None]", + "index": 3, + "comment": "Back to browse testorg.coll_1 plugins window", + "output": [ + " TESTORG.COLL 1 TYPE ADDED DEPRECATED DESCRIPTION", + "0│lookup_1 lookup 1.0.0 False This is test lookup plugin", + "1│mod_1 module 1.0.0 False This is a test module", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_direct_interactive_noee.py/test/4.json b/tests/fixtures/integration/actions/collections/test_direct_interactive_noee.py/test/4.json new file mode 100644 index 000000000..a3b9a1d8b --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_direct_interactive_noee.py/test/4.json @@ -0,0 +1,62 @@ +{ + "name": "test[4-:1-mod_1 plugin docs window-None]", + "index": 4, + "comment": "mod_1 plugin docs window", + "output": [ + "TESTORG.COLL_1.MOD_1: This is a test module", + " 0│---", + " 1│additional_information: {}", + " 2│collection_info:", + " 3│ authors:", + " 4│ - Ansible team (ansible-navigator)", + " 5│ license_file: LICENSE", + " 6│ name: testorg.coll_1", + " 7│ namespace: testorg", + " 8│ path: FIXTURES_COLLECTION_DIR/test_direct_interactive_noee.py/collections/ansible_collections/testorg/coll_1/", + " 9│ readme: README.md", + "10│ shadowed_by: []", + "11│ version: 1.0.0", + "12│doc:", + "13│ author:", + "14│ - test", + "15│ description:", + "16│ - This is a test module", + "17│ module: mod_1", + "18│ notes:", + "19│ - This is a dummy module", + "20│ options:", + "21│ bar:", + "22│ aliases:", + "23│ - bam", + "24│ choices:", + "25│ - candidate", + "26│ - running", + "27│ default: candidate", + "28│ description:", + "29│ - Dummy option I(bar)", + "30│ type: str", + "31│ foo:", + "32│ description:", + "33│ - Dummy option I(foo)", + "34│ type: str", + "35│ short_description: This is a test module", + "36│ version_added: 1.0.0", + "37│ version_added_collection: testorg.coll_1", + "38│examples: |-", + "39│ - name: test task-1", + "40│ testorg.coll_1.mod_1:", + "41│ foo: somevalue", + "42│ bar: candidate", + "43│full_name: testorg.coll_1.mod_1", + "44│metadata: null", + "45│returndocs:", + "46│ baz:", + "47│ description: test return 1", + "48│ returned: success", + "49│ sample:", + "50│ - a", + "51│ - b", + "52│ type: list", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back + previous - next [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_direct_interactive_noee.py/test/5.json b/tests/fixtures/integration/actions/collections/test_direct_interactive_noee.py/test/5.json new file mode 100644 index 000000000..915999e72 --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_direct_interactive_noee.py/test/5.json @@ -0,0 +1,11 @@ +{ + "name": "test[5-:back-Back to browse testorg.coll_1 plugins window-None]", + "index": 5, + "comment": "Back to browse testorg.coll_1 plugins window", + "output": [ + " TESTORG.COLL 1 TYPE ADDED DEPRECATED DESCRIPTION", + "0│lookup_1 lookup 1.0.0 False This is test lookup plugin", + "1│mod_1 module 1.0.0 False This is a test module", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_direct_interactive_noee.py/test/6.json b/tests/fixtures/integration/actions/collections/test_direct_interactive_noee.py/test/6.json new file mode 100644 index 000000000..2cc1cc0d0 --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_direct_interactive_noee.py/test/6.json @@ -0,0 +1,11 @@ +{ + "name": "test[6-:back-Back to ansible-navigator collections browse window-None]", + "index": 6, + "comment": "Back to ansible-navigator collections browse window", + "output": [ + " NAME VERSION SHADOWED PATH", + "0│testorg.coll_1 1.0.0 False FIXTURES_COLLECTION_DIR/test_direct_interactive_noee.py/collections/ansible_collections/testorg/coll_1/", + "1│testorg.coll_2 2.0.0 False FIXTURES_COLLECTION_DIR/test_direct_interactive_noee.py/collections/ansible_collections/testorg/coll_2/", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_direct_interactive_noee.py/test/7.json b/tests/fixtures/integration/actions/collections/test_direct_interactive_noee.py/test/7.json new file mode 100644 index 000000000..0e26aef9e --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_direct_interactive_noee.py/test/7.json @@ -0,0 +1,11 @@ +{ + "name": "test[7-:1-Browse testorg.coll_2 plugins window-None]", + "index": 7, + "comment": "Browse testorg.coll_2 plugins window", + "output": [ + " TESTORG.COLL 2 TYPE ADDED DEPRECATED DESCRIPTION", + "0│lookup_2 lookup 2.0.0 False This is test lookup plugin", + "1│mod_2 module 2.0.0 False This is a test module", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_direct_interactive_noee.py/test/8.json b/tests/fixtures/integration/actions/collections/test_direct_interactive_noee.py/test/8.json new file mode 100644 index 000000000..8817fce63 --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_direct_interactive_noee.py/test/8.json @@ -0,0 +1,53 @@ +{ + "name": "test[8-:0-lookup_2 plugin docs window-None]", + "index": 8, + "comment": "lookup_2 plugin docs window", + "output": [ + "TESTORG.COLL_2.LOOKUP_2: This is test lookup plugin", + " 0│---", + " 1│additional_information: {}", + " 2│collection_info:", + " 3│ authors:", + " 4│ - Ansible team (ansible-navigator)", + " 5│ license_file: LICENSE", + " 6│ name: testorg.coll_2", + " 7│ namespace: testorg", + " 8│ path: FIXTURES_COLLECTION_DIR/test_direct_interactive_noee.py/collections/ansible_collections/testorg/coll_2/", + " 9│ readme: README.md", + "10│ shadowed_by: []", + "11│ version: 2.0.0", + "12│doc:", + "13│ author: test", + "14│ description:", + "15│ - This is test lookup plugin", + "16│ name: lookup_2", + "17│ notes:", + "18│ - This is a dummy lookup plugin", + "19│ options:", + "20│ bar:", + "21│ default: candidate", + "22│ description:", + "23│ - Dummy option I(bar)", + "24│ type: str", + "25│ foo:", + "26│ description:", + "27│ - Dummy option I(foo)", + "28│ required: true", + "29│ type: str", + "30│ plugin_type: lookup", + "31│ short_description: This is test lookup plugin", + "32│ version_added: 2.0.0", + "33│ version_added_collection: testorg.coll_2", + "34│examples: |-", + "35│ - name: Retrieve a value deep inside a using a path", + "36│ ansible.builtin.set_fact:", + "37│ value: \"{{ lookup('testorg.coll_2.lookup_2', var1, var2) }}\"", + "38│full_name: testorg.coll_2.lookup_2", + "39│metadata: null", + "40│returndocs:", + "41│ _raw:", + "42│ description:", + "43│ - One or more zero-based indices of the matching list items.", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back + previous - next [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_direct_interactive_noee.py/test/9.json b/tests/fixtures/integration/actions/collections/test_direct_interactive_noee.py/test/9.json new file mode 100644 index 000000000..3c0a0aa93 --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_direct_interactive_noee.py/test/9.json @@ -0,0 +1,11 @@ +{ + "name": "test[9-:back-Back to browse testorg.coll_2 plugins window-None]", + "index": 9, + "comment": "Back to browse testorg.coll_2 plugins window", + "output": [ + " TESTORG.COLL 2 TYPE ADDED DEPRECATED DESCRIPTION", + "0│lookup_2 lookup 2.0.0 False This is test lookup plugin", + "1│mod_2 module 2.0.0 False This is a test module", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_welcome_interactive_ee.py/test/0.json b/tests/fixtures/integration/actions/collections/test_welcome_interactive_ee.py/test/0.json new file mode 100644 index 000000000..92aac242b --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_welcome_interactive_ee.py/test/0.json @@ -0,0 +1,25 @@ +{ + "name": "test[0-ansible-navigator --execution-environment true --ce docker-ansible-navigator welcome screen-None]", + "index": 0, + "comment": "ansible-navigator welcome screen", + "output": [ + " 0│## Welcome", + " 1│---------------------------------------------------------------------------------------------------", + " 2│", + " 3│Some things you can try from here:", + " 4│- `:config` Explore the current Ansible configuration", + " 5│- `:collections` Explore installed collections", + " 6│- `:doc ` Show a plugin doc", + " 7│- `:run -i ` Run a playbook in interactive mode", + " 8│- `:help` Show the main help page", + " 9│- `:inventory -i ` Explore an inventory", + "10│- `:log` Review the application log", + "11│- `:open` Open current page in the IDE", + "12│- `:quit` Quit the application", + "13│", + "14│happy automating,", + "15│", + "16│-winston", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_welcome_interactive_ee.py/test/1.json b/tests/fixtures/integration/actions/collections/test_welcome_interactive_ee.py/test/1.json new file mode 100644 index 000000000..ba2902fbe --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_welcome_interactive_ee.py/test/1.json @@ -0,0 +1,11 @@ +{ + "name": "test[1-:collections-ansible-navigator collections top window-Collecting collection content]", + "index": 1, + "comment": "ansible-navigator collections top window", + "output": [ + " NAME VERSION SHADOWED TYPE PATH", + "0│testorg.coll_1 1.0.0 False bind_mount FIXTURES_COLLECTION_DIR/test_welcome_interactive_ee.py/collections/ansible_collections/testorg/coll_1/", + "1│testorg.coll_2 2.0.0 False bind_mount FIXTURES_COLLECTION_DIR/test_welcome_interactive_ee.py/collections/ansible_collections/testorg/coll_2/", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_welcome_interactive_ee.py/test/10.json b/tests/fixtures/integration/actions/collections/test_welcome_interactive_ee.py/test/10.json new file mode 100644 index 000000000..e3bdbdb96 --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_welcome_interactive_ee.py/test/10.json @@ -0,0 +1,11 @@ +{ + "name": "test[10-:back-Back to browse testorg.coll_2 plugins window-None]", + "index": 10, + "comment": "Back to browse testorg.coll_2 plugins window", + "output": [ + " TESTORG.COLL 2 TYPE ADDED DEPRECATED DESCRIPTION", + "0│lookup_2 lookup 2.0.0 False This is test lookup plugin", + "1│mod_2 module 2.0.0 False This is a test module", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_welcome_interactive_ee.py/test/11.json b/tests/fixtures/integration/actions/collections/test_welcome_interactive_ee.py/test/11.json new file mode 100644 index 000000000..e6cb23211 --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_welcome_interactive_ee.py/test/11.json @@ -0,0 +1,62 @@ +{ + "name": "test[11-:1-mod_2 plugin docs window-None]", + "index": 11, + "comment": "mod_2 plugin docs window", + "output": [ + "TESTORG.COLL_2.MOD_2: This is a test module", + " 0│---", + " 1│additional_information: {}", + " 2│collection_info:", + " 3│ authors:", + " 4│ - Ansible team (ansible-navigator)", + " 5│ license_file: LICENSE", + " 6│ name: testorg.coll_2", + " 7│ namespace: testorg", + " 8│ path: FIXTURES_COLLECTION_DIR/test_welcome_interactive_ee.py/collections/ansible_collections/testorg/coll_2/", + " 9│ readme: README.md", + "10│ shadowed_by: []", + "11│ version: 2.0.0", + "12│doc:", + "13│ author:", + "14│ - test", + "15│ description:", + "16│ - This is a test module", + "17│ module: mod_2", + "18│ notes:", + "19│ - This is a dummy module", + "20│ options:", + "21│ bar:", + "22│ aliases:", + "23│ - bam", + "24│ choices:", + "25│ - candidate", + "26│ - running", + "27│ default: candidate", + "28│ description:", + "29│ - Dummy option I(bar)", + "30│ type: str", + "31│ foo:", + "32│ description:", + "33│ - Dummy option I(foo)", + "34│ type: str", + "35│ short_description: This is a test module", + "36│ version_added: 2.0.0", + "37│ version_added_collection: testorg.coll_2", + "38│examples: |-", + "39│ - name: test task-1", + "40│ testorg.coll_2.mod_2:", + "41│ foo: somevalue", + "42│ bar: candidate", + "43│full_name: testorg.coll_2.mod_2", + "44│metadata: null", + "45│returndocs:", + "46│ baz:", + "47│ description: test return 1", + "48│ returned: success", + "49│ sample:", + "50│ - a", + "51│ - b", + "52│ type: list", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back + previous - next [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_welcome_interactive_ee.py/test/12.json b/tests/fixtures/integration/actions/collections/test_welcome_interactive_ee.py/test/12.json new file mode 100644 index 000000000..7ea9ae9cd --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_welcome_interactive_ee.py/test/12.json @@ -0,0 +1,11 @@ +{ + "name": "test[12-:back-Back to browse testorg.coll_2 plugins window-None]", + "index": 12, + "comment": "Back to browse testorg.coll_2 plugins window", + "output": [ + " TESTORG.COLL 2 TYPE ADDED DEPRECATED DESCRIPTION", + "0│lookup_2 lookup 2.0.0 False This is test lookup plugin", + "1│mod_2 module 2.0.0 False This is a test module", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_welcome_interactive_ee.py/test/13.json b/tests/fixtures/integration/actions/collections/test_welcome_interactive_ee.py/test/13.json new file mode 100644 index 000000000..925095870 --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_welcome_interactive_ee.py/test/13.json @@ -0,0 +1,11 @@ +{ + "name": "test[13-:back-Back to ansible-navigator collections browse window-None]", + "index": 13, + "comment": "Back to ansible-navigator collections browse window", + "output": [ + " NAME VERSION SHADOWED TYPE PATH", + "0│testorg.coll_1 1.0.0 False bind_mount FIXTURES_COLLECTION_DIR/test_welcome_interactive_ee.py/collections/ansible_collections/testorg/coll_1/", + "1│testorg.coll_2 2.0.0 False bind_mount FIXTURES_COLLECTION_DIR/test_welcome_interactive_ee.py/collections/ansible_collections/testorg/coll_2/", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_welcome_interactive_ee.py/test/2.json b/tests/fixtures/integration/actions/collections/test_welcome_interactive_ee.py/test/2.json new file mode 100644 index 000000000..111f0e8b0 --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_welcome_interactive_ee.py/test/2.json @@ -0,0 +1,11 @@ +{ + "name": "test[2-:0-Browse testorg.coll_1 plugins window-None]", + "index": 2, + "comment": "Browse testorg.coll_1 plugins window", + "output": [ + " TESTORG.COLL 1 TYPE ADDED DEPRECATED DESCRIPTION", + "0│lookup_1 lookup 1.0.0 False This is test lookup plugin", + "1│mod_1 module 1.0.0 False This is a test module", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_welcome_interactive_ee.py/test/3.json b/tests/fixtures/integration/actions/collections/test_welcome_interactive_ee.py/test/3.json new file mode 100644 index 000000000..51f9b27d3 --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_welcome_interactive_ee.py/test/3.json @@ -0,0 +1,53 @@ +{ + "name": "test[3-:0-lookup_1 plugin docs window-None]", + "index": 3, + "comment": "lookup_1 plugin docs window", + "output": [ + "TESTORG.COLL_1.LOOKUP_1: This is test lookup plugin", + " 0│---", + " 1│additional_information: {}", + " 2│collection_info:", + " 3│ authors:", + " 4│ - Ansible team (ansible-navigator)", + " 5│ license_file: LICENSE", + " 6│ name: testorg.coll_1", + " 7│ namespace: testorg", + " 8│ path: FIXTURES_COLLECTION_DIR/test_welcome_interactive_ee.py/collections/ansible_collections/testorg/coll_1/", + " 9│ readme: README.md", + "10│ shadowed_by: []", + "11│ version: 1.0.0", + "12│doc:", + "13│ author: test", + "14│ description:", + "15│ - This is test lookup plugin", + "16│ name: lookup_1", + "17│ notes:", + "18│ - This is a dummy lookup plugin", + "19│ options:", + "20│ bar:", + "21│ default: candidate", + "22│ description:", + "23│ - Dummy option I(bar)", + "24│ type: str", + "25│ foo:", + "26│ description:", + "27│ - Dummy option I(foo)", + "28│ required: true", + "29│ type: str", + "30│ plugin_type: lookup", + "31│ short_description: This is test lookup plugin", + "32│ version_added: 1.0.0", + "33│ version_added_collection: testorg.coll_1", + "34│examples: |-", + "35│ - name: Retrieve a value deep inside a using a path", + "36│ ansible.builtin.set_fact:", + "37│ value: \"{{ lookup('testorg.coll_1.lookup_1', var1, var2) }}\"", + "38│full_name: testorg.coll_1.lookup_1", + "39│metadata: null", + "40│returndocs:", + "41│ _raw:", + "42│ description:", + "43│ - One or more zero-based indices of the matching list items.", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back + previous - next [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_welcome_interactive_ee.py/test/4.json b/tests/fixtures/integration/actions/collections/test_welcome_interactive_ee.py/test/4.json new file mode 100644 index 000000000..bbd38cf09 --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_welcome_interactive_ee.py/test/4.json @@ -0,0 +1,11 @@ +{ + "name": "test[4-:back-Back to browse testorg.coll_1 plugins window-None]", + "index": 4, + "comment": "Back to browse testorg.coll_1 plugins window", + "output": [ + " TESTORG.COLL 1 TYPE ADDED DEPRECATED DESCRIPTION", + "0│lookup_1 lookup 1.0.0 False This is test lookup plugin", + "1│mod_1 module 1.0.0 False This is a test module", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_welcome_interactive_ee.py/test/5.json b/tests/fixtures/integration/actions/collections/test_welcome_interactive_ee.py/test/5.json new file mode 100644 index 000000000..743b4c991 --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_welcome_interactive_ee.py/test/5.json @@ -0,0 +1,62 @@ +{ + "name": "test[5-:1-mod_1 plugin docs window-None]", + "index": 5, + "comment": "mod_1 plugin docs window", + "output": [ + "TESTORG.COLL_1.MOD_1: This is a test module", + " 0│---", + " 1│additional_information: {}", + " 2│collection_info:", + " 3│ authors:", + " 4│ - Ansible team (ansible-navigator)", + " 5│ license_file: LICENSE", + " 6│ name: testorg.coll_1", + " 7│ namespace: testorg", + " 8│ path: FIXTURES_COLLECTION_DIR/test_welcome_interactive_ee.py/collections/ansible_collections/testorg/coll_1/", + " 9│ readme: README.md", + "10│ shadowed_by: []", + "11│ version: 1.0.0", + "12│doc:", + "13│ author:", + "14│ - test", + "15│ description:", + "16│ - This is a test module", + "17│ module: mod_1", + "18│ notes:", + "19│ - This is a dummy module", + "20│ options:", + "21│ bar:", + "22│ aliases:", + "23│ - bam", + "24│ choices:", + "25│ - candidate", + "26│ - running", + "27│ default: candidate", + "28│ description:", + "29│ - Dummy option I(bar)", + "30│ type: str", + "31│ foo:", + "32│ description:", + "33│ - Dummy option I(foo)", + "34│ type: str", + "35│ short_description: This is a test module", + "36│ version_added: 1.0.0", + "37│ version_added_collection: testorg.coll_1", + "38│examples: |-", + "39│ - name: test task-1", + "40│ testorg.coll_1.mod_1:", + "41│ foo: somevalue", + "42│ bar: candidate", + "43│full_name: testorg.coll_1.mod_1", + "44│metadata: null", + "45│returndocs:", + "46│ baz:", + "47│ description: test return 1", + "48│ returned: success", + "49│ sample:", + "50│ - a", + "51│ - b", + "52│ type: list", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back + previous - next [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_welcome_interactive_ee.py/test/6.json b/tests/fixtures/integration/actions/collections/test_welcome_interactive_ee.py/test/6.json new file mode 100644 index 000000000..ad606e390 --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_welcome_interactive_ee.py/test/6.json @@ -0,0 +1,11 @@ +{ + "name": "test[6-:back-Back to browse testorg.coll_1 plugins window-None]", + "index": 6, + "comment": "Back to browse testorg.coll_1 plugins window", + "output": [ + " TESTORG.COLL 1 TYPE ADDED DEPRECATED DESCRIPTION", + "0│lookup_1 lookup 1.0.0 False This is test lookup plugin", + "1│mod_1 module 1.0.0 False This is a test module", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_welcome_interactive_ee.py/test/7.json b/tests/fixtures/integration/actions/collections/test_welcome_interactive_ee.py/test/7.json new file mode 100644 index 000000000..0d784376a --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_welcome_interactive_ee.py/test/7.json @@ -0,0 +1,11 @@ +{ + "name": "test[7-:back-Back to ansible-navigator collections browse window-None]", + "index": 7, + "comment": "Back to ansible-navigator collections browse window", + "output": [ + " NAME VERSION SHADOWED TYPE PATH", + "0│testorg.coll_1 1.0.0 False bind_mount FIXTURES_COLLECTION_DIR/test_welcome_interactive_ee.py/collections/ansible_collections/testorg/coll_1/", + "1│testorg.coll_2 2.0.0 False bind_mount FIXTURES_COLLECTION_DIR/test_welcome_interactive_ee.py/collections/ansible_collections/testorg/coll_2/", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_welcome_interactive_ee.py/test/8.json b/tests/fixtures/integration/actions/collections/test_welcome_interactive_ee.py/test/8.json new file mode 100644 index 000000000..8ecb4fa3e --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_welcome_interactive_ee.py/test/8.json @@ -0,0 +1,11 @@ +{ + "name": "test[8-:1-Browse testorg.coll_2 plugins window-None]", + "index": 8, + "comment": "Browse testorg.coll_2 plugins window", + "output": [ + " TESTORG.COLL 2 TYPE ADDED DEPRECATED DESCRIPTION", + "0│lookup_2 lookup 2.0.0 False This is test lookup plugin", + "1│mod_2 module 2.0.0 False This is a test module", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_welcome_interactive_ee.py/test/9.json b/tests/fixtures/integration/actions/collections/test_welcome_interactive_ee.py/test/9.json new file mode 100644 index 000000000..97cd63e21 --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_welcome_interactive_ee.py/test/9.json @@ -0,0 +1,53 @@ +{ + "name": "test[9-:0-lookup_2 plugin docs window-None]", + "index": 9, + "comment": "lookup_2 plugin docs window", + "output": [ + "TESTORG.COLL_2.LOOKUP_2: This is test lookup plugin", + " 0│---", + " 1│additional_information: {}", + " 2│collection_info:", + " 3│ authors:", + " 4│ - Ansible team (ansible-navigator)", + " 5│ license_file: LICENSE", + " 6│ name: testorg.coll_2", + " 7│ namespace: testorg", + " 8│ path: FIXTURES_COLLECTION_DIR/test_welcome_interactive_ee.py/collections/ansible_collections/testorg/coll_2/", + " 9│ readme: README.md", + "10│ shadowed_by: []", + "11│ version: 2.0.0", + "12│doc:", + "13│ author: test", + "14│ description:", + "15│ - This is test lookup plugin", + "16│ name: lookup_2", + "17│ notes:", + "18│ - This is a dummy lookup plugin", + "19│ options:", + "20│ bar:", + "21│ default: candidate", + "22│ description:", + "23│ - Dummy option I(bar)", + "24│ type: str", + "25│ foo:", + "26│ description:", + "27│ - Dummy option I(foo)", + "28│ required: true", + "29│ type: str", + "30│ plugin_type: lookup", + "31│ short_description: This is test lookup plugin", + "32│ version_added: 2.0.0", + "33│ version_added_collection: testorg.coll_2", + "34│examples: |-", + "35│ - name: Retrieve a value deep inside a using a path", + "36│ ansible.builtin.set_fact:", + "37│ value: \"{{ lookup('testorg.coll_2.lookup_2', var1, var2) }}\"", + "38│full_name: testorg.coll_2.lookup_2", + "39│metadata: null", + "40│returndocs:", + "41│ _raw:", + "42│ description:", + "43│ - One or more zero-based indices of the matching list items.", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back + previous - next [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_welcome_interactive_noee.py/test/0.json b/tests/fixtures/integration/actions/collections/test_welcome_interactive_noee.py/test/0.json new file mode 100644 index 000000000..9b30298b2 --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_welcome_interactive_noee.py/test/0.json @@ -0,0 +1,25 @@ +{ + "name": "test[0-ansible-navigator --execution-environment false-ansible-navigator welcome screen-None]", + "index": 0, + "comment": "ansible-navigator welcome screen", + "output": [ + " 0│## Welcome", + " 1│---------------------------------------------------------------------------------------------------", + " 2│", + " 3│Some things you can try from here:", + " 4│- `:config` Explore the current Ansible configuration", + " 5│- `:collections` Explore installed collections", + " 6│- `:doc ` Show a plugin doc", + " 7│- `:run -i ` Run a playbook in interactive mode", + " 8│- `:help` Show the main help page", + " 9│- `:inventory -i ` Explore an inventory", + "10│- `:log` Review the application log", + "11│- `:open` Open current page in the IDE", + "12│- `:quit` Quit the application", + "13│", + "14│happy automating,", + "15│", + "16│-winston", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_welcome_interactive_noee.py/test/1.json b/tests/fixtures/integration/actions/collections/test_welcome_interactive_noee.py/test/1.json new file mode 100644 index 000000000..f76e8e8f0 --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_welcome_interactive_noee.py/test/1.json @@ -0,0 +1,11 @@ +{ + "name": "test[1-:collections-ansible-navigator collections top window-Collecting collection content]", + "index": 1, + "comment": "ansible-navigator collections top window", + "output": [ + " NAME VERSION SHADOWED PATH", + "0│testorg.coll_1 1.0.0 False FIXTURES_COLLECTION_DIR/test_welcome_interactive_noee.py/collections/ansible_collections/testorg/coll_1/", + "1│testorg.coll_2 2.0.0 False FIXTURES_COLLECTION_DIR/test_welcome_interactive_noee.py/collections/ansible_collections/testorg/coll_2/", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_welcome_interactive_noee.py/test/10.json b/tests/fixtures/integration/actions/collections/test_welcome_interactive_noee.py/test/10.json new file mode 100644 index 000000000..e3bdbdb96 --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_welcome_interactive_noee.py/test/10.json @@ -0,0 +1,11 @@ +{ + "name": "test[10-:back-Back to browse testorg.coll_2 plugins window-None]", + "index": 10, + "comment": "Back to browse testorg.coll_2 plugins window", + "output": [ + " TESTORG.COLL 2 TYPE ADDED DEPRECATED DESCRIPTION", + "0│lookup_2 lookup 2.0.0 False This is test lookup plugin", + "1│mod_2 module 2.0.0 False This is a test module", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_welcome_interactive_noee.py/test/11.json b/tests/fixtures/integration/actions/collections/test_welcome_interactive_noee.py/test/11.json new file mode 100644 index 000000000..d460d3b14 --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_welcome_interactive_noee.py/test/11.json @@ -0,0 +1,62 @@ +{ + "name": "test[11-:1-mod_2 plugin docs window-None]", + "index": 11, + "comment": "mod_2 plugin docs window", + "output": [ + "TESTORG.COLL_2.MOD_2: This is a test module", + " 0│---", + " 1│additional_information: {}", + " 2│collection_info:", + " 3│ authors:", + " 4│ - Ansible team (ansible-navigator)", + " 5│ license_file: LICENSE", + " 6│ name: testorg.coll_2", + " 7│ namespace: testorg", + " 8│ path: FIXTURES_COLLECTION_DIR/test_welcome_interactive_noee.py/collections/ansible_collections/testorg/coll_2/", + " 9│ readme: README.md", + "10│ shadowed_by: []", + "11│ version: 2.0.0", + "12│doc:", + "13│ author:", + "14│ - test", + "15│ description:", + "16│ - This is a test module", + "17│ module: mod_2", + "18│ notes:", + "19│ - This is a dummy module", + "20│ options:", + "21│ bar:", + "22│ aliases:", + "23│ - bam", + "24│ choices:", + "25│ - candidate", + "26│ - running", + "27│ default: candidate", + "28│ description:", + "29│ - Dummy option I(bar)", + "30│ type: str", + "31│ foo:", + "32│ description:", + "33│ - Dummy option I(foo)", + "34│ type: str", + "35│ short_description: This is a test module", + "36│ version_added: 2.0.0", + "37│ version_added_collection: testorg.coll_2", + "38│examples: |-", + "39│ - name: test task-1", + "40│ testorg.coll_2.mod_2:", + "41│ foo: somevalue", + "42│ bar: candidate", + "43│full_name: testorg.coll_2.mod_2", + "44│metadata: null", + "45│returndocs:", + "46│ baz:", + "47│ description: test return 1", + "48│ returned: success", + "49│ sample:", + "50│ - a", + "51│ - b", + "52│ type: list", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back + previous - next [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_welcome_interactive_noee.py/test/12.json b/tests/fixtures/integration/actions/collections/test_welcome_interactive_noee.py/test/12.json new file mode 100644 index 000000000..7ea9ae9cd --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_welcome_interactive_noee.py/test/12.json @@ -0,0 +1,11 @@ +{ + "name": "test[12-:back-Back to browse testorg.coll_2 plugins window-None]", + "index": 12, + "comment": "Back to browse testorg.coll_2 plugins window", + "output": [ + " TESTORG.COLL 2 TYPE ADDED DEPRECATED DESCRIPTION", + "0│lookup_2 lookup 2.0.0 False This is test lookup plugin", + "1│mod_2 module 2.0.0 False This is a test module", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_welcome_interactive_noee.py/test/13.json b/tests/fixtures/integration/actions/collections/test_welcome_interactive_noee.py/test/13.json new file mode 100644 index 000000000..4f6d0dd6b --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_welcome_interactive_noee.py/test/13.json @@ -0,0 +1,11 @@ +{ + "name": "test[13-:back-Back to ansible-navigator collections browse window-None]", + "index": 13, + "comment": "Back to ansible-navigator collections browse window", + "output": [ + " NAME VERSION SHADOWED PATH", + "0│testorg.coll_1 1.0.0 False FIXTURES_COLLECTION_DIR/test_welcome_interactive_noee.py/collections/ansible_collections/testorg/coll_1/", + "1│testorg.coll_2 2.0.0 False FIXTURES_COLLECTION_DIR/test_welcome_interactive_noee.py/collections/ansible_collections/testorg/coll_2/", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_welcome_interactive_noee.py/test/2.json b/tests/fixtures/integration/actions/collections/test_welcome_interactive_noee.py/test/2.json new file mode 100644 index 000000000..111f0e8b0 --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_welcome_interactive_noee.py/test/2.json @@ -0,0 +1,11 @@ +{ + "name": "test[2-:0-Browse testorg.coll_1 plugins window-None]", + "index": 2, + "comment": "Browse testorg.coll_1 plugins window", + "output": [ + " TESTORG.COLL 1 TYPE ADDED DEPRECATED DESCRIPTION", + "0│lookup_1 lookup 1.0.0 False This is test lookup plugin", + "1│mod_1 module 1.0.0 False This is a test module", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_welcome_interactive_noee.py/test/3.json b/tests/fixtures/integration/actions/collections/test_welcome_interactive_noee.py/test/3.json new file mode 100644 index 000000000..c980a4b22 --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_welcome_interactive_noee.py/test/3.json @@ -0,0 +1,53 @@ +{ + "name": "test[3-:0-lookup_1 plugin docs window-None]", + "index": 3, + "comment": "lookup_1 plugin docs window", + "output": [ + "TESTORG.COLL_1.LOOKUP_1: This is test lookup plugin", + " 0│---", + " 1│additional_information: {}", + " 2│collection_info:", + " 3│ authors:", + " 4│ - Ansible team (ansible-navigator)", + " 5│ license_file: LICENSE", + " 6│ name: testorg.coll_1", + " 7│ namespace: testorg", + " 8│ path: FIXTURES_COLLECTION_DIR/test_welcome_interactive_noee.py/collections/ansible_collections/testorg/coll_1/", + " 9│ readme: README.md", + "10│ shadowed_by: []", + "11│ version: 1.0.0", + "12│doc:", + "13│ author: test", + "14│ description:", + "15│ - This is test lookup plugin", + "16│ name: lookup_1", + "17│ notes:", + "18│ - This is a dummy lookup plugin", + "19│ options:", + "20│ bar:", + "21│ default: candidate", + "22│ description:", + "23│ - Dummy option I(bar)", + "24│ type: str", + "25│ foo:", + "26│ description:", + "27│ - Dummy option I(foo)", + "28│ required: true", + "29│ type: str", + "30│ plugin_type: lookup", + "31│ short_description: This is test lookup plugin", + "32│ version_added: 1.0.0", + "33│ version_added_collection: testorg.coll_1", + "34│examples: |-", + "35│ - name: Retrieve a value deep inside a using a path", + "36│ ansible.builtin.set_fact:", + "37│ value: \"{{ lookup('testorg.coll_1.lookup_1', var1, var2) }}\"", + "38│full_name: testorg.coll_1.lookup_1", + "39│metadata: null", + "40│returndocs:", + "41│ _raw:", + "42│ description:", + "43│ - One or more zero-based indices of the matching list items.", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back + previous - next [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_welcome_interactive_noee.py/test/4.json b/tests/fixtures/integration/actions/collections/test_welcome_interactive_noee.py/test/4.json new file mode 100644 index 000000000..bbd38cf09 --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_welcome_interactive_noee.py/test/4.json @@ -0,0 +1,11 @@ +{ + "name": "test[4-:back-Back to browse testorg.coll_1 plugins window-None]", + "index": 4, + "comment": "Back to browse testorg.coll_1 plugins window", + "output": [ + " TESTORG.COLL 1 TYPE ADDED DEPRECATED DESCRIPTION", + "0│lookup_1 lookup 1.0.0 False This is test lookup plugin", + "1│mod_1 module 1.0.0 False This is a test module", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_welcome_interactive_noee.py/test/5.json b/tests/fixtures/integration/actions/collections/test_welcome_interactive_noee.py/test/5.json new file mode 100644 index 000000000..3f3d26769 --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_welcome_interactive_noee.py/test/5.json @@ -0,0 +1,62 @@ +{ + "name": "test[5-:1-mod_1 plugin docs window-None]", + "index": 5, + "comment": "mod_1 plugin docs window", + "output": [ + "TESTORG.COLL_1.MOD_1: This is a test module", + " 0│---", + " 1│additional_information: {}", + " 2│collection_info:", + " 3│ authors:", + " 4│ - Ansible team (ansible-navigator)", + " 5│ license_file: LICENSE", + " 6│ name: testorg.coll_1", + " 7│ namespace: testorg", + " 8│ path: FIXTURES_COLLECTION_DIR/test_welcome_interactive_noee.py/collections/ansible_collections/testorg/coll_1/", + " 9│ readme: README.md", + "10│ shadowed_by: []", + "11│ version: 1.0.0", + "12│doc:", + "13│ author:", + "14│ - test", + "15│ description:", + "16│ - This is a test module", + "17│ module: mod_1", + "18│ notes:", + "19│ - This is a dummy module", + "20│ options:", + "21│ bar:", + "22│ aliases:", + "23│ - bam", + "24│ choices:", + "25│ - candidate", + "26│ - running", + "27│ default: candidate", + "28│ description:", + "29│ - Dummy option I(bar)", + "30│ type: str", + "31│ foo:", + "32│ description:", + "33│ - Dummy option I(foo)", + "34│ type: str", + "35│ short_description: This is a test module", + "36│ version_added: 1.0.0", + "37│ version_added_collection: testorg.coll_1", + "38│examples: |-", + "39│ - name: test task-1", + "40│ testorg.coll_1.mod_1:", + "41│ foo: somevalue", + "42│ bar: candidate", + "43│full_name: testorg.coll_1.mod_1", + "44│metadata: null", + "45│returndocs:", + "46│ baz:", + "47│ description: test return 1", + "48│ returned: success", + "49│ sample:", + "50│ - a", + "51│ - b", + "52│ type: list", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back + previous - next [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_welcome_interactive_noee.py/test/6.json b/tests/fixtures/integration/actions/collections/test_welcome_interactive_noee.py/test/6.json new file mode 100644 index 000000000..ad606e390 --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_welcome_interactive_noee.py/test/6.json @@ -0,0 +1,11 @@ +{ + "name": "test[6-:back-Back to browse testorg.coll_1 plugins window-None]", + "index": 6, + "comment": "Back to browse testorg.coll_1 plugins window", + "output": [ + " TESTORG.COLL 1 TYPE ADDED DEPRECATED DESCRIPTION", + "0│lookup_1 lookup 1.0.0 False This is test lookup plugin", + "1│mod_1 module 1.0.0 False This is a test module", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_welcome_interactive_noee.py/test/7.json b/tests/fixtures/integration/actions/collections/test_welcome_interactive_noee.py/test/7.json new file mode 100644 index 000000000..b956107b9 --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_welcome_interactive_noee.py/test/7.json @@ -0,0 +1,11 @@ +{ + "name": "test[7-:back-Back to ansible-navigator collections browse window-None]", + "index": 7, + "comment": "Back to ansible-navigator collections browse window", + "output": [ + " NAME VERSION SHADOWED PATH", + "0│testorg.coll_1 1.0.0 False FIXTURES_COLLECTION_DIR/test_welcome_interactive_noee.py/collections/ansible_collections/testorg/coll_1/", + "1│testorg.coll_2 2.0.0 False FIXTURES_COLLECTION_DIR/test_welcome_interactive_noee.py/collections/ansible_collections/testorg/coll_2/", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_welcome_interactive_noee.py/test/8.json b/tests/fixtures/integration/actions/collections/test_welcome_interactive_noee.py/test/8.json new file mode 100644 index 000000000..8ecb4fa3e --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_welcome_interactive_noee.py/test/8.json @@ -0,0 +1,11 @@ +{ + "name": "test[8-:1-Browse testorg.coll_2 plugins window-None]", + "index": 8, + "comment": "Browse testorg.coll_2 plugins window", + "output": [ + " TESTORG.COLL 2 TYPE ADDED DEPRECATED DESCRIPTION", + "0│lookup_2 lookup 2.0.0 False This is test lookup plugin", + "1│mod_2 module 2.0.0 False This is a test module", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/fixtures/integration/actions/collections/test_welcome_interactive_noee.py/test/9.json b/tests/fixtures/integration/actions/collections/test_welcome_interactive_noee.py/test/9.json new file mode 100644 index 000000000..01eb46478 --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_welcome_interactive_noee.py/test/9.json @@ -0,0 +1,53 @@ +{ + "name": "test[9-:0-lookup_2 plugin docs window-None]", + "index": 9, + "comment": "lookup_2 plugin docs window", + "output": [ + "TESTORG.COLL_2.LOOKUP_2: This is test lookup plugin", + " 0│---", + " 1│additional_information: {}", + " 2│collection_info:", + " 3│ authors:", + " 4│ - Ansible team (ansible-navigator)", + " 5│ license_file: LICENSE", + " 6│ name: testorg.coll_2", + " 7│ namespace: testorg", + " 8│ path: FIXTURES_COLLECTION_DIR/test_welcome_interactive_noee.py/collections/ansible_collections/testorg/coll_2/", + " 9│ readme: README.md", + "10│ shadowed_by: []", + "11│ version: 2.0.0", + "12│doc:", + "13│ author: test", + "14│ description:", + "15│ - This is test lookup plugin", + "16│ name: lookup_2", + "17│ notes:", + "18│ - This is a dummy lookup plugin", + "19│ options:", + "20│ bar:", + "21│ default: candidate", + "22│ description:", + "23│ - Dummy option I(bar)", + "24│ type: str", + "25│ foo:", + "26│ description:", + "27│ - Dummy option I(foo)", + "28│ required: true", + "29│ type: str", + "30│ plugin_type: lookup", + "31│ short_description: This is test lookup plugin", + "32│ version_added: 2.0.0", + "33│ version_added_collection: testorg.coll_2", + "34│examples: |-", + "35│ - name: Retrieve a value deep inside a using a path", + "36│ ansible.builtin.set_fact:", + "37│ value: \"{{ lookup('testorg.coll_2.lookup_2', var1, var2) }}\"", + "38│full_name: testorg.coll_2.lookup_2", + "39│metadata: null", + "40│returndocs:", + "41│ _raw:", + "42│ description:", + "43│ - One or more zero-based indices of the matching list items.", + "^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back + previous - next [0-9] goto :help help" + ] +} \ No newline at end of file diff --git a/tests/integration/_common.py b/tests/integration/_common.py index 8bfa9a5fe..bb6bf6dee 100644 --- a/tests/integration/_common.py +++ b/tests/integration/_common.py @@ -201,19 +201,27 @@ def __enter__(self): # attached to upper left self._pane.set_height(self._pane_height) self._pane.set_width(self._pane_width) - # do this here so it goes away with the tmux shell session - self._pane.send_keys(f"export ANSIBLE_NAVIGATOR_CONFIG={self._config_path}") - # send any other commands needed for setup - for command in self._setup_commands: - self._pane.send_keys(command) + # send the config envvar + other set up commands + venv = "source $VIRTUAL_ENV/bin/activate" + navigator_config = f"export ANSIBLE_NAVIGATOR_CONFIG={self._config_path}" + set_up_commands = [venv, navigator_config] + self._setup_commands + set_up_command = " && ".join(set_up_commands) + self._pane.send_keys(set_up_command) + return self def __exit__(self, exc_type, exc_value, exc_traceback): if self._server.has_session(self._session_name): self._session.kill_session() - def interaction(self, value, wait_on_help=True, wait_on_playbook_status=False): + def interaction( + self, + value, + wait_on_help=True, + wait_on_playbook_status=False, + wait_on_collection_fetch_prompt=None, + ): """interact with the tmux session""" self._pane.send_keys(value, suppress_history=False) ok_to_return = [False] @@ -227,6 +235,8 @@ def interaction(self, value, wait_on_help=True, wait_on_playbook_status=False): ok_to_return.append(any(":help help" in line for line in showing)) if wait_on_playbook_status: ok_to_return.append(showing[-1].endswith(wait_on_playbook_status)) + if wait_on_collection_fetch_prompt: + ok_to_return.append(wait_on_collection_fetch_prompt not in showing[0]) return showing diff --git a/tests/integration/actions/collections/__init__.py b/tests/integration/actions/collections/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/integration/actions/collections/base.py b/tests/integration/actions/collections/base.py new file mode 100644 index 000000000..a26950f3c --- /dev/null +++ b/tests/integration/actions/collections/base.py @@ -0,0 +1,79 @@ +""" base class for config interactive tests +""" +import difflib +import json +import os +import shutil + +import pytest + +from ..._common import fixture_path_from_request +from ..._common import update_fixtures +from ..._common import TmuxSession + +from ....defaults import FIXTURES_COLLECTION_DIR + + +class BaseClass: + # pylint: disable=attribute-defined-outside-init + """base class for interactive collections tests""" + + UPDATE_FIXTURES = False + EXECUTION_ENVIRONMENT_TEST = False + + @staticmethod + @pytest.fixture(scope="module", name="tmux_collections_session") + def _fixture_tmux_config_session(request, os_indendent_tmp): + """tmux fixture for this module""" + + tmp_coll_dir = os.path.join(os_indendent_tmp, request.node.name, "") + try: + shutil.rmtree(tmp_coll_dir) + except FileNotFoundError: + pass + os.makedirs(tmp_coll_dir) + shutil.copytree(FIXTURES_COLLECTION_DIR, os.path.join(tmp_coll_dir, "collections")) + params = { + "window_name": request.node.name, + "setup_commands": [ + f"cd {tmp_coll_dir}", + f"export ANSIBLE_COLLECTIONS_PATH={tmp_coll_dir}", + "export ANSIBLE_DEVEL_WARNING=False", + "export ANSIBLE_DEPRECATION_WARNINGS=False", + ], + "pane_height": "2000", + "pane_width": "200", + } + with TmuxSession(**params) as tmux_session: + yield tmux_session + + def test( + self, + request, + os_indendent_tmp, + tmux_collections_session, + index, + user_input, + comment, + collection_fetch_prompt, + ): + # pylint:disable=unused-argument + # pylint: disable=too-few-public-methods + # pylint: disable=too-many-arguments + """test interactive config""" + received_output = tmux_collections_session.interaction( + user_input, wait_on_collection_fetch_prompt=collection_fetch_prompt + ) + + received_output = [ + line.replace(os_indendent_tmp, "FIXTURES_COLLECTION_DIR") for line in received_output + ] + + if self.UPDATE_FIXTURES: + update_fixtures(request, index, received_output, comment) + dir_path, file_name = fixture_path_from_request(request, index) + with open(f"{dir_path}/{file_name}") as infile: + expected_output = json.load(infile)["output"] + assert expected_output == received_output, "\n" + "\n".join( + difflib.unified_diff(expected_output, received_output, "expected", "received") + ) diff --git a/tests/integration/actions/collections/test_direct_interactive_ee.py b/tests/integration/actions/collections/test_direct_interactive_ee.py new file mode 100644 index 000000000..17e4c3cae --- /dev/null +++ b/tests/integration/actions/collections/test_direct_interactive_ee.py @@ -0,0 +1,36 @@ +""" collections direct from cli interactive with ee +""" +import pytest + +from .base import BaseClass + +from ..._common import container_runtime_or_fail + + +CLI = ( + "ansible-navigator collections --execution-environment true --ce " + container_runtime_or_fail() +) + +testdata = [ + (0, CLI, "ansible-navigator collections browse window", "Collecting collection content"), + (1, ":0", "Browse testorg.coll_1 plugins window", None), + (2, ":0", "lookup_1 plugin docs window", None), + (3, ":back", "Back to browse testorg.coll_1 plugins window", None), + (4, ":1", "mod_1 plugin docs window", None), + (5, ":back", "Back to browse testorg.coll_1 plugins window", None), + (6, ":back", "Back to ansible-navigator collections browse window", None), + (7, ":1", "Browse testorg.coll_2 plugins window", None), + (8, ":0", "lookup_2 plugin docs window", None), + (9, ":back", "Back to browse testorg.coll_2 plugins window", None), + (10, ":1", "mod_2 plugin docs window", None), + (11, ":back", "Back to browse testorg.coll_2 plugins window", None), + (12, ":back", "Back to ansible-navigator collections browse window", None), +] + + +@pytest.mark.parametrize("index, user_input, comment, collection_fetch_prompt", testdata) +class Test(BaseClass): + """run the tests""" + + EXECUTION_ENVIRONMENT_TEST = True + UPDATE_FIXTURES = False diff --git a/tests/integration/actions/collections/test_direct_interactive_noee.py b/tests/integration/actions/collections/test_direct_interactive_noee.py new file mode 100644 index 000000000..38493daa1 --- /dev/null +++ b/tests/integration/actions/collections/test_direct_interactive_noee.py @@ -0,0 +1,30 @@ +""" collections direct from cli interactive w/o ee +""" +import pytest + +from .base import BaseClass + +CLI = "ansible-navigator collections --execution-environment false" + +testdata = [ + (0, CLI, "ansible-navigator collections browse window", "Collecting collection content"), + (1, ":0", "Browse testorg.coll_1 plugins window", None), + (2, ":0", "lookup_1 plugin docs window", None), + (3, ":back", "Back to browse testorg.coll_1 plugins window", None), + (4, ":1", "mod_1 plugin docs window", None), + (5, ":back", "Back to browse testorg.coll_1 plugins window", None), + (6, ":back", "Back to ansible-navigator collections browse window", None), + (7, ":1", "Browse testorg.coll_2 plugins window", None), + (8, ":0", "lookup_2 plugin docs window", None), + (9, ":back", "Back to browse testorg.coll_2 plugins window", None), + (10, ":1", "mod_2 plugin docs window", None), + (11, ":back", "Back to browse testorg.coll_2 plugins window", None), + (12, ":back", "Back to ansible-navigator collections browse window", None), +] + + +@pytest.mark.parametrize("index, user_input, comment, collection_fetch_prompt", testdata) +class Test(BaseClass): + """run the tests""" + + UPDATE_FIXTURES = False diff --git a/tests/integration/actions/collections/test_welcome_interactive_ee.py b/tests/integration/actions/collections/test_welcome_interactive_ee.py new file mode 100644 index 000000000..cb16de214 --- /dev/null +++ b/tests/integration/actions/collections/test_welcome_interactive_ee.py @@ -0,0 +1,39 @@ +""" collections from welcome interactive w/0 ee +""" +import pytest + +from .base import BaseClass +from ..._common import container_runtime_or_fail + + +CLI = "ansible-navigator --execution-environment true --ce " + container_runtime_or_fail() + +testdata = [ + (0, CLI, "ansible-navigator welcome screen", None), + ( + 1, + ":collections", + "ansible-navigator collections top window", + "Collecting collection content", + ), + (2, ":0", "Browse testorg.coll_1 plugins window", None), + (3, ":0", "lookup_1 plugin docs window", None), + (4, ":back", "Back to browse testorg.coll_1 plugins window", None), + (5, ":1", "mod_1 plugin docs window", None), + (6, ":back", "Back to browse testorg.coll_1 plugins window", None), + (7, ":back", "Back to ansible-navigator collections browse window", None), + (8, ":1", "Browse testorg.coll_2 plugins window", None), + (9, ":0", "lookup_2 plugin docs window", None), + (10, ":back", "Back to browse testorg.coll_2 plugins window", None), + (11, ":1", "mod_2 plugin docs window", None), + (12, ":back", "Back to browse testorg.coll_2 plugins window", None), + (13, ":back", "Back to ansible-navigator collections browse window", None), +] + + +@pytest.mark.parametrize("index, user_input, comment, collection_fetch_prompt", testdata) +class Test(BaseClass): + """run the tests""" + + EXECUTION_ENVIRONMENT_TEST = True + UPDATE_FIXTURES = False diff --git a/tests/integration/actions/collections/test_welcome_interactive_noee.py b/tests/integration/actions/collections/test_welcome_interactive_noee.py new file mode 100644 index 000000000..37bb581a9 --- /dev/null +++ b/tests/integration/actions/collections/test_welcome_interactive_noee.py @@ -0,0 +1,37 @@ +""" collections from welcome interactive w/0 ee +""" +import pytest + +from .base import BaseClass + + +CLI = "ansible-navigator --execution-environment false" + +testdata = [ + (0, CLI, "ansible-navigator welcome screen", None), + ( + 1, + ":collections", + "ansible-navigator collections top window", + "Collecting collection content", + ), + (2, ":0", "Browse testorg.coll_1 plugins window", None), + (3, ":0", "lookup_1 plugin docs window", None), + (4, ":back", "Back to browse testorg.coll_1 plugins window", None), + (5, ":1", "mod_1 plugin docs window", None), + (6, ":back", "Back to browse testorg.coll_1 plugins window", None), + (7, ":back", "Back to ansible-navigator collections browse window", None), + (8, ":1", "Browse testorg.coll_2 plugins window", None), + (9, ":0", "lookup_2 plugin docs window", None), + (10, ":back", "Back to browse testorg.coll_2 plugins window", None), + (11, ":1", "mod_2 plugin docs window", None), + (12, ":back", "Back to browse testorg.coll_2 plugins window", None), + (13, ":back", "Back to ansible-navigator collections browse window", None), +] + + +@pytest.mark.parametrize("index, user_input, comment, collection_fetch_prompt", testdata) +class Test(BaseClass): + """run the tests""" + + UPDATE_FIXTURES = False diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index 9ae1798cf..990f4466e 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -1,4 +1,6 @@ +""" fixtures """ import os +import shutil import pytest from ._common import TmuxSession @@ -27,3 +29,22 @@ def patch_curses(monkeypatch): monkeypatch.setattr(curses, "cbreak", lambda: None) monkeypatch.setattr(curses, "nocbreak", lambda: None) monkeypatch.setattr(curses, "endwin", lambda: None) + + +@pytest.fixture(scope="session") +def os_indendent_tmp(): + """ + this attempts to ensure the length of the /tmp + is the same between MacOS and Linux + otherwise ansible-navigator column widths can vary + """ + tmp_real = os.path.realpath("/tmp") + if tmp_real == "/private/tmp": + an_tmp = os.path.join(tmp_real, "an") + else: + an_tmp = os.path.join("/tmp", "private", "an") + os.makedirs(an_tmp) + try: + yield an_tmp + finally: + shutil.rmtree(an_tmp) diff --git a/tox.ini b/tox.ini index 87ef3b30e..c485b1b04 100644 --- a/tox.ini +++ b/tox.ini @@ -19,7 +19,6 @@ allowlist_externals = cat deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands = - pip install . /bin/bash -c 'grep -FInrq "UPDATE_FIXTURES = True" ./tests && exit 1 || exit 0' /bin/bash -c 'podman pull {[base]default_ee} || docker pull {[base]default_ee}' python3 utilities/doc_updater.py --diff