# vector-component-tests

# Pytest-based Test Automation Framework for the VECTOR components

Overview
=============

* Require Python 3.11+ version.
* Framework is based on pytest.
* Added HTML reporting tool.
* Reading credentials from environment variables.

This framework covers component and integration testing of VECTOR orchestra.
Details of the coverage can be found in
notion https://www.notion.so/Vector-Component-Testing-d88338e127104f0cae5cc569ec4ef1ba

# Quickstart

## Prerequisites (macOS)

Install MySQL client libraries required to build `mysqlclient`:

```zsh
brew install pkg-config mysql-client
export PKG_CONFIG_PATH="$(brew --prefix mysql-client)/lib/pkgconfig"
```

Add the export to your `~/.zshrc` to make it permanent.

Ensure your aws user has access to the cypress application family
family (https://www.notion.so/AWS-Engineer-Permissions-Model-24f9c067f6ea4b0d986401b717bde731#674d5d917db247ab81bee93f20bdeb52)
and have an active MFA session using awsume.

1. Setup virtual environment:

```
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
```

2. Set the LAMBDA_DIR variable to the lambda you wish to run tests for using the directory names from the lambda-vector
   repo https://github.com/theorchard/lambda-vector/tree/master/lambda . E.g

```
   export LAMBDA_DIR=ar_to_ddb_sync
```

3. Run the tests:

```
   make run_lambda_tests
```

# Docker

You can easily run the tests in docker to avoid the local environment setup by having an active MFA session using
awsume, exporting the LAMBDA_DIR variable for the desired lambda and running:

```
   make docker_run_lambda_tests
```

# Reporting

You can find the html report in:

```
   /html_report
```