An Amazon AWS DynamoDB big data testing library for Robot Framework with SQL-like DSL
Project description
Introduction
DynamoDB SQL Library is a big data testing library for Robot Framework that gives you the capability to execute scan and query operations against multi Amazon DynamoDB sessions simultaneously using a SQL-like DSL.
It leverages DynamoDB Query Languange (DQL) internally to provide a SQL-like DSL for Amazon DynamoDB.
More information about DQL queries can be found in the DQL Queries Documentation.
More information about this library can be found in the Keyword Documentation.
Example
Create DynamoDB Session |
us-west-2 |
label=oregon |
|
Create DynamoDB Session |
ap-southeast-1 |
label=singapore |
|
Create DynamoDB Session |
eu-central-1 |
label=frankfurt |
|
Query DynamoDB |
oregon |
CREATE TABLE mine (id STRING HASH KEY) |
|
Query DynamoDB |
singapore |
CREATE TABLE mine (id STRING HASH KEY) |
|
Query DynamoDB |
frankfurt |
CREATE TABLE mine (id STRING HASH KEY) |
|
DynamoDB Table Should Exist |
oregon |
mine |
|
DynamoDB Table Should Exist |
singapore |
mine |
|
DynamoDB Table Should Exist |
frankfurt |
mine |
|
Query DynamoDB |
oregon |
INSERT INTO mine (id) VALUES (‘oregon’) |
|
Query DynamoDB |
singapore |
INSERT INTO mine (id) VALUES (‘singapore’) |
|
Query DynamoDB |
frankfurt |
INSERT INTO mine (id) VALUES (‘frankfurt’) |
|
@{oregon} = |
Query DynamoDB |
oregon |
SCAN mine |
@{singapore} = |
Query DynamoDB |
singapore |
SCAN mine |
@{frankfurt} = |
Query DynamoDB |
frankfurt |
SCAN mine |
List And JSON String Should Be Equal |
${oregon} |
[{“id”:”oregon”}] |
|
List And JSON String Should Be Equal |
${singapore} |
[{“id”:”singapore”}] |
|
List And JSON String Should Be Equal |
${frankfurt} |
[{“id”:”frankfurt”}] |
|
Delete All Dynamodb Sessions |
Config and Credentials File
Set up config file in default location:
~/.aws/config (Linux/Mac)
%USERPROFILE%.aws\config (Windows)
[default]
region = us-east-1
Set up credentials file in default location:
~/.aws/credentials (Linux/Mac)
%USERPROFILE%.aws\credentials (Windows)
[default]
aws_access_key_id = YOUR_KEY
aws_secret_access_key = YOUR_SECRET
[another_profile]
aws_access_key_id = ANOTHER_KEY
aws_secret_access_key = ANOTHER_SECRET
region = us-west-1
Installation
Using pip
The recommended installation method is using pip:
python -m pip install robotframework-dynamodbsqllibrary
The main benefit of using pip is that it automatically installs all dependencies needed by the library. Other nice features are easy upgrading and support for un-installation:
python -m pip install --upgrade robotframework-dynamodbsqllibrary
python -m pip uninstall robotframework-dynamodbsqllibrary
Notice that using --upgrade above updates both the library and all its dependencies to the latest version. If you want, you can also install a specific version or upgrade only the dql package used by the library:
python -m pip install robotframework-dynamodbsqllibrary==x.x.x
python -m pip install --upgrade dql
python -m pip install dql==x.x.x
Proxy configuration
If you are behind a proxy, you can use --proxy command line option or set http_proxy and/or https_proxy environment variables to configure pip to use it. If you are behind an authenticating NTLM proxy, you may want to consider installing CNTML to handle communicating with it.
For more information about --proxy option and using pip with proxies in general see:
Manual installation
If you do not have network connection or cannot make proxy to work, you need to resort to manual installation. This requires installing both the library and its dependencies yourself.
Make sure you have Robot Framework installed.
Download source distributions (*.tar.gz) for the library and its dependencies:
Download PGP signatures (*.tar.gz.asc) for signed packages.
Find each public key used to sign the package:
gpg --keyserver pgp.mit.edu --search-keys D1406DE7
Select the number from the list to import the public key
Verify the package against its PGP signature:
gpg --verify robotframework-dynamodbsqllibrary-x.x.x.tar.gz.asc robotframework-dynamodbsqllibrary-x.x.x.tar.gz
Extract each source distribution to a temporary location.
Go to each created directory from the command line and install each project using:
python setup.py install
If you are on Windows, and there are Windows installers available for certain projects, you can use them instead of source distributions. Just download 32bit or 64bit installer depending on your system, double-click it, and follow the instructions.
Directory Layout
- doc/
- src/
Python source code
- test/
Test files
- atest/
Robot Framework acceptance test
- utest/
Python unit test
Usage
To write tests with Robot Framework and DynamoDB SQL Library, DynamoDB SQL Library must be imported into your Robot test suite. See Robot Framework User Guide for more information.
More information about Robot Framework standard libraries and built-in tools can be found in the Robot Framework Documentation.
Building Keyword Documentation
The Keyword Documentation can be found online, if you need to generate the keyword documentation, run:
make doc
Run Unit Tests, Acceptance Tests, and Test Coverage Report
Test the testing library, talking about dogfooding, let’s run:
make test
Contributing
If you would like to contribute code to DynamoDB SQL Library repository, you can do so through GitHub by forking the repository and sending a pull request.
If you do not agree to Contribution Agreement, do not contribute any code to DynamoDB SQL Library repository.
When submitting code, please make every effort to follow existing conventions and style in order to keep the code as readable as possible. Please also include appropriate test cases.
That’s it! Thank you for your contribution!
License
Copyright (c) 2014 - 2023 Richard Huang.
This library is free software, licensed under: GNU Affero General Public License (AGPL-3.0).
Documentation and other similar content are provided under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file robotframework-dynamodbsqllibrary-0.3.1.tar.gz
.
File metadata
- Download URL: robotframework-dynamodbsqllibrary-0.3.1.tar.gz
- Upload date:
- Size: 79.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf03a400e32125185179877c87c66584293b2eab88ab2ef3fbedffb656010914 |
|
MD5 | f79af8214a588209b0e4af9cf2de87a1 |
|
BLAKE2b-256 | d6c7f1a77092b9df79e2780581d5f8d625dd0da04ed558f2fe6e5e35c09edc18 |
File details
Details for the file robotframework_dynamodbsqllibrary-0.3.1-py2.py3-none-any.whl
.
File metadata
- Download URL: robotframework_dynamodbsqllibrary-0.3.1-py2.py3-none-any.whl
- Upload date:
- Size: 27.2 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3068546e222921c6bfab23df56149e53e03ab9742824eb86f71be05d3c09aaa7 |
|
MD5 | c79e761fe72a5ce7b894e10daff1cdbc |
|
BLAKE2b-256 | 95edbc59f950c98e80f8c5009f7b82fbc1857a774d0d90527593cdf3eb264c96 |