Skip to content

Latest commit

 

History

History
39 lines (24 loc) · 1.27 KB

development_guide.md

File metadata and controls

39 lines (24 loc) · 1.27 KB

Development Guide

Tools and Concepts You Need to Know

  • Go, particularly interface.
  • GraphQL - Query language for the Zeabur API.
  • go-graphql-client - GraphQL client for Go.
  • Cobra - CLI framework.
  • Viper - Configuration framework. We use it to unify environment variables, flags, and configuration files.

Familiarity with the following tools will be beneficial:

  • Ginkgo - Behavior Driven Development (BDD) test framework.

Development

  1. Run from Source Code (Recommended)

Run the command you want, e.g., go run cmd/main.go auth login --debug.

  1. Build and Run

Use make build to build the binary.

Run the binary with ./zeabur auth login --debug.

Testing

Run Tests:

  • All tests: make test.
  • Specific package test: cd xxx && go test ./... or cd xxx && ginkgo ..
  • Specific test: cd xxx && ginkgo -focus xxx (where xxx is the Describe name).

Add Tests (using internal/cmd/auth/login as an example):

  1. cd internal/cmd/auth/login.
  2. Run ginkgo bootstrap to generate the suite file login_suite_test.go.
  3. Run ginkgo generate login to create the test file login_test.go.