Building, Testing, and Contributing

Pull Requests and PR Preparation

When preparing your pull request, please use a branch name like "2020__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 make linux make darwin make windows 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/phpmyadmin: Provides the phpmyadmin (dba) container
  • containers/ddev-router: The router image

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? We would love your suggestions, contributions, and help! Please review our Guidelines for Contributing, then create an issue or open a pull request!