Skip to content

Latest commit

 

History

History
61 lines (38 loc) · 3.4 KB

building-contributing.md

File metadata and controls

61 lines (38 loc) · 3.4 KB

Building, Testing, and Contributing

Pull Requests and PR Preparation

When preparing your pull request, please use a branch name like "2020_<your_username>_short_description" so that it's easy to track to you.

If you're doing a docs-only PR that does not require full testing, please add "[skip ci][ci skip]" to your commit messages; it saves a lot of testing resources.

Docker Image changes

If you make changes to a docker image (like ddev-webserver), it won't have any effect unless you:

  • You can build an image with a specific tag by going to the image directory (like containers/ddev-webserver) by just doing make container VERSION=<branchname> in the containers/ddev-webserver directory.
  • Push a container to hub.docker.com. Push with the tag that matches your branch. Pushing to drud/ddev-webserver repo is easy to accomplish with make push VERSION=<branchname> in the container directory. You might have to use other techniques to push to another repo (docker push)
  • Update pkg/version/version.go with the WebImg and WebTag that relate to the docker image you pushed.

Building

Build the project with make and your resulting executable will end up in .gotmp/bin/ddev (for Linux) or .gotmp/bin/windows_amd64/ddev.exe (for Windows) or .gotmp/bin/darwin/ddev (for macOS).

Build/test/check static analysis with

make # Builds on current os/architecture
make linux_amd64
make linux_arm64
make darwin_amd64
make windows_amd64
make test
make clean
make staticrequired

Testing

Normal test invocation is just make test. Run a single test with an invocation like go test -v -run TestDevAddSites ./pkg/... or make testpkg TESTARGS="-run TestDevAddSites". The easiest way to run tests is from inside the excellent golang IDE Goland. Just click the arrowhead to the left of the test name.

To see which DDEV commands the tests are executing, set the environment variable DDEV_DEBUG=true.

Use GOTEST_SHORT=true to run just one CMS in each test, or GOTEST_SHORT= to run exactly one project type from the list of project types in the TestSites array. For example, GOTEST_SHORT=5 will run many tests only against TYPO3.

Automated testing

Anybody can view the CircleCI automated tests, and they usually show up any problems that are not OS-specific. Just click through on the testing section of the PR to see them.

The Buildkite automated tests require special access, which we typically grant to any PR contributor that asks for it.

Docker image development

The Docker images that DDEV uses are included in the containers/ directory:

  • containers/ddev-webserver: Provides the web servers (the "web" container).
  • containers/ddev-dbserver: Provides the "db" container.
  • containers/ddev-router: The router image
  • containers/ddev-ssh-agent

When changes are made to an image, they have to be temporarily pushed to a tag that is preferably the same as the branch name of the PR, and the tag updated in pkg/version/version.go. Just ask if you need a container pushed to support a PR.

Contributing

Interested in contributing to DDEV-Local? We would love your suggestions, contributions, and help! Please review our Guidelines for Contributing, then create an issue or open a pull request!