Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore custom "live" command #2296

Merged
merged 9 commits into from
Jun 6, 2020
6 changes: 6 additions & 0 deletions cmd/ddev/cmd/commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,10 @@ columns_priv`)
out, err = exec.RunCommand(DdevBin, []string{"testwebcmd", "webarg1", "webarg2", "--webflag1"})
assert.NoError(err)
assert.Contains(out, "Test Web Command was executed with args=webarg1 webarg2 --webflag1 on host "+site.Name+"-web")

// Make sure that all the official custom commands are usable by just checking help
for _, c := range []string{"myssql", "launch", "live", "xdebug"} {
_, err = exec.RunCommand(DdevBin, []string{"help", c})
assert.NoError(err, "Failed to run ddev help %s", c)
}
}
2 changes: 2 additions & 0 deletions cmd/ddev/cmd/packrd/packed-packr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bats

@test "verify customization of nginx configuration" {
docker exec -t $CONTAINER_NAME grep "docroot is /var/www/html/potato in custom conf" //etc/nginx/sites-enabled/nginx-site.conf
docker exec -t $CONTAINER_NAME bash -c "grep 'docroot is /var/www/html/potato in custom conf' /etc/nginx/sites-enabled/nginx-site.conf"
}

@test "verify customization of php configuration" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
}

@test "verify that project-specific config has been linked in ($project_type)" {
docker exec -t $CONTAINER_NAME grep "# ddev $project_type config" //etc/nginx/nginx-site.conf
docker exec $CONTAINER_NAME bash -c "grep \"# ddev $project_type config\" /etc/nginx/nginx-site.conf"
}

@test "verify that the right default PHP version was selected for the project_type ($project_type)" {
Expand Down
2 changes: 1 addition & 1 deletion containers/ddev-webserver/tests/ddev-webserver/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ for project_type in drupal6 drupal7 drupal8 drupal9 typo3 backdrop wordpress def
cleanup
done

docker run -u "$MOUNTUID:$MOUNTGID" -p $HOST_HTTP_PORT:$CONTAINER_HTTP_PORT -p $HOST_HTTPS_PORT:$CONTAINER_HTTPS_PORT -e "DOCROOT=potato" -e "DDEV_PHP_VERSION=7.3" -v "/$PWD/tests/ddev-webserver/testdata:/mnt/ddev_config:ro" -v ddev-global-cache:/mnt/ddev-global-cache -d --name $CONTAINER_NAME -d $DOCKER_IMAGE >/dev/null
docker run -u "$MOUNTUID:$MOUNTGID" -p $HOST_HTTP_PORT:$CONTAINER_HTTP_PORT -p $HOST_HTTPS_PORT:$CONTAINER_HTTPS_PORT -e "DOCROOT=potato" -e "DDEV_PHP_VERSION=7.3" --mount "type=bind,src=$PWD/tests/ddev-webserver/testdata,target=/mnt/ddev_config" -v ddev-global-cache:/mnt/ddev-global-cache -d --name $CONTAINER_NAME -d $DOCKER_IMAGE >/dev/null
containerwait

bats tests/ddev-webserver/custom_config.bats
Expand Down
2 changes: 1 addition & 1 deletion pkg/ddevapp/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,7 @@ func PrepDdevDirectory(dir string) error {
}
}

err := CreateGitIgnore(dir, "commands/.gitattributes", "commands/*/*.example", "commands/*/README.txt", "commands/host/launch", "commands/web/xdebug", "commands/db/mysql", "homeadditions/*.example", "homeadditions/README.txt", ".gitignore", "import.yaml", ".ddev-docker-compose-base.yaml", ".ddev-docker-compose-full.yaml", "db_snapshots", "sequelpro.spf", "import-db", "config.*.y*ml", ".webimageBuild", ".dbimageBuild", ".sshimageBuild", ".webimageExtra", ".dbimageExtra", "*-build/Dockerfile.example")
err := CreateGitIgnore(dir, "commands/.gitattributes", "commands/*/*.example", "commands/*/README.txt", "commands/host/launch", "commands/web/live", "commands/web/xdebug", "commands/db/mysql", "homeadditions/*.example", "homeadditions/README.txt", ".gitignore", "import.yaml", ".ddev-docker-compose-base.yaml", ".ddev-docker-compose-full.yaml", "db_snapshots", "sequelpro.spf", "import-db", "config.*.y*ml", ".webimageBuild", ".dbimageBuild", ".sshimageBuild", ".webimageExtra", ".dbimageExtra", "*-build/Dockerfile.example")
if err != nil {
return fmt.Errorf("failed to create gitignore in %s: %v", dir, err)
}
Expand Down
4 changes: 4 additions & 0 deletions pkg/ddevapp/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,10 @@ func TestWriteConfig(t *testing.T) {

// TestConfigOverrideDetection tests to make sure we tell them about config overrides.
func TestConfigOverrideDetection(t *testing.T) {
if runtime.GOOS == "windows" {
t.Skip("Skipping because unreliable on Windows")
}

assert := asrt.New(t)
app := &DdevApp{}
testDir, _ := os.Getwd()
Expand Down
2 changes: 1 addition & 1 deletion pkg/ddevapp/ddevapp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1297,7 +1297,7 @@ func TestDdevFullSiteSetup(t *testing.T) {
_, _ = testcommon.EnsureLocalHTTPContent(t, app.GetHTTPSURL()+site.Safe200URIWithExpectation.URI, site.Safe200URIWithExpectation.Expect)
// Test dynamic php + database content.
rawurl := app.GetHTTPSURL() + site.DynamicURI.URI
body, resp, err := testcommon.GetLocalHTTPResponse(t, rawurl, 90)
body, resp, err := testcommon.GetLocalHTTPResponse(t, rawurl, 120)
assert.NoError(err, "GetLocalHTTPResponse returned err on project=%s rawurl %s, resp=%v: %v", site.Name, rawurl, resp, err)
if err != nil && strings.Contains(err.Error(), "container ") {
logs, err := ddevapp.GetErrLogsFromApp(app, err)
Expand Down
6 changes: 4 additions & 2 deletions pkg/dockerutil/dockerutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -756,8 +756,10 @@ func InvalidateDockerWindowsCache() error {
if runtime.GOOS != "windows" || nodeps.IsDockerToolbox() {
return nil
}
_, _, err := RunSimpleContainer("djs55/grpcfuse-control:2.2.0.5", "", []string{"invalidate", "all"}, nil, nil, []string{"/run:/run"}, "0", true)
// The grpcfuse-control seems not to be relevant with WSL2 Docker
var err error
//_, _, err = RunSimpleContainer("djs55/grpcfuse-control:2.3.0.3", "", []string{"invalidate", "all"}, nil, nil, []string{"/run:/run"}, "0", true)
// For extra credit, a sleep
time.Sleep(2 * time.Second)
time.Sleep(5 * time.Second)
return err
}