This repository contains a set of Python serverless applications.
Simply clone this directory:
$ git clone https://github.com/spyrospav/serverless-examplesTo make use of the benchmark and the tools that come with it, we highly encourage to use the following structure for your application:
-
Move to the
examplesdirectory and create a new directory for your application.$ cd examples $ mkdir app
-
Follow the file specification by naming your main file as
lambda.pyand by putting your Lambda function handler in a function namedhandler.def handler(event, context): ...
-
(Optional) Create the requirements file for your application, e.q. by using:
$ pip freeze > requirements.txt -
Provide some test cases in a file called
data.json. For more details in the structure of this file refer to section Test cases format.
Each test case is JSON object with three proreties/key-value pairs:
"name"corresponding to the test case name."event"corresponding to theeventargument of the lambda handler."context"corresponding to thecontextargument of the lambda handler.
Then, the data.json file contains a list of test cases under the property "tests".
{
"tests": [
{
"name": ...,
"event": ...,
"context": ...
},
...
]
}