Skip to content

Latest commit

 

History

History
84 lines (52 loc) · 3.86 KB

CONTRIBUTING.md

File metadata and controls

84 lines (52 loc) · 3.86 KB

Contributing

PRs are welcome!

The following sections will include the required steps to develop and run tests for this project.

The project contains unit, integration, and e2e tests that are within the tests/ directory. Each of the tests uses the Pytest framework.

NOTE: All Terraform resources will automatically be deleted during the PyTest session cleanup. If the provisioned resources are needed after the PyTest execution,
use the `--skip-tf-destroy` flag (e.g. `pytest tests/e2e --skip-tf-destroy`). BEWARE: If the resources are left alive after the tests, the AWS account may incur additional charges.

Requirements

The following tools are required:

Steps

  1. Clone this repo by running the CLI command: git clone https://github.com/marshall7m/terraform-aws-infrastructure-live-ci.git
  2. Within your CLI, change directories to root of the repo
  3. Ensure that the environment variables from the ./.devcontainer/docker-compose.yml file's environment: section are set. For a description of the TF_VAR_* variables, see the tests/unit/variables.tf and tests/e2e/variables.tf files.

Once you complete the above steps, you can choose from the following sections depending on your preference

Full Development Environment via VsCode

The following additional tools are required:

To launch a full-fledged development docker container that includes all the dependencies needed for this project, see this section's instructions.

Run tests via Docker Compose

To just run the tests, the docker compose plugin can be used to launch the dev service within the .devcontainer/docker-compose.yml file with the associated testing command.

Requirements

The following additional tools are required:

To execute the tests from the repo's root directory, run commands like so:

  • docker compose -f ./.devcontainer/docker-compose.yml run --rm dev pytest tests/unit

  • docker compose -f ./.devcontainer/docker-compose.yml run --rm dev pytest tests/integration

All the containers that the dev service depends on will be launched within the same custom docker bridge network.

Local GitHub Actions Workflow

The steps below will run the GitHub Actions workflow via act within local Docker containers.

Requirements

The following additional tools are required:

Steps

  1. Run the following command: act push. This will run the GitHub workflow logic for push events
  2. A prompt will arise requesting GitHub Action secrets needed to run the workflow. Fill in the secrets accordingly. The secrets can be set via environment variables to skip the prompt. For a description of the TF_VAR_* variables, see the unit testing variables.tf and e2e testing variables.tf file.
NOTE: All Terraform resources will automatically be deleted during the PyTest session cleanup