Add ddev's e2e test#9033
Conversation
9ebf3ac to
ecb55a8
Compare
2522a5d to
ed86cfa
Compare
rfay
left a comment
There was a problem hiding this comment.
Thanks for this!
As is, this won't use your docker-compose I don't think. In ddev v1.18.2, ddev downloads a private docker-compose. So you'll either need to use ddev config global --required-docker-compose-version=<currrent> or ddev config global --use-docker-compose-from-path (those can also just be set in ~/.ddev/global_config.yaml).
An actual end-to-end test will at least curl from an index.php. You could just make an index.php with
<?php
echo "hi there";and then curl http://<project>.ddev.php and verify that you get that (and a 200 of course)
It looks like all this does is run a ddev start, which isn't "end to end".
I recommend at least having a project with an index.php that has
|
|
||
| compressedFilename := fmt.Sprintf("ddev_%s-%s.%s.tar.gz", osName, runtime.GOARCH, ddevVersion) | ||
|
|
||
| c.RunCmdInDir(dir, "curl", "-LO", |
There was a problem hiding this comment.
It would probably be easier to use install_ddev.sh
There was a problem hiding this comment.
Couldn't use that because it tries to install that in /usr/local/bin and root is needed for that.
There was a problem hiding this comment.
OK, yeah and ddev can be anywhere in the path. Any way you want to download "latest" is fine of course.
|
|
||
| c.RunDockerCmd("pull", tagged("drud/ddev-router")) | ||
| c.RunDockerCmd("pull", tagged("drud/ddev-dbserver-mariadb-10.3")) | ||
| c.RunDockerCmd("pull", tagged("drud/ddev-webserver")) |
There was a problem hiding this comment.
All these pulls happen on ddev start, and you can't pull without a tag. ddev start will pull with the correct tag. There is no latest tag on any of them.
There was a problem hiding this comment.
tagged function will append that to the image name.
There was a problem hiding this comment.
The idea is to share the time of the call between this other pull calls and know which part is doing some job at the time.
There was a problem hiding this comment.
It's OK then, doesn't do any harm.
|
I'll try running this in a bit and propose some code. |
|
Added a PR to your PR in ulyssessouza#23 that makes the test a little stronger, tests to see if it's actually working. cleans up project after it's done, etc. This assumes that the docker-compose under test is the one that will be found in the $PATH. |
0f11093 to
2c3f7fd
Compare
rfay
left a comment
There was a problem hiding this comment.
Thanks, this is good for me as long as the docker-compose under test first in the $PATH - please just confirm that. If it's not, then this isn't relevant yet.
|
I see |
aa832ae to
62aa00f
Compare
8b7aa4d to
4e66ad3
Compare
|
It looks to me like all the tests running in parallel fight over each other's containers or networks. I'll do a PR to this PR that adds
|
|
Opened
|
8e403b3 to
dbc3e35
Compare
glours
left a comment
There was a problem hiding this comment.
We should be able to run the e2e test locally, @ulyssessouza can move the copy of the binary to the CI script please?
Otherwise I didn't succeed to run the test on my Mac M1, I got the following issue
Network ddev-testcomposerunddev-2047219997_default Created
Error response from daemon: create .: volume name is too short, names should be at least two alphanumeric characters
Stderr: ssh-agent container is running: If you want to add authentication to the ssh-agent container, run 'ddev auth ssh' to enable your keys.
mkcert may not be properly installed, we suggest installing it for trusted https support, `brew install mkcert nss`, `choco install -y mkcert`, etc. and then `mkcert -install`
IsInternetActive DEBUG: err=<nil> ctx.Err()=<nil> addrs=[127.0.0.1] IsInternetactive==true, randomURL=yhygkjiacf.ddev.site internet_detection_timeout_ms=750ms
Failed to start TestComposeRunDdev-2047219997: ComposeCmd failed to run 'COMPOSE_PROJECT_NAME=ddev-TestComposeRunDdev-2047219997 docker-compose -f /private/var/folders/rl/282crpp149x6xf_400p17fj40000gn/T/TestComposeRunDdev-2047219997/.ddev/.ddev-docker-compose-full.yaml up --build -d', action='[up --build -d]', err='exit status 1', stdout='#1 [drud/ddev-webserver:v1.19.0-1-TestComposeRunDdev-2047219997-built internal] load build definition from Dockerfile
#1 transferring dockerfile: 580B done
#1 DONE 0.0s
#2 [drud/ddev-dbserver-mariadb-10.3:v1.19.0-TestComposeRunDdev-2047219997-built internal] load build definition from Dockerfile
#2 transferring dockerfile: 408B done
#2 DONE 0.0s
#3 [drud/ddev-dbserver-mariadb-10.3:v1.19.0-TestComposeRunDdev-2047219997-built internal] load .dockerignore
#3 transferring context: 2B done
#3 DONE 0.0s
#4 [drud/ddev-webserver:v1.19.0-1-TestComposeRunDdev-2047219997-built internal] load .dockerignore
#4 transferring context: 2B done
#4 DONE 0.0s
#5 [drud/ddev-webserver:v1.19.0-1-TestComposeRunDdev-2047219997-built internal] load metadata for docker.io/drud/ddev-webserver:v1.19.0-1
#5 DONE 0.0s
#6 [drud/ddev-dbserver-mariadb-10.3:v1.19.0-TestComposeRunDdev-2047219997-built internal] load metadata for docker.io/drud/ddev-dbserver-mariadb-10.3:v1.19.0
#6 DONE 0.0s
#7 [drud/ddev-dbserver-mariadb-10.3:v1.19.0-TestComposeRunDdev-2047219997-built 1/2] FROM docker.io/drud/ddev-dbserver-mariadb-10.3:v1.19.0
#7 DONE 0.0s
#8 [drud/ddev-dbserver-mariadb-10.3:v1.19.0-TestComposeRunDdev-2047219997-built 2/2] RUN (groupadd --gid 20 "glours" || groupadd "glours" || true) && (useradd -l -m -s "/bin/bash" --gid "glours" --comment '' --uid 501 "glours" || useradd -l -m -s "/bin/bash" --gid "glours" --comment '' "glours" || useradd -l -m -s "/bin/bash" --gid "20" --comment '' "glours")
#8 CACHED
#9 [drud/ddev-webserver:v1.19.0-1-TestComposeRunDdev-2047219997-built 1/4] FROM docker.io/drud/ddev-webserver:v1.19.0-1
#9 DONE 0.0s
#10 [drud/ddev-webserver:v1.19.0-1-TestComposeRunDdev-2047219997-built 2/4] RUN (groupadd --gid 20 "glours" || groupadd "glours" || true) && (useradd -l -m -s "/bin/bash" --gid "glours" --comment '' --uid 501 "glours" || useradd -l -m -s "/bin/bash" --gid "glours" --comment '' "glours" || useradd -l -m -s "/bin/bash" --gid "20" --comment '' "glours")
#10 CACHED
#11 [drud/ddev-webserver:v1.19.0-1-TestComposeRunDdev-2047219997-built 3/4] RUN export XDEBUG_MODE=off && ( composer self-update --2 || composer self-update --2 || true )
#11 CACHED
#12 [drud/ddev-webserver:v1.19.0-1-TestComposeRunDdev-2047219997-built 4/4] RUN chmod 600 ~glours/.pgpass ~glours/.my.cnf
#12 CACHED
#13 [drud/ddev-dbserver-mariadb-10.3:v1.19.0-TestComposeRunDdev-2047219997-built] exporting to image
#13 exporting layers done
#13 writing image sha256:8479fcda75dc943532607f8255a0dae40982625130b2762a02eb285838d55959 done
#13 naming to docker.io/drud/ddev-webserver:v1.19.0-1-TestComposeRunDdev-2047219997-built done
#13 writing image sha256:72e0459aecebee2d72392a30f55003b65582d7e8381d25cf8365683db6594e96 done
#13 naming to docker.io/drud/ddev-dbserver-mariadb-10.3:v1.19.0-TestComposeRunDdev-2047219997-built done
#13 DONE 0.0s
', stderr='Network ddev-testcomposerunddev-2047219997_default Creating
Network ddev-testcomposerunddev-2047219997_default Created
Container ddev-TestComposeRunDdev-2047219997-db Creating
Container ddev-TestComposeRunDdev-2047219997-dba Creating
Container ddev-TestComposeRunDdev-2047219997-web Creating
Container ddev-TestComposeRunDdev-2047219997-dba Created
Error response from daemon: create .: volume name is too short, names should be at least two alphanumeric characters'
Failures:
ExitCode was 1 expected 0
| rm -f /usr/local/bin/docker-compose | ||
| cp bin/docker-compose /usr/local/bin |
There was a problem hiding this comment.
This 2 command make standalone e2e tests not runnable on a local machine, this should be part of the ci.yml steps
$ make e2e-compose-standalone
rm -f /usr/local/bin/docker-compose
rm: /usr/local/bin/docker-compose: Permission denied
make: *** [e2e-compose-standalone] Error 1There was a problem hiding this comment.
@ulyssessouza you didn't move the copy of the compose binary to the CI workflow
|
It looks to me like the failure you're seeing here is #9428 - DDEV hasn't been able to run against any version of compose since 2.3.3 due to a cascade of regressions. |
Signed-off-by: Ulysses Souza <[email protected]>
* Add tmate for debugging * Use -parallel=1 for standaone tests Signed-off-by: Randy Fay <[email protected]>
ae08a0c to
97d46a1
Compare
What I did
Add ddev's e2e test