AWS infrastructure testing framework that supports multiple IAC tools.
Project description
B.AwsTestingFramework
A python based AWS infrastructure testing micro-framework.
It supports multiple IAC tools like AWS CDK and AWS CloudFormation.
Description
Creating infrastructure in AWS is quite hard. There are many nuances, pitfalls and "gotchas" that sometimes are awfully frustrating. Often some IAC code changes might result in some unexpected infrastructure changes. That is why the created infrastructure should have automated integration tests. This python based framework provides you basic functionality to help you write unit ant integration tests to test AWS infrastructure created via UI or via tools like AWS CDK.
The framework is based on pytest - a python based testing library. With that said, all pytest functionality and configs can be applied on this framework too.
The framework is easy to use with explicit examples for each IAC tool. Go to examples section and find which example suits you the most.
Remarks
Biomapas aims to modernise life-science industry by sharing its IT knowledge with other companies and the community. This is an open source library intended to be used by anyone. Improvements and pull requests are welcome.
Related technology
- Python 3
- Pytest
- AWS CDK
- AWS CloudFormation
Assumptions
The project assumes the following:
- You have basic-good knowledge in python programming.
- You have basic-good knowledge in AWS.
- You have basic knowledge in testing.
Useful sources
- Read more about pytest:
https://docs.pytest.org/en/latest/
Install
The project is built and uploaded to PyPi. Install it by using pip.
pip install b_aws_testing_framework
Or directly install it through source.
pip install .
Usage & Examples
Testing
The project has tests that can be run. Note, that tests are integration tests inherently because they test how resources are created in AWS environment. Since resources are created and tested in AWS you are subject for all the applicable charges while tests are being run.
Setting environment
Before running tests set an environment variable BIOMAPAS_AWS_TEST_PROFILE
.
This environment variable specifies an aws account to use for deployment and testing.
Usually this profile is called default
when created with aws configure
cli command.
Set on Windows:
set BIOMAPAS_AWS_TEST_PROFILE=default
Set on Linux:
export BIOMAPAS_AWS_TEST_PROFILE=default
Running tests
Then run tests from a root directory with pytest
python testing library.
Testing CloudFormation functionality:
pytest b_aws_testing_framework_test/tools/testing_with_cf
Testing Cloud Development Kit functionality:
pytest b_aws_testing_framework_test/tools/testing_with_cdk
Note that integration tests usually take a while to complete (from 5 to 30 minutes on average).
Contribution
Found a bug? Want to add or suggest a new feature?
Contributions of any kind are gladly welcome. You may contact us
directly, create a pull-request or an issue in github platform.
Lets modernize the world together.
Release history
0.0.4
- Fix imports.
- Update examples.
0.0.3
- Rename project.
- Update gitignore and ignore idea files.
- Update MANIFEST.
- Move examples to a documentation folder.
0.0.2
- Add hyperlinks for examples.
0.0.1
- Initial build.
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
Hashes for b_aws_testing_framework-0.0.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3cff683cbe9b3805b422fd4c38ccc84eb151fa276d2fe0b077b8c4c8cea53c85 |
|
MD5 | 655845be300c89d745b8bb8c6157d877 |
|
BLAKE2b-256 | 8aee7e4d223e0329de5097a05f0d99960f328efe1d85590faa590e8bfc11dc0d |
Hashes for b_aws_testing_framework-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f780ed5415dd0ed4cc91b4cdde886d0d6d2000ab31a289fc6bfb374d9183ec0e |
|
MD5 | c70ea6a3944df0fd707068c19a8a8d25 |
|
BLAKE2b-256 | 3dd4ec199760fde5d49b44855d75d260762b6a83c43b142f984ae5d6e49b477f |