Skip to content

Commit

Permalink
Merge pull request #88 from telefonicaid/bug/required_test_probe_parser
Browse files Browse the repository at this point in the history
Add required test probe parser
  • Loading branch information
Fernando López Aguilar committed Nov 29, 2016
2 parents 32ab055 + 242bce7 commit 0615237
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 19 deletions.
49 changes: 31 additions & 18 deletions ngsi_adapter/test/acceptance/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ Acceptance Project Structure
│ │ ├───e2e
│ │ └───integration
│ ├───resources
│ │ └───probe_sample_data
│ │ ├───probe_sample_data
│ │ └───probe_parsers
│ └───settings

Expand All @@ -35,22 +36,44 @@ FIWARE Monitoring Automation Framework
Features:

- Lettuce-Tools support
- Settings using json files and Lettuce-Tools utility
- Test report using Lettuce-Tools XUnit output
- NGSI Adapter Client
- Settings using JSON files and Lettuce-Tools utility
- Test report using Lettuce-Tools xUnit output
- NGSI Adapter client
- Logging
- Remote NGSI Adapter log capturing
- Test data management using templates (resources)


Acceptance tests configuration
==============================

**Local configuration**

Before executing the acceptance tests, you will have configure the properties
file ``ngsi_adapter/test/acceptance/settings/dev-properties.json`` and setup
the attributes to run the tests on the experimentation environment. Please note
that host running NGSI Adapter requires a public IP address to be accessed.

You will also need a valid private key (*private_key_location*) to connect to
NGSI Adapter host to capture remote logs. This way you will be able to execute
scenarios that require the logs capturing for test validations.


**Remote configuration**

Please copy ``ngsi_adapter/test/acceptance/resources/probe_parsers`` somewhere
at NGSI Adapter host and add its full path to the ADAPTER_PARSERS_PATH parameter
in the service configuration file.


Acceptance tests execution
==========================

Execute the following command in the test project root directory:

::

$ cd ngsi_adapter/src/test/acceptance
$ cd ngsi_adapter/test/acceptance
$ lettuce_tools -ft send_data_api_resource -ts comp -sd features/ --tags=-skip -en dev

With this command, you will execute:
Expand All @@ -72,7 +95,7 @@ __ `NGSI Adapter sources`_

**Test case execution using virtualenv**

1. Create a virtual environment somewhere::
1. Create a virtual environment under ``$WORKON_HOME`` directory::

$ virtualenv $WORKON_HOME/venv

Expand All @@ -82,7 +105,7 @@ __ `NGSI Adapter sources`_

#. Go to the acceptance tests folder in the project::

$ cd ngsi_adapter/src/test/acceptance
$ cd ngsi_adapter/test/acceptance

#. Install requirements for the acceptance tests in the virtual environment::

Expand All @@ -99,7 +122,7 @@ As a prerequisite, first download and install Vagrant

1. Go to the acceptance tests folder in the project::

$ cd ngsi_adapter/src/test/acceptance
$ cd ngsi_adapter/test/acceptance

#. Launch a VM from the provided *Vagrantfile*::

Expand All @@ -116,16 +139,6 @@ For more information about how to use Vagrant, please check `this document`__.

__ `Vagrant Getting Started`_

**Settings**

Before executing the acceptance tests, you will have configure the properties
file ``settings/dev-properties.json`` and setup the attributes to run the
acceptance tests on the experimentation environment.

You will also need a valid private key (*private_key_location*) to connect to
NGSI Adapter host to capture remote logs. This way you will be able to execute
scenarios that require the logs capturing for test validations.


.. REFERENCES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ parser.parseRequest = function (reqdomain) {


parser.getContextAttrs = function(probeEntityData) {
var data = probeEntityData.data.split('\n')[0]; // only consider first line of probe data, discard perfData
var data = probeEntityData.data.split('\n')[0]; // only consider first line of probe data, discard perfData
var attrs = { users: NaN };

var items = data.split('-');
Expand Down

0 comments on commit 0615237

Please sign in to comment.