-
-
Notifications
You must be signed in to change notification settings - Fork 710
test(quickstart): fix wagtail hang, reduce job timeout to 60m #8164
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,98 +1,106 @@ | ||
| #!/usr/bin/env bats | ||
|
|
||
| setup() { | ||
| PROJNAME=my-wagtail-site | ||
| load 'common-setup' | ||
| _common_setup | ||
| } | ||
|
|
||
| # executed after each test | ||
| teardown() { | ||
| _common_teardown | ||
| } | ||
|
|
||
| @test "Wagtail quickstart with $(ddev --version)" { | ||
| _skip_if_embargoed "wagtail-gunicorn" | ||
|
|
||
| WAGTAIL_SITENAME=${PROJNAME} | ||
| run mkdir ${WAGTAIL_SITENAME} && cd ${WAGTAIL_SITENAME} | ||
| assert_success | ||
|
|
||
| run ddev config --project-type=generic --webserver-type=generic \ | ||
| --webimage-extra-packages=python3-pip,python3-venv \ | ||
| --web-environment-add=DJANGO_SETTINGS_MODULE=mysite.settings.dev \ | ||
| --omit-containers=db | ||
| assert_success | ||
|
|
||
| cat <<'DOCKERFILEEND' >.ddev/web-build/Dockerfile.python-venv | ||
| RUN for file in /etc/bash.bashrc /etc/bash.nointeractive.bashrc; do \ | ||
| echo '[ -s "$DDEV_APPROOT/env/bin/activate" ] && source "$DDEV_APPROOT/env/bin/activate"' >> "$file"; \ | ||
| done | ||
| DOCKERFILEEND | ||
| run ddev mutagen sync | ||
| assert_success | ||
| assert_file_exist .ddev/web-build/Dockerfile.python-venv | ||
|
|
||
| run ddev start -y | ||
| assert_success | ||
|
|
||
| run ddev exec python -m venv env | ||
| assert_success | ||
|
|
||
| run ddev exec pip install wagtail gunicorn | ||
| assert_success | ||
|
|
||
| run ddev exec wagtail start mysite . | ||
| assert_success | ||
|
|
||
| run ddev exec pip install -r requirements.txt | ||
| assert_success | ||
|
|
||
| run ddev exec "echo \"SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')\" >> mysite/settings/dev.py" | ||
| assert_success | ||
|
|
||
| run ddev exec python manage.py migrate --noinput | ||
| assert_success | ||
|
|
||
| # Create superuser non-interactively | ||
| run ddev exec "DJANGO_SUPERUSER_PASSWORD=admin python manage.py createsuperuser --username=admin --email=admin@example.com --noinput" | ||
| assert_success | ||
|
|
||
| cat <<'EOF' > .ddev/config.wagtail.yaml | ||
| web_extra_daemons: | ||
| - name: "wagtail" | ||
| command: "gunicorn mysite.wsgi:application -b 0.0.0.0:8000" | ||
| directory: /var/www/html | ||
| web_extra_exposed_ports: | ||
| - name: "wagtail" | ||
| container_port: 8000 | ||
| http_port: 80 | ||
| https_port: 443 | ||
| EOF | ||
| run ddev mutagen sync | ||
| assert_success | ||
| assert_file_exist .ddev/config.wagtail.yaml | ||
|
|
||
| run ddev restart | ||
| assert_success | ||
|
|
||
| # ddev launch /admin | ||
| DDEV_DEBUG=true run ddev launch /admin | ||
| assert_output --partial "FULLURL https://${PROJNAME}.ddev.site/admin" | ||
| assert_success | ||
|
|
||
| # validate running project - check if Wagtail is responding | ||
| run curl -sfI https://${PROJNAME}.ddev.site | ||
| assert_output --partial "server: gunicorn" | ||
| assert_success | ||
|
|
||
| # Verify main site is running | ||
| run curl -sf https://${PROJNAME}.ddev.site | ||
| assert_output --partial "Welcome to your new Wagtail site" | ||
| assert_success | ||
|
|
||
| # Check if we can access the admin page (should redirect to login) | ||
| run curl -sfL https://${PROJNAME}.ddev.site/admin | ||
| assert_output --partial "Sign in - Wagtail" | ||
| assert_success | ||
| } | ||
| #!/usr/bin/env bats | ||
|
|
||
| setup() { | ||
| PROJNAME=my-wagtail-site | ||
| load 'common-setup' | ||
| _common_setup | ||
| } | ||
|
|
||
| # executed after each test | ||
| teardown() { | ||
| _common_teardown | ||
| } | ||
|
|
||
| @test "Wagtail quickstart with $(ddev --version)" { | ||
| _skip_if_embargoed "wagtail-gunicorn" | ||
|
|
||
| WAGTAIL_SITENAME=${PROJNAME} | ||
| run mkdir ${WAGTAIL_SITENAME} && cd ${WAGTAIL_SITENAME} | ||
| assert_success | ||
|
|
||
| run ddev config --project-type=generic --webserver-type=generic \ | ||
| --webimage-extra-packages=python3-pip,python3-venv \ | ||
| --web-environment-add=DJANGO_SETTINGS_MODULE=mysite.settings.dev \ | ||
| --omit-containers=db | ||
| assert_success | ||
|
|
||
| cat <<'DOCKERFILEEND' >.ddev/web-build/Dockerfile.python-venv | ||
| RUN for file in /etc/bash.bashrc /etc/bash.nointeractive.bashrc; do \ | ||
| echo '[ -s "$DDEV_APPROOT/env/bin/activate" ] && source "$DDEV_APPROOT/env/bin/activate"' >> "$file"; \ | ||
| done | ||
| DOCKERFILEEND | ||
| run ddev mutagen sync | ||
| assert_success | ||
| assert_file_exist .ddev/web-build/Dockerfile.python-venv | ||
|
|
||
| run ddev start -y | ||
| assert_success | ||
|
|
||
| run ddev exec python -m venv env | ||
| assert_success | ||
|
|
||
| run ddev exec pip install wagtail gunicorn | ||
| assert_success | ||
|
|
||
| run ddev exec wagtail start mysite . | ||
| assert_success | ||
|
|
||
| run ddev exec pip install -r requirements.txt | ||
| assert_success | ||
|
|
||
| run ddev exec "echo \"SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')\" >> mysite/settings/dev.py" | ||
| assert_success | ||
|
|
||
| run ddev exec python manage.py migrate --noinput | ||
| assert_success | ||
|
|
||
| # Create superuser non-interactively | ||
| run ddev exec "DJANGO_SUPERUSER_PASSWORD=admin python manage.py createsuperuser --username=admin --email=admin@example.com --noinput" | ||
| assert_success | ||
|
|
||
| cat <<'EOF' > .ddev/config.wagtail.yaml | ||
| web_extra_daemons: | ||
| - name: "wagtail" | ||
| command: "gunicorn mysite.wsgi:application -b 0.0.0.0:8000" | ||
| directory: /var/www/html | ||
| web_extra_exposed_ports: | ||
| - name: "wagtail" | ||
| container_port: 8000 | ||
| http_port: 80 | ||
| https_port: 443 | ||
| EOF | ||
| run ddev mutagen sync | ||
| assert_success | ||
| assert_file_exist .ddev/config.wagtail.yaml | ||
|
|
||
| run ddev restart | ||
| assert_success | ||
|
|
||
| # ddev launch /admin | ||
| DDEV_DEBUG=true run ddev launch /admin | ||
| assert_output --partial "FULLURL https://${PROJNAME}.ddev.site/admin" | ||
| assert_success | ||
|
|
||
| # Wait for gunicorn (web_extra_daemon) to be ready - DDEV doesn't poll extra daemons for readiness | ||
| for i in $(seq 1 15); do | ||
| if ddev exec curl -sf --max-time 3 http://localhost:8000 >/dev/null 2>&1; then | ||
| break | ||
| fi | ||
| sleep 2 | ||
| done | ||
|
|
||
| # validate running project - check if Wagtail is responding | ||
| run curl -sfI --max-time 30 https://${PROJNAME}.ddev.site | ||
| assert_output --partial "server: gunicorn" | ||
| assert_success | ||
|
|
||
| # Verify main site is running | ||
| run curl -sf --max-time 30 https://${PROJNAME}.ddev.site | ||
| assert_output --partial "Welcome to your new Wagtail site" | ||
| assert_success | ||
|
|
||
| # Check if we can access the admin page (should redirect to login) | ||
| run curl -sfL --max-time 30 https://${PROJNAME}.ddev.site/admin | ||
| assert_output --partial "Sign in - Wagtail" | ||
| assert_success | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This quickstart was originally generated by Claude Code.
And it created the file with CRLF. I don't understand how my git allowed this, but now it uses LF as expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure that statement was correct. I think claude was just all confused here. Not sure. I had to clean it up after claude was done with it here.