- Git
- macOS: (built-in)
- Windows:
choco install git -ygit config --global core.autocrlf false
- Go
- macOS:
brew install go - Windows:
choco install golang -y
- macOS:
- Docker
- Make (and build tools)
- macOS:
xcode-select --install - Windows:
choco install cygwin make -y[Environment]::SetEnvironmentVariable("PATH", "C:\tools\cygwin\bin;$ENV:PATH", "MACHINE")
- macOS:
- Symlinks - Some of our tests attempt to create symlinks. On Windows, this requires the permission to be provided.
To build pack:
make build
This will output the binary to the directory out/.
Options:
| ENV_VAR | Description | Default |
|---|---|---|
| GOCMD | Change the go executable. For example, richgo for testing. |
go |
| PACK_BIN | Change the name or location of the binary relative to out/. |
pack |
| PACK_VERSION | Tell pack what version to consider itself |
dev |
NOTE: This project uses go modules for dependency management.
To run unit and integration tests:
make unitTo run acceptance tests:
make acceptanceAlternately, to run all tests:
make testTo run our full acceptance suite (including cross-compatibility for n-1 pack and lifecycl):
make acceptance-allTo format the code:
make formatTo tidy up the codebase and dependencies:
make tidyTo verify formatting and code quality:
make verifyRuns various checks to ensure compliance:
make prepare-for-prSome options users can provide to our acceptance tests are:
| ENV_VAR | Description | Default |
|---|---|---|
| ACCEPTANCE_SUITE_CONFIG | A set of configurations for how to run the acceptance tests, describing the version of pack used for testing, the version of pack used to create the builders used in the test, and the version of lifecycle binaries used to test with Github |
[{"pack": "current", "pack_create_builder": "current", "lifecycle": "default"}]' |
| COMPILE_PACK_WITH_VERSION | Tell pack what version to consider itself |
dev |
| GITHUB_TOKEN | A Github Token, used when downloading pack and lifecycle releases from Github during the test setup |
"" |
| PACK_PATH | Path to a pack executable. |
A compiled version of the current branch |
| PREVIOUS_PACK_PATH | Path to a pack executable, used to test compatibility with n-1 version of pack |
The most recent release from pack's Github release |
| PREVIOUS_PACK_FIXTURES_PATH | Path to a set of fixtures, used to override the most up-to-date fixtures, in case of changed functionality | acceptance/testdata/pack_previous_fixtures_overrides |
| LIFECYCLE_PATH | Path to a .tgz file filled with a set of lifecycle binaries |
The Github release for the default version of lifecycle in pack |
| PREVIOUS_LIFECYCLE_PATH | Path to a .tgz file filled with a set of lifecycle binaries, used to test compatibility of pack with the n-1 version of the lifecycle |
The Github release for n-1 release of lifecycle |