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

test: Add bats test coverage for Drupal Core and Drupal CMS quickstarts #6893

Merged
merged 21 commits into from
Jan 16, 2025

Conversation

rpkoller
Copy link
Collaborator

@rpkoller rpkoller commented Jan 13, 2025

This PR is adding tests for Drupal Core and Drupal CMS, updates the drupal quickstarts layout wise and makes a change to the common setup function.

Rendered quickstart: https://ddev--6893.org.readthedocs.build/en/6893/users/quickstart/#drupal

about the tests: i've added a fifth test that is currently commented out. it requires a creation of a test repo in the ddev org on github first (https://github.com/ddev/test-drupal.git would be the same naming pattern used for backdrop). the zip based test for drupal cms contains one additional line that renames the directory. problem is the zip file contains a folder called drupal-cms. due to the fact that launc-drupal-cms.sh contains a ddev config command that makes the project name drupal-cms in consequence and that way the teardown same sas the launch and validate the running project tests are unable to find the default project name my-drupal-site (PROJNAME in line 4)

about the quickstarts: i've added ddev startbefore ddev composer create. during the creation of the draft i've noticed that quickstarts are inconsistent some composer based are using ddev start some are not. it should be consistent and @rfay noted that it is always good to educate people with these quickstarts and show them what is actually happening even though for ddev composer create a ddev startwould be automatically executed. the other change i'Ve made is to add two h3s within the drupal h2 and move the two quickstarts for drupal cms into a seperate tabbed box within the drupal cms h3.

about the common-setup.sh: loaded the bats-file library as well that provides some additional asserts and more. based on the instructions from the other PR bats-file is available but was not loaded yet.

IMPORTANT: The PR has to be updated on the 15th of january updating the links related to Drupal CMS with the release of version 1.0.0

The Issue

  • #

How This PR Solves The Issue

Manual Testing Instructions

Automated Testing Overview

Release/Deployment Notes

@rpkoller rpkoller requested a review from a team as a code owner January 13, 2025 11:49
@rpkoller
Copy link
Collaborator Author

The Drupal CMS composer test is failing https://github.com/ddev/ddev/actions/runs/12746756015/job/35523444093?pr=6893 ... i thought maybe another commit got in minutes ago. but i've manually tested locally again and it still passes for me. so no idea why is going wrong when the tests run here on github?

and one other thought i wonder if it would make sense to add a third quickstart for drupal cms that is not using the installer but instead a drush site install and which provides the command line equivalent how to apply all the optional recipes via the command line. something i struggled and still have to look up each and every time.

