Skip to content

FIWARE/lua-fiware-lib

Repository files navigation

lua-fiware-lib

License badge
CI Status

This library provides several lua modules offering common functionalities required in FIWARE architectures

Requirements:

  • lua >= 5.1
  • openresty >= 1.19.9

This project is part of FIWARE. For more information check the FIWARE Catalogue entry for the API Management.

Installation

The Lua package manager LuaRocks is required.

For installation of the library and all necessary dependencies run:

luarocks make

Testing

The busted framework is used.

OpenResty provides a Docker image which can be used to run the tests without setting up a full environment.

To run the tests:

docker run --rm -it -v $PWD:/fiware openresty/openresty:1.19.9.1-10-alpine-fat \
	/bin/bash -c 'cd /fiware && ./run_tests.sh'

Development

To test during development, run the container and install the busted framework:

docker run --rm -it -v $PWD:/fiware openresty/openresty:1.19.9.1-10-alpine-fat /bin/bash

> cd /fiware
> luarocks install busted

After code changes, compile the lib and run your tests:

> cd /fiware
> luarocks make

# E.g., run ngsi_helper.lua tests
> resty spec/ngsi_helper_spec.lua