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 9713758 commit ea48728
Show file tree
Hide file tree
Showing 13 changed files with 42 additions and 20 deletions.
6 changes: 5 additions & 1 deletion changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
Change Log
===========

25.283.0
---------
+ By default, the EPL Apps Tools test framework clears all alarms on the tenant during startup. This behavior can now be disabled by setting the `clearAllActiveAlarmsDuringTenantPreparation` property to `false` in the PySys project configuration.

25.219.0
---------
+ The EPL Apps tools test framework supports Notifications 2.0 for receiving notifications from Cumulocity IoT.
+ The EPL Apps Tools test framework supports Notifications 2.0 for receiving notifications from Cumulocity IoT.

24.0.0
-------
Expand Down
2 changes: 1 addition & 1 deletion doc/performance-testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ For example, to change the test duration of the ``AlarmOnThreshold`` test, run t
pysys run -XtestDuration=180 AlarmOnThreshold
At the end of the test, a basic validation of the test run is performed. See `PySys helpers <https://softwareag.github.io/apama-eplapps-tools>`_ in the EPL Apps Tools documentation for details on validations performed.
At the end of the test, a basic validation of the test run is performed. See `PySys helpers <https://cumulocity-iot.github.io/apama-eplapps-tools>`_ in the EPL Apps Tools documentation for details on validations performed.


Performance report
Expand Down
8 changes: 7 additions & 1 deletion doc/pydoc/_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 doc/pydoc/_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 doc/pydoc/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 doc/pydoc/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 doc/pydoc/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 doc/pydoc/searchindex.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions doc/pydoc/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
6 changes: 4 additions & 2 deletions doc/using-pysys.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ Or for Windows:
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.

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.
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.

You can set the `clearAllActiveAlarmsDuringTenantPreparation` property to `false` in the pysysproject.xml file to disable the default behavior of clearing all active alarms.

Creating a test
----------------
Expand Down Expand Up @@ -167,7 +169,7 @@ Advanced tests

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.

In order to view documentation on classes for PySys helpers for EPL Apps please see: `PySys helpers <https://softwareag.github.io/apama-eplapps-tools>`_ .
In order to view documentation on classes for PySys helpers for EPL Apps please see: `PySys helpers <https://cumulocity-iot.github.io/apama-eplapps-tools>`_ .

See `Testing the performance of your EPL apps and smart rules <performance-testing.rst#testing-the-performance-of-your-epl-apps-and-smart-rules>`_ for details on writing performance tests.

Expand Down
12 changes: 6 additions & 6 deletions readme.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ Use the 'main' branch for the current release or switch to the appropriate branc
Documentation
-------------

Complete documentation for Apama EPL Apps Tools can be found `here <https://softwareag.github.io/apama-eplapps-tools>`_.
Complete documentation for Apama EPL Apps Tools can be found `here <https://cumulocity-iot.github.io/apama-eplapps-tools>`_.

`Using the eplapp.py command line tool <https://softwareag.github.io/apama-eplapps-tools/using-eplapp>`_ is the guide which shows you how to use this tool to perform REST requests to Apama EPL Apps in Cumulocity IoT.
`Using the eplapp.py command line tool <https://cumulocity-iot.github.io/apama-eplapps-tools/using-eplapp>`_ is the guide which shows you how to use this tool to perform REST requests to Apama EPL Apps in Cumulocity IoT.

You can read up on how to use PySys to test your EPL apps in `Using PySys to test EPL apps <https://softwareag.github.io/apama-eplapps-tools/using-pysys>`_.
You can read up on how to use PySys to test your EPL apps in `Using PySys to test EPL apps <https://cumulocity-iot.github.io/apama-eplapps-tools/using-pysys>`_.

To find out how to write a test for your EPL apps look at `Writing tests for EPL apps <https://softwareag.github.io/apama-eplapps-tools/testing-epl>`_.
To find out how to write a test for your EPL apps look at `Writing tests for EPL apps <https://cumulocity-iot.github.io/apama-eplapps-tools/testing-epl>`_.

To find out how to performance test your EPL apps look at `Performance testing EPL apps <https://softwareag.github.io/apama-eplapps-tools/performance-testing>`_.
To find out how to performance test your EPL apps look at `Performance testing EPL apps <https://cumulocity-iot.github.io/apama-eplapps-tools/performance-testing>`_.

In order to view the documentation on classes for PySys helpers for Apama EPL Apps see: `PySys helpers <https://softwareag.github.io/apama-eplapps-tools/autodocgen/apamax.eplapplications.html#module-apamax.eplapplications>`_.
In order to view the documentation on classes for PySys helpers for Apama EPL Apps see: `PySys helpers <https://cumulocity-iot.github.io/apama-eplapps-tools/autodocgen/apamax.eplapplications.html#module-apamax.eplapplications>`_.

See `Apama Documentation <https://documentation.softwareag.com/pam/10.15.5/en>`_, `Streaming Analytics guide <https://cumulocity.com/docs/streaming-analytics>`_ and `PySys Documentation <https://pysys-test.github.io/pysys-test>`_ for further docs.

Expand Down
Loading

0 comments on commit ea48728

Please sign in to comment.