docs/tests/drupal.bats Outdated Show resolved Hide resolved
Co-authored-by: Randy Fay <randy@randyfay.com>
ddev composer install # If a composer build
ddev launch
```

### Drupal CMS
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a link to the Drupal CMS pages on drupal.org that are relevant here, especially the tarball download page, etc.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then would drupal core also need necessary links? and there is a tar ball version of drupal cms? i am only aware of the zip file and the composer repo

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would drupal core also need necessary links

It's a good idea to link to the page that the technique is built on, thanks!

and there is a tar ball version of drupal cms

I meant zipball of course

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldnt the link to the zip be redundant, it is already listed in the quickstart itself? not that i wouldnt do it, i just mean to keep things concise?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I propose that in every quickstart we link to the basis of the quickstart. We do that in many of them. Drupal can do it as well. It's instructional. We want people to understand why the quickstart is what it is and then they can also perhaps see what's the difference between the upstream install/getting-started docs.

docs/content/users/quickstart.md Outdated Show resolved Hide resolved
docs/content/users/quickstart.md Outdated Show resolved Hide resolved
cd ${tmpdir}/${PROJNAME}
assert_success
# execute launch script
run DDEV_DEBUG=true ./launch-drupal-cms.sh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried this locally, worked for me:

Suggested change
run DDEV_DEBUG=true ./launch-drupal-cms.sh
run env DDEV_DEBUG=true ./launch-drupal-cms.sh

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'Ve already pushed a change to run bash -c "DDEV_DEBUG=true ddev launch"the same pattern that is used for the ddev launch asserts. if that fails i can go with the env variant.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stasadev the tests are green with the run bash -c "DDEV_DEBUG=true ddev launch"change. should i keep it that way or change to the env approach?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep it the same as in other places.

rpkoller and others added 2 commits January 13, 2025 17:55
per recommendation by @stasadev

Co-authored-by: Stanislav Zhuk <stasadev@gmail.com>
per recommendation of @stasadev

Co-authored-by: Stanislav Zhuk <stasadev@gmail.com>
Copy link
Member

@rfay rfay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the text

The legacy type drupal will be interpreted as the latest stable version of Drupal, so in 2024, ddev config --project-type=drupal will configure a Drupal 11 project. drupal can also be used as the project type in the .ddev/config.yaml but it will be interpreted as the latest stable version.

is that useful any more, but open to ideas. Certainly it should say 2025. But it seems out of place here.

Currently "Drupal CMS" is not showing up as a tab on "Drupal" as it should:

image

Please make "Drupal CMS" part of Drupal. The two options (Composer and Zip) can be shown there inline, or the composer approach can be done in a gist, or whatever.

Copy link
Member

@rfay rfay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the great work and significant contribution here! This is a great step forward.

assert_output --partial "HTTP/2 200"
}
# Test for the git based quickstart. Has to be uncommented
# as soon as the Drupal test repo is created on GitHub
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand about waiting for Drupal test repo, it's been there for some time. https://github.com/ddev/test-drupal11 - if you need some improvement in this, you can have privileges on it or you can request a change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, rather than commenting it out, use skip to skip something that's not ready for prime time. That makes it much easier to fix when it's ready.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol i didnt knew that there is already a testrepo in place! then i would have skipped it. it sounded like that repo would have to be created first. thats why i commented it out. and also didnt knew about the skip command. ;) currently testing the uncommented test and will then push another commit

docs/tests/drupal.bats Outdated Show resolved Hide resolved
}

@test "Drupal CMS zip file quickstart with $(ddev --version)" {
# curl -o my-drupal-site.zip -fL https://ftp.drupal.org/files/projects/cms-1.0.0-rc2.zip
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment, use same exact thing in test as in quickstart.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that was me being lazy. but will do

@rpkoller
Copy link
Collaborator Author

rpkoller commented Jan 13, 2025

I don't think the text

The legacy type drupal will be interpreted as the latest stable version of Drupal, so in 2024, ddev config --project-type=drupal will configure a Drupal 11 project. drupal can also be used as the project type in the .ddev/config.yaml but it will be interpreted as the latest stable version.

is that useful any more, but open to ideas. Certainly it should say 2025. But it seems out of place here.

I consider the detail about the project type drupalbeing an alias for the latest stable major version of that project type an important detail to note. How about:

The project type `drupal` is an alias for the latest stable version of Drupal, which currently is version 11. 

maybe place it even in such an fyi box?

@rpkoller
Copy link
Collaborator Author

Currently "Drupal CMS" is not showing up as a tab on "Drupal" as it should:

that was intentional.a single tab with just drupal CMS and having two different approach under one roof felt off. adding a second tab felt also off and the tab got more crowded. strictly speaking the idea is that drupal cms is something "new" and its own "product" so i thought having two boxes felt more clear and cleaned up. but i can change it back later.

@rfay
Copy link
Member

rfay commented Jan 13, 2025

Thanks, please do keep "Drupal CMS" under Drupal.

For the drupal project type... It's not even mentioned or used anywhere in these quickstarts, so I don't think it belongs here. If there are other places we can improve its use in the docs, it's great to mention it there.

@rpkoller
Copy link
Collaborator Author

ok the PR would be ready for another round of review. pushed all changes. all tests are uncommented and working now, applied the feedback, and tried to be consistent. hope i've catched everything

docs/content/users/quickstart.md Outdated Show resolved Hide resolved
the to be unzipped archive for drupal cms still had the name drupal-cms... by @stasadev

Co-authored-by: Stanislav Zhuk <stasadev@gmail.com>
@rfay
Copy link
Member

rfay commented Jan 14, 2025

Let's wait until tomorrow and remove the Drupal CMS tag before pulling.

@rpkoller
Copy link
Collaborator Author

Let's wait until tomorrow and remove the Drupal CMS tag before pulling.

which tag you refer to? and tomorrow the tests and quickstarts for drupal cms could be updated with the release of 1.0.0

@rfay
Copy link
Member

rfay commented Jan 14, 2025

Tomorrow CMS_VERSION=1.0.0-rc2 will be something else (maybe they'll remove that?)

And in ddev composer create --stability="RC" drupal/cms we won't need --stability any more at all

@rpkoller
Copy link
Collaborator Author

ahhh that you meant, yep i completely agree then. just wanted to make there wasnt another detail you were referring to and i was missing.

@nlighteneddesign
Copy link
Contributor

These look good to me!

docs/tests/drupal.bats Outdated Show resolved Hide resolved
Comment on lines +280 to +281
PROJECT_GIT_URL=https://github.com/ddev/test-drupal11.git
git clone ${PROJECT_GIT_URL} my-drupal-site
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to ask if we use the repositories from ddev org for Git Clone?

I'm asking because typo3 PR #6895 didn't have this change in the quickstart docs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uhhhhhhh why the typo3 quickstart isnt using test-typo.git,i thought i've changed that?! then the typo3 quickstart needs that small update as well. how could i have missed that? i am puzzled. thank you for noticing!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i will quickly open another PR fixing that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for reference, opened #6904

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO it's not fundamentally important to use .git. I never do when cloning a repo.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

didn't know that, but i just tried to be explicit and follow what is provided in the core button. that is what i always followed.
Screenshot 2025-01-15 at 22 43 44

by @stasadev

Co-authored-by: Stanislav Zhuk <stasadev@gmail.com>
@stasadev
Copy link
Member

stasadev commented Jan 15, 2025

The Drupal CMS zip file quickstart test fails because of incorrect condition in launch-drupal-cms.sh

if [ $n > 0 ]; then
  NAME=$NAME-$(expr $n + 1)
fi

It should be

if [ $n -gt 0 ]; then
  NAME=$NAME-$(expr $n + 1)
fi

@rfay
Copy link
Member

rfay commented Jan 15, 2025

Now that Drupal CMS has a web page for installation, please add a link to it at the top, thanks! Ready to go otherwise!

@tyler36
Copy link
Collaborator

tyler36 commented Jan 16, 2025

Confirming the "Drupal CMS" guide, nice update!

@rfay
Copy link
Member

rfay commented Jan 16, 2025

The square brackets are ugly. Could you make it Read more about Drupal Core and Installing Drupal Core - like that? with links?

@rfay rfay merged commit 4e8a797 into ddev:main Jan 16, 2025
7 of 11 checks passed
@rpkoller rpkoller deleted the 20250111-rpkoller-drupal-tests branch January 16, 2025 04:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy