Skip to content

Latest commit

 

History

History
55 lines (35 loc) · 1.73 KB

development_environment.md

File metadata and controls

55 lines (35 loc) · 1.73 KB

Development Environment Setup

Requirements

  • Go 1.17+ (to build the provider)
  • Terraform (to run integration tests)

Quick Start

Building

Clone the repository:

git clone https://github.com/cloudquery/cq-provider-aws

Build the provider:

make build

Running the provider in debug mode

  1. Download CloudQuery latest version.
  2. Execute make run and note of the CQ_REATTACH_PROVIDERS value.
  3. Open another terminal and run CQ_REATTACH_PROVIDERS=[VALUE_FROM_PREV] ./cloudquery fetch

Make sure the authentication variables are exported in the provider process and not in cloudquery process.

See docs for more details.

Testing

The provider has two types of tests:

  1. Unit Tests - run locally without any credentials and use mocking to return data from AWS APIs.
  2. Integration Tests - run against real AWS APIs and uses test environment defined with terraform under terraform/service_name/

Unit Tests

Unit Tests don't require any credentials or internet access

make test-unit # This runs go test ./...

Unit tests include:

  • Specific resources tests. You can find those next to each resource, in the resources/services folder.
  • DB migration tests. You can find the code for these tests here.
  • Client tests. You can find those in the client folder.

Integration Tests

These are documented in the Adding a new resource guide. See here for more information.