mirror of
https://github.com/kubevirt/kubevirt.core.git
synced 2026-05-06 13:22:38 +00:00
Update docs for main
Signed-off-by: kubevirt-bot <kubevirtbot@redhat.com>
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
<script src="_static/jquery.js?v=5d32c60e"></script>
|
||||
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
|
||||
<script src="_static/documentation_options.js?v=5929fcd5"></script>
|
||||
<script src="_static/doctools.js?v=888ff710"></script>
|
||||
<script src="_static/doctools.js?v=9a2dae69"></script>
|
||||
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
|
||||
<script src="_static/js/theme.js"></script>
|
||||
<link rel="index" title="Index" href="genindex.html" />
|
||||
@@ -55,11 +55,21 @@
|
||||
<p class="caption" role="heading"><span class="caption-text">Developer documentation</span></p>
|
||||
<ul class="current">
|
||||
<li class="toctree-l1 current"><a class="current reference internal" href="#">Testing</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#continuous-integration">Continuous integration</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#sanity-and-unit-tests">Sanity and unit tests</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#running-tests-with-tox-ansible">Running tests with tox-ansible</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#running-tests-with-ansible-test">Running tests with ansible-test</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#integration-tests">Integration tests</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#continuous-integration">Continuous integration</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#running-integration-tests-with-ansible-test">Running integration tests with ansible test</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#example-config-and-playbooks">Example config and playbooks</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="developing.html">Contributor’s Guidelines</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="developing.html#development-environment">Development environment</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="releasing.html">Collection Versioning Strategy</a></li>
|
||||
</ul>
|
||||
<p class="caption" role="heading"><span class="caption-text">General</span></p>
|
||||
@@ -93,9 +103,74 @@
|
||||
|
||||
<section id="testing">
|
||||
<h1>Testing<a class="headerlink" href="#testing" title="Link to this heading"></a></h1>
|
||||
<section id="sanity-and-unit-tests">
|
||||
<h2>Sanity and unit tests<a class="headerlink" href="#sanity-and-unit-tests" title="Link to this heading"></a></h2>
|
||||
<p>Sanity and unit tests can be run in two ways:</p>
|
||||
<ul class="simple">
|
||||
<li><p>with <code class="docutils literal notranslate"><span class="pre">tox</span></code> and the <code class="docutils literal notranslate"><span class="pre">tox-ansible</span></code> plugin (both need to be installed on the dev machine)</p></li>
|
||||
<li><p>with <code class="docutils literal notranslate"><span class="pre">ansible-test</span></code></p></li>
|
||||
</ul>
|
||||
<p>For development purposes <code class="docutils literal notranslate"><span class="pre">tox</span></code> and <code class="docutils literal notranslate"><span class="pre">tox-ansible</span></code> are better suited, as they allow
|
||||
debugging of issues in the collection on the developer’s machine.</p>
|
||||
<p>For verification purposes of the collection the compatibility with <code class="docutils literal notranslate"><span class="pre">ansible-test</span></code>
|
||||
is ensured.</p>
|
||||
<section id="running-tests-with-tox-ansible">
|
||||
<h3>Running tests with tox-ansible<a class="headerlink" href="#running-tests-with-tox-ansible" title="Link to this heading"></a></h3>
|
||||
<p>Run sanity tests with <code class="docutils literal notranslate"><span class="pre">tox-ansible</span></code> like so:</p>
|
||||
<div class="highlight-YAML+Jinja notranslate"><div class="highlight"><pre><span></span><span class="l l-Scalar l-Scalar-Plain">make test-sanity</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>Run unit tests with <code class="docutils literal notranslate"><span class="pre">tox-ansible</span></code> like so:</p>
|
||||
<div class="highlight-YAML+Jinja notranslate"><div class="highlight"><pre><span></span><span class="l l-Scalar l-Scalar-Plain">make test-unit</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</section>
|
||||
<section id="running-tests-with-ansible-test">
|
||||
<h3>Running tests with ansible-test<a class="headerlink" href="#running-tests-with-ansible-test" title="Link to this heading"></a></h3>
|
||||
<p>In order to test changes with <code class="docutils literal notranslate"><span class="pre">ansible-test</span></code>, it is recommended to bind mount
|
||||
the repository to <code class="docutils literal notranslate"><span class="pre">~/.ansible/collections/ansible_collections/kubevirt/core</span></code>
|
||||
if you did not check it out into this location.</p>
|
||||
<p>This can be done with:</p>
|
||||
<div class="highlight-YAML+Jinja notranslate"><div class="highlight"><pre><span></span><span class="l l-Scalar l-Scalar-Plain">mkdir -p ~/.ansible/collections/ansible_collections/kubevirt/core</span>
|
||||
<span class="l l-Scalar l-Scalar-Plain">sudo mount --bind <project_dir>/kubevirt.core ~/.ansible/collections/ansible_collections/kubevirt/core</span>
|
||||
<span class="l l-Scalar l-Scalar-Plain">cd ~/.ansible/collections/ansible_collections/kubevirt/core</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>Run sanity tests with <code class="docutils literal notranslate"><span class="pre">ansible-test</span></code> like so:</p>
|
||||
<div class="highlight-YAML+Jinja notranslate"><div class="highlight"><pre><span></span><span class="l l-Scalar l-Scalar-Plain">ANSIBLE_TEST_PREFER_PODMAN=1 ansible-test sanity --docker</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>Run unit tests with <code class="docutils literal notranslate"><span class="pre">ansible-test</span></code> like so:</p>
|
||||
<div class="highlight-YAML+Jinja notranslate"><div class="highlight"><pre><span></span><span class="l l-Scalar l-Scalar-Plain">ANSIBLE_TEST_PREFER_PODMAN=1 ansible-test units --docker</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="integration-tests">
|
||||
<h2>Integration tests<a class="headerlink" href="#integration-tests" title="Link to this heading"></a></h2>
|
||||
<p>Integration tests require a working cluster and can be run with
|
||||
<code class="docutils literal notranslate"><span class="pre">ansible-test</span></code>.</p>
|
||||
<section id="continuous-integration">
|
||||
<h2>Continuous integration<a class="headerlink" href="#continuous-integration" title="Link to this heading"></a></h2>
|
||||
<p>The <code class="docutils literal notranslate"><span class="pre">hack/e2e-setup.sh</span></code> script contains the steps necessary to reproduce the CI test environment, which relies on <code class="docutils literal notranslate"><span class="pre">kubectl</span></code> and <code class="docutils literal notranslate"><span class="pre">kind</span></code>.</p>
|
||||
<h3>Continuous integration<a class="headerlink" href="#continuous-integration" title="Link to this heading"></a></h3>
|
||||
<p>The <code class="docutils literal notranslate"><span class="pre">hack/e2e-setup.sh</span></code> script contains the steps necessary to reproduce the
|
||||
CI integration test environment, which relies on <code class="docutils literal notranslate"><span class="pre">docker</span></code> or <code class="docutils literal notranslate"><span class="pre">podman</span></code>,
|
||||
<code class="docutils literal notranslate"><span class="pre">kubectl</span></code> and <code class="docutils literal notranslate"><span class="pre">kind</span></code>.</p>
|
||||
<p>To create the CI integration test environment on your machine run:</p>
|
||||
<div class="highlight-YAML+Jinja notranslate"><div class="highlight"><pre><span></span><span class="l l-Scalar l-Scalar-Plain">make cluster-up</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>To remove the test CI integration test environment run:</p>
|
||||
<div class="highlight-YAML+Jinja notranslate"><div class="highlight"><pre><span></span><span class="l l-Scalar l-Scalar-Plain">make cluster-down</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</section>
|
||||
<section id="running-integration-tests-with-ansible-test">
|
||||
<h3>Running integration tests with ansible test<a class="headerlink" href="#running-integration-tests-with-ansible-test" title="Link to this heading"></a></h3>
|
||||
<p>Run integration tests with ansible-test like so:</p>
|
||||
<div class="highlight-YAML+Jinja notranslate"><div class="highlight"><pre><span></span><span class="l l-Scalar l-Scalar-Plain">ansible-test integration</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="example-config-and-playbooks">
|
||||
<h2>Example config and playbooks<a class="headerlink" href="#example-config-and-playbooks" title="Link to this heading"></a></h2>
|
||||
|
||||
Reference in New Issue
Block a user