Skip to content

Commit

Permalink
Release 25.289.0
Browse files Browse the repository at this point in the history
  • Loading branch information
apamabld committed Oct 14, 2024
1 parent 1c40e82 commit 1dfc136
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 8 deletions.
8 changes: 7 additions & 1 deletion _modules/apamax/eplapplications/basetest.html
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,8 @@ <h1>Source code for apamax.eplapplications.basetest</h1><div class="highlight"><

<div class="viewcode-block" id="ApamaC8YBaseTest.prepareTenant"><a class="viewcode-back" href="../../../autodocgen/apamax.eplapplications.basetest.html#apamax.eplapplications.basetest.ApamaC8YBaseTest.prepareTenant">[docs]</a> <span class="k">def</span> <span class="nf">prepareTenant</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">tenant</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Prepares the tenant for a test by deleting all devices created by previous tests, and clearing all active alarms.</span>
<span class="sd"> Prepares the tenant for a test by deleting all devices created by previous tests and clearing all active alarms.</span>
<span class="sd"> However, you can disable the default behavior of clearing all active alarms by setting the `clearAllActiveAlarmsDuringTenantPreparation` property to `false` in the PySys project configuration.</span>

<span class="sd"> :param tenant: The Cumulocity IoT tenant. If no tenant is specified, the tenant configured in the pysysproject.xml file is prepared.</span>
<span class="sd"> :type tenant: :class:`~apamax.eplapplications.tenant.CumulocityTenant`, optional</span>
Expand Down Expand Up @@ -427,6 +428,11 @@ <h1>Source code for apamax.eplapplications.basetest</h1><div class="highlight"><
<span class="sd"> :param tenant: The Cumulocity IoT tenant.</span>
<span class="sd"> :type tenant: :class:`~apamax.eplapplications.tenant.CumulocityTenant`, optional</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="c1"># EPL Apps tools doesn&#39;t cleanup all alarms on tenant by default</span>
<span class="k">if</span> <span class="nb">getattr</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">project</span><span class="p">,</span> <span class="s1">&#39;clearAllActiveAlarmsDuringTenantPreparation&#39;</span><span class="p">,</span> <span class="s1">&#39;true&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span> <span class="o">==</span> <span class="s1">&#39;false&#39;</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="sa">f</span><span class="s1">&#39;Skipping the alarm cleanup operation due to property clearAllActiveAlarmsDuringTenantPreparation is false&#39;</span><span class="p">)</span>
<span class="k">return</span>

