Skip to content

Latest commit

 

History

History
68 lines (43 loc) · 1.65 KB

CONTRIBUTING.md

File metadata and controls

68 lines (43 loc) · 1.65 KB

Contributing

The Astro CLI is a command-line interface for data orchestration. It allows you to get started with Apache Airflow quickly and it can be used with all Astronomer products.

Local development

  1. Install Go 1.19 or later. See Download and install Go.

  2. Clone and build:

    cd $GOPATH/src/github.com/astronomer/astro-cli
    git clone [email protected]:astronomer/astro-cli.git
    cd astro-cli
    make build
  3. Run the following command to install pre-commit and run lint on every commit:

    brew install pre-commit

    pre-commit install

    Run lint locally:

    pre-commit run --all-files

  4. Lint the Go code with the following command:

    make lint

Test locally

To test Astro locally you'll need to update your global or local config to point to right platform type and local Astro endpoint. For example:

local:
  platform: cloud
  astro: http://localhost:8871/v1

Similarly, to test software locally you'll need to update the platform type and local houston endpoint. For example:

local:
  platform: software
  houston: http://localhost:8871/v1

Run tests

Before you run tests, make sure you have running locally houston or Astro on http://localhost:8871/v1. This is a requirement for running some tests.

To run unit-tests run:

make test

Generate mocks

Astronomer uses mockery to generate mocks for Golang interfaces.

To regenerate an existing interface mocks, run make mock.

To generate mocks for a new interface, add it to .mockery.yml and rerun make mock.