Skip to content

Commit

Permalink
Add baseline test.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfontein committed Aug 25, 2024
1 parent bad66c8 commit e5b1ff8
Show file tree
Hide file tree
Showing 3 changed files with 295 additions and 1 deletion.
283 changes: 283 additions & 0 deletions tests/functional/baseline-plugin/ns2.col.foo_lookup.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,283 @@
.. Document meta
:orphan:

.. |antsibull-internal-nbsp| unicode:: 0xA0
:trim:

.. meta::
:antsibull-docs: <ANTSIBULL_DOCS_VERSION>

.. Anchors
.. _ansible_collections.ns2.col.foo_lookup:

.. Anchors: short name for ansible.builtin
.. Title
ns2.col.foo lookup -- Look up some foo :ansopt:`ns2.col.foo#lookup:bar`
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

.. Collection note
.. note::
This lookup plugin is part of the `ns2.col collection <https://galaxy.ansible.com/ui/repo/published/ns2/col/>`_.

It is not included in ``ansible-core``.
To check whether it is installed, run :code:`ansible-galaxy collection list`.

To install it, use: :code:`ansible-galaxy collection install ns2.col`.

To use it in a playbook, specify: :code:`ns2.col.foo`.

.. version_added
.. rst-class:: ansible-version-added

New in ns2.col 1.0.0

.. contents::
:local:
:depth: 1

.. Deprecated
Synopsis
--------

.. Description
- This looks up some foo.
- Whatever that is.


.. Aliases
.. Requirements
.. Terms
Terms
-----

.. tabularcolumns:: \X{1}{3}\X{2}{3}

.. list-table::
:width: 100%
:widths: auto
:header-rows: 1
:class: longtable ansible-option-table

* - Parameter
- Comments

* - .. raw:: html

<div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-_terms"></div>

.. _ansible_collections.ns2.col.foo_lookup__parameter-_terms:

.. rst-class:: ansible-option-title

**Terms**

.. raw:: html

<a class="ansibleOptionLink" href="#parameter-_terms" title="Permalink to this option"></a>

.. ansible-option-type-line::

:ansible-option-type:`list` / :ansible-option-elements:`elements=string` / :ansible-option-required:`required`




.. raw:: html

</div>

- .. raw:: html

<div class="ansible-option-cell">

The stuff to look up.


.. raw:: html

</div>





.. Options
Keyword parameters
------------------

This describes keyword parameters of the lookup. These are the values ``key1=value1``, ``key2=value2`` and so on in the following
examples: ``lookup('ns2.col.foo', key1=value1, key2=value2, ...)`` and ``query('ns2.col.foo', key1=value1, key2=value2, ...)``

.. tabularcolumns:: \X{1}{3}\X{2}{3}

.. list-table::
:width: 100%
:widths: auto
:header-rows: 1
:class: longtable ansible-option-table

* - Parameter
- Comments

* - .. raw:: html

<div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-bar"></div>

.. _ansible_collections.ns2.col.foo_lookup__parameter-bar:

.. rst-class:: ansible-option-title

**bar**

.. raw:: html

<a class="ansibleOptionLink" href="#parameter-bar" title="Permalink to this option"></a>

.. ansible-option-type-line::

:ansible-option-type:`string`




.. raw:: html

</div>

- .. raw:: html

<div class="ansible-option-cell">

Foo bar.


.. raw:: html

</div>


.. Attributes
.. Notes
Notes
-----

.. note::
- When keyword and positional parameters are used together, positional parameters must be listed before keyword parameters:
``lookup('ns2.col.foo', term1, term2, key1=value1, key2=value2)`` and ``query('ns2.col.foo', term1, term2, key1=value1, key2=value2)``

.. Seealso
.. Examples
Examples
--------

.. code-block:: yaml+jinja

- name: Look up bar
ansible.builtin.debug:
msg: "{{ lookup('ns2.col.foo', 'bar') }}"



.. Facts
.. Return values
Return Value
------------

.. tabularcolumns:: \X{1}{3}\X{2}{3}

.. list-table::
:width: 100%
:widths: auto
:header-rows: 1
:class: longtable ansible-option-table

* - Key
- Description

* - .. raw:: html

<div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="return-_raw"></div>

.. _ansible_collections.ns2.col.foo_lookup__return-_raw:

.. rst-class:: ansible-option-title

**Return value**

.. raw:: html

<a class="ansibleOptionLink" href="#return-_raw" title="Permalink to this return value"></a>

.. ansible-option-type-line::

:ansible-option-type:`list` / :ansible-option-elements:`elements=string`

.. raw:: html

</div>

- .. raw:: html

<div class="ansible-option-cell">

The resulting stuff.


.. rst-class:: ansible-option-line

:ansible-option-returned-bold:`Returned:` success


.. raw:: html

</div>



.. Status (Presently only deprecated)
.. Authors
Authors
~~~~~~~

- Felix Fontein (@felixfontein)


.. hint::
Configuration entries for each entry type have a low to high priority order. For example, a variable that is lower in the list will override a variable that is higher up.

.. Extra links
.. Parsing errors
3 changes: 2 additions & 1 deletion tests/functional/build-docs-baseline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ make_docsite_baseline() {
echo "Building baseline ${DEST}..."
rm -rf "${DEST}"
mkdir -p "${DEST}"
ANSIBLE_COLLECTIONS_PATHS= ANSIBLE_COLLECTIONS_PATH=collections/ python antsibull-docs-stub.py collection --dest-dir "${DEST}" --use-current "$@" 2>&1 | (
ANSIBLE_COLLECTIONS_PATHS= ANSIBLE_COLLECTIONS_PATH=collections/ python antsibull-docs-stub.py ${COMMAND:-collection --use-current} --dest-dir "${DEST}" "$@" 2>&1 | (
set +e
grep -v "ERROR:antsibull:func=create_plugin_rst:mod=antsibull_docs.write_docs.plugins:nonfatal_errors="
set -e
Expand Down Expand Up @@ -47,6 +47,7 @@ make_docsite_baseline baseline-no-breadcrumbs ns.col1 ns.col2 ns2.col ns2.flatco
make_docsite_baseline baseline-no-indexes ns.col1 ns2.col ns2.flatcol --fail-on-error --no-indexes --no-add-antsibull-docs-version
make_docsite_baseline baseline-use-html-blobs ns2.col --fail-on-error --use-html-blobs
make_docsite_baseline baseline-squash-hierarchy ns2.col --fail-on-error --squash-hierarchy
COMMAND="plugin" make_docsite_baseline baseline-plugin --plugin-type lookup ns2.col.foo --fail-on-error
make_docsite_baseline baseline-simplified-rst ns.col1 ns.col2 ns2.col ns2.flatcol --output-format simplified-rst
make_docsite_baseline baseline-simplified-rst-squash-hierarchy ns2.col --fail-on-error --squash-hierarchy --no-add-antsibull-docs-version --output-format simplified-rst

Expand Down
10 changes: 10 additions & 0 deletions tests/functional/test_docs_baseline.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,16 @@
],
"baseline-squash-hierarchy",
),
(
[
"plugin",
"--plugin-type",
"lookup",
"ns2.col.foo",
"--fail-on-error",
],
"baseline-plugin",
),
(
[
"collection",
Expand Down

0 comments on commit e5b1ff8

Please sign in to comment.