<span class="bp">self</span><span class="o">.</span><span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">&quot;Clearing active alarms&quot;</span><span class="p">)</span>
<span class="n">connection</span> <span class="o">=</span> <span class="p">(</span><span class="n">tenant</span> <span class="ow">or</span> <span class="bp">self</span><span class="o">.</span><span class="n">platform</span><span class="o">.</span><span class="n">getTenant</span><span class="p">())</span><span class="o">.</span><span class="n">getConnection</span><span class="p">()</span>
<span class="n">connection</span><span class="o">.</span><span class="n">do_request_json</span><span class="p">(</span><span class="s1">&#39;PUT&#39;</span><span class="p">,</span> <span class="s1">&#39;/alarm/alarms?status=ACTIVE&#39;</span><span class="p">,</span> <span class="p">{</span><span class="s2">&quot;status&quot;</span><span class="p">:</span> <span class="s2">&quot;CLEARED&quot;</span><span class="p">})</span>
Expand Down
3 changes: 2 additions & 1 deletion _modules/apamax/eplapplications/platform.html
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,8 @@ <h1>Source code for apamax.eplapplications.platform</h1><div class="highlight"><
<span class="n">applications</span> <span class="o">=</span> <span class="n">tenant</span><span class="p">[</span><span class="s1">&#39;applications&#39;</span><span class="p">][</span><span class="s1">&#39;references&#39;</span><span class="p">]</span>
<span class="k">for</span> <span class="n">app</span> <span class="ow">in</span> <span class="n">applications</span><span class="p">:</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_applicationId</span> <span class="o">==</span> <span class="n">app</span><span class="p">[</span><span class="s1">&#39;application&#39;</span><span class="p">][</span><span class="s1">&#39;id&#39;</span><span class="p">]:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">__subscribedTenants</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">CumulocityTenant</span><span class="p">(</span><span class="n">tenant</span><span class="p">[</span><span class="s2">&quot;domain&quot;</span><span class="p">],</span> <span class="bp">self</span><span class="o">.</span><span class="n">username</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">password</span><span class="p">,</span> <span class="n">tenant</span><span class="p">[</span><span class="s2">&quot;id&quot;</span><span class="p">]))</span>
<span class="n">username</span> <span class="o">=</span> <span class="p">(</span><span class="n">tenant</span><span class="p">[</span><span class="s2">&quot;id&quot;</span><span class="p">]</span> <span class="o">+</span> <span class="s1">&#39;/&#39;</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">username</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">&#39;/&#39;</span><span class="p">)[</span><span class="mi">1</span><span class="p">])</span> <span class="k">if</span> <span class="s1">&#39;/&#39;</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">username</span> <span class="k">else</span> <span class="bp">self</span><span class="o">.</span><span class="n">username</span>
<span class="bp">self</span><span class="o">.</span><span class="n">__subscribedTenants</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">CumulocityTenant</span><span class="p">(</span><span class="n">tenant</span><span class="p">[</span><span class="s2">&quot;domain&quot;</span><span class="p">],</span> <span class="n">username</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">password</span><span class="p">,</span> <span class="n">tenant</span><span class="p">[</span><span class="s2">&quot;id&quot;</span><span class="p">]))</span>

<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">__subscribedTenants</span></div></div>
</pre></div>
Expand Down
3 changes: 2 additions & 1 deletion autodocgen/apamax.eplapplications.basetest.html
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@ <h2>ApamaC8YBaseTest<a class="headerlink" href="#apamac8ybasetest" title="Permal
<dl class="py method">
<dt id="apamax.eplapplications.basetest.ApamaC8YBaseTest.prepareTenant">
<code class="sig-name descname">prepareTenant</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">tenant</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/apamax/eplapplications/basetest.html#ApamaC8YBaseTest.prepareTenant"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apamax.eplapplications.basetest.ApamaC8YBaseTest.prepareTenant" title="Permalink to this definition"></a></dt>
<dd><p>Prepares the tenant for a test by deleting all devices created by previous tests, and clearing all active alarms.</p>
<dd><p>Prepares the tenant for a test by deleting all devices created by previous tests and clearing all active alarms.
However, you can disable the default behavior of clearing all active alarms by setting the <code class="xref py py-obj docutils literal notranslate"><span class="pre">clearAllActiveAlarmsDuringTenantPreparation</span></code> property to <code class="xref py py-obj docutils literal notranslate"><span class="pre">false</span></code> in the PySys project configuration.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>tenant</strong> (<a class="reference internal" href="apamax.eplapplications.tenant.html#apamax.eplapplications.tenant.CumulocityTenant" title="apamax.eplapplications.tenant.CumulocityTenant"><code class="xref py py-class docutils literal notranslate"><span class="pre">CumulocityTenant</span></code></a>, optional) – The Cumulocity IoT tenant. If no tenant is specified, the tenant configured in the pysysproject.xml file is prepared.</p>
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ <h2>Introduction<a class="headerlink" href="#introduction" title="Permalink to t
It also provides extensions to the PySys test framework to allow you
to simply write tests for your EPL apps and to run them automatically.</p>
<p>See <a class="reference external" href="https://documentation.softwareag.com/pam/10.15.5/en">Apama Documentation</a> and <a class="reference external" href="https://cumulocity.com/docs/streaming-analytics">Streaming Analytics guide</a> for further docs.
See <a class="reference external" href="https://github.com/SoftwareAG/apama-eplapps-tools">apama-eplapps-tools</a> for the main GitHub repository.</p>
See <a class="reference external" href="https://github.com/Cumulocity-IoT/apama-eplapps-tools">apama-eplapps-tools</a> for the main GitHub repository.</p>
</div>
<div class="section" id="contents">
<h2>Contents<a class="headerlink" href="#contents" title="Permalink to this headline"></a></h2>
Expand Down
2 changes: 1 addition & 1 deletion performance-testing.html
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ <h2>Running the performance test<a class="headerlink" href="#running-the-perform
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>pysys run -XtestDuration<span class="o">=</span><span class="m">180</span> AlarmOnThreshold
</pre></div>
</div>
<p>At the end of the test, a basic validation of the test run is performed. See <a class="reference external" href="https://softwareag.github.io/apama-eplapps-tools">PySys helpers</a> in the EPL Apps Tools documentation for details on validations performed.</p>
<p>At the end of the test, a basic validation of the test run is performed. See <a class="reference external" href="https://cumulocity-iot.github.io/apama-eplapps-tools">PySys helpers</a> in the EPL Apps Tools documentation for details on validations performed.</p>
</div>
<div class="section" id="performance-report">
<h2>Performance report<a class="headerlink" href="#performance-report" title="Permalink to this headline"></a></h2>
Expand Down
2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions using-pysys.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ <h2>Introduction<a class="headerlink" href="#introduction" title="Permalink to t
</pre></div>
</div>
<p>In order to use PySys to test your application, you will need to create a PySys project and some PySys tests under that directory. A sample project with sample tests can be found in the samples and samples-performance directories of this GitHub repository.</p>
<p>You can create an empty PySys project by creating a new directory and copying in the pysysproject.xml from the sample project. The sample project contains essential configuration necessary for testing with Apama and Cumulocity.</p>
<p>You can create an empty PySys project by creating a new directory and copying in the pysysproject.xml from the sample project. The sample project contains the essential configuration necessary for testing with Apama and Cumulocity IoT.</p>
<p>You can set the <code class="xref py py-obj docutils literal notranslate"><span class="pre">clearAllActiveAlarmsDuringTenantPreparation</span></code> property to <code class="xref py py-obj docutils literal notranslate"><span class="pre">false</span></code> in the pysysproject.xml file to disable the default behavior of clearing all active alarms.</p>
</div>
<div class="section" id="creating-a-test">
<h3>Creating a test<a class="headerlink" href="#creating-a-test" title="Permalink to this headline"></a></h3>
Expand Down Expand Up @@ -171,7 +172,7 @@ <h3>Running the test<a class="headerlink" href="#id2" title="Permalink to this h
<div class="section" id="advanced-tests">
<h2>Advanced tests<a class="headerlink" href="#advanced-tests" title="Permalink to this headline"></a></h2>
<p>For anyone who already knows how to use PySys and wants to write Python code for their test running and validation, it is possible to also add a run.py to your test case. We provide samples of tests both running within Apama EPL Apps and with a local correlator in the advanced directory of the samples.</p>
<p>In order to view documentation on classes for PySys helpers for EPL Apps please see: <a class="reference external" href="https://softwareag.github.io/apama-eplapps-tools">PySys helpers</a> .</p>
<p>In order to view documentation on classes for PySys helpers for EPL Apps please see: <a class="reference external" href="https://cumulocity-iot.github.io/apama-eplapps-tools">PySys helpers</a> .</p>
<p>See <a class="reference external" href="performance-testing.html#testing-the-performance-of-your-epl-apps-and-smart-rules">Testing the performance of your EPL apps and smart rules</a> for details on writing performance tests.</p>
<p>To run in Apama EPL Apps, your run.py should look something like this:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">apamax.eplapplications.basetest</span> <span class="kn">import</span> <span class="n">ApamaC8YBaseTest</span>
Expand Down

0 comments on commit 1dfc136

Please sign in to comment.