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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
ee60636
Load bats-file in common-setup.bash
rpkoller Jan 13, 2025
548af64
move two drupal cms quickstarts into separate box within drupal section
rpkoller Jan 13, 2025
ce7b521
initial draft for testing quickstarts for drupal
rpkoller Jan 13, 2025
0bd425c
add ddev start to the quickstarts where it is missing
rpkoller Jan 13, 2025
409c351
change the directory name to my-drupal-site on the drupal cms compose…
rpkoller Jan 13, 2025
7529b43
remove empty line to mind linter recommendation
rpkoller Jan 13, 2025
709c8c5
add ddev_debug for the launch-drupal-cms.sh script execution
rpkoller Jan 13, 2025
e81d926
wrap ddev_debug launch script in run bash statement like the ddev_deb…
rpkoller Jan 13, 2025
d10ab89
Fix the case for the tab label Zip File
rpkoller Jan 13, 2025
6457d47
Make Core in Drupal Core upper case
rpkoller Jan 13, 2025
29f956c
includes feedback, add missing ddev start statements, improved consis…
rpkoller Jan 13, 2025
1e159f6
fix the url for the drupal cms curl zip download
rpkoller Jan 13, 2025
9d2ea03
and uncomment other tests again, was too overeager pushing
rpkoller Jan 13, 2025
07c4a21
adjust the corresponding quickstart to the change
rpkoller Jan 13, 2025
1907fb0
fixing consistency detail between tests and quickstart
rpkoller Jan 14, 2025
1034dc8
update quickstarts and ZIP dl link to stable 1.0.0
rpkoller Jan 15, 2025
37f1ae2
add a missing whitespace for alignment
rpkoller Jan 15, 2025
616c17f
skip the zip based bats test until a fix is in
rpkoller Jan 16, 2025
16489f8
add links to marketing site and docs for core and cms
rpkoller Jan 16, 2025
7a91123
fix the the styling and syntax of the previously added links
rpkoller Jan 16, 2025
9690a2e
forgot to update the link style and syntax on one tab
rpkoller Jan 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 25 additions & 13 deletions docs/content/users/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,13 +212,12 @@ Read more about customizing the environment and persisting configuration in [Pro

## Drupal

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.

=== "Drupal 11"

```bash
mkdir my-drupal11-site && cd my-drupal11-site
mkdir my-drupal-site && cd my-drupal-site
ddev config --project-type=drupal11 --docroot=web
ddev start
ddev composer create drupal/recommended-project:^11
ddev composer require drush/drush
ddev drush site:install --account-name=admin --account-pass=admin -y
Expand All @@ -227,30 +226,36 @@ The legacy type `drupal` will be interpreted as the latest stable version of Dru
ddev launch $(ddev drush uli)
```

Read more about: [Drupal Core](https://new.drupal.org/about/overview/technical) & [Documentation](https://www.drupal.org/docs)

=== "Drupal CMS"

```bash
mkdir my-drupal-cms && cd my-drupal-cms
mkdir my-drupal-site && cd my-drupal-site
ddev config --project-type=drupal11 --docroot=web
ddev composer create --stability="RC" drupal/cms
ddev start
ddev composer create drupal/cms
ddev launch
```

or use the Zip file download technique:
or use the ZIP file download technique:

```
CMS_VERSION=1.0.0-rc2
curl -o drupal-cms.zip -fL https://ftp.drupal.org/files/projects/cms-${CMS_VERSION}.zip
unzip drupal-cms.zip && rm drupal-cms.zip
```bash
CMS_VERSION=1.0.0
curl -o my-drupal-site.zip -fL https://ftp.drupal.org/files/projects/cms-${CMS_VERSION}.zip
unzip my-drupal-site.zip && rm my-drupal-site.zip
cd drupal-cms
./launch-drupal-cms.sh
```

Read more about: [Drupal CMS](https://new.drupal.org/drupal-cms) & [Documentation](https://new.drupal.org/docs/drupal-cms)

=== "Drupal 10"

```bash
mkdir my-drupal10-site && cd my-drupal10-site
mkdir my-drupal-site && cd my-drupal-site
ddev config --project-type=drupal10 --docroot=web
ddev start
ddev composer create drupal/recommended-project:^10
ddev composer require drush/drush
ddev drush site:install --account-name=admin --account-pass=admin -y
Expand All @@ -259,6 +264,8 @@ The legacy type `drupal` will be interpreted as the latest stable version of Dru
ddev launch $(ddev drush uli)
```

Read more about: [Drupal Core](https://new.drupal.org/about/overview/technical) & [Documentation](https://www.drupal.org/docs)

=== "Drupal 6/7"

```bash
Expand All @@ -276,13 +283,18 @@ The legacy type `drupal` will be interpreted as the latest stable version of Dru
=== "Git Clone"

```bash
git clone https://github.com/example/my-drupal-site
PROJECT_GIT_URL=https://github.com/ddev/test-drupal11.git
git clone ${PROJECT_GIT_URL} my-drupal-site
Comment on lines +286 to +287
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

cd my-drupal-site
ddev config # Follow the prompts to set Drupal version and docroot
ddev config --project-type=drupal11 --docroot=web
ddev start
ddev composer install # If a composer build
ddev drush site:install --account-name=admin --account-pass=admin -y
ddev launch
```

Read more about: [Drupal Core](https://new.drupal.org/about/overview/technical) & [Documentation](https://www.drupal.org/docs)

## ExpressionEngine

=== "ExpressionEngine ZIP File Download"
Expand Down
1 change: 1 addition & 0 deletions docs/tests/common-setup.bash
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ _common_setup() {
export BATS_LIB_PATH="${BATS_LIB_PATH}:${TEST_BREW_PREFIX}/lib:/usr/lib/bats"
bats_load_library bats-support
bats_load_library bats-assert
bats_load_library bats-file
mkdir -p ~/tmp
tmpdir=$(mktemp -d ~/tmp/${PROJNAME}.XXXXXX)
export DDEV_NO_INSTRUMENTATION=true
Expand Down
161 changes: 161 additions & 0 deletions docs/tests/drupal.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
#!/usr/bin/env bats

setup() {
PROJNAME=my-drupal-site
load 'common-setup'
_common_setup
}

# executed after each test
teardown() {
_common_teardown
}

@test "Drupal 11 quickstart with $(ddev --version)" {
# mkdir my-drupal-site && cd my-drupal-site
run mkdir my-drupal-site && cd my-drupal-site
assert_success
# ddev config --project-type=drupal11 --docroot=web
run ddev config --project-type=drupal11 --docroot=web
assert_success
# ddev start
run ddev start
assert_success
# ddev composer create drupal/recommended-project:^11
run ddev composer create drupal/recommended-project:^11
assert_success
# ddev composer require drush/drush
run ddev composer require drush/drush
assert_success
#ddev drush site:install --account-name=admin --account-pass=admin -y
run ddev drush site:install --account-name=admin --account-pass=admin -y
assert_success
# ddev launch
run bash -c "DDEV_DEBUG=true ddev launch"
assert_output "FULLURL https://${PROJNAME}.ddev.site"
assert_success
# validate running project
run curl -sfI https://${PROJNAME}.ddev.site
assert_success
assert_output --partial "x-generator: Drupal 11 (https://www.drupal.org)"
assert_output --partial "HTTP/2 200"
}

@test "Drupal 10 quickstart with $(ddev --version)" {
# mkdir my-drupal-site && cd my-drupal-site
run mkdir my-drupal-site && cd my-drupal-site
assert_success
# ddev config --project-type=drupal10 --docroot=web
run ddev config --project-type=drupal10 --docroot=web
assert_success
# ddev start
run ddev start
assert_success
# ddev composer create drupal/recommended-project:^10
run ddev composer create drupal/recommended-project:^10
assert_success
# ddev composer require drush/drush
run ddev composer require drush/drush
assert_success
#ddev drush site:install --account-name=admin --account-pass=admin -y
run ddev drush site:install --account-name=admin --account-pass=admin -y
assert_success
# ddev launch
run bash -c "DDEV_DEBUG=true ddev launch"
assert_output "FULLURL https://${PROJNAME}.ddev.site"
assert_success
# validate running project
run curl -sfI https://${PROJNAME}.ddev.site
assert_success
assert_output --partial "x-generator: Drupal 10 (https://www.drupal.org)"
assert_output --partial "HTTP/2 200"
}

@test "Drupal 11 git based quickstart with $(ddev --version)" {
# PROJECT_GIT_URL=https://github.com/ddev/test-drupal11.git
PROJECT_GIT_URL=https://github.com/ddev/test-drupal11.git
# git clone ${PROJECT_GIT_URL} ${PROJNAME}
run git clone ${PROJECT_GIT_URL} ${PROJNAME}
assert_success
# cd my-drupal-site
cd ${PROJNAME} || exit 2
assert_success
# ddev config --project-type=drupal11 --docroot=web
run ddev config --project-type=drupal11 --docroot=web
assert_success
# ddev start
run ddev start
assert_success
# ddev composer install
run ddev composer install
assert_success
#ddev drush site:install --account-name=admin --account-pass=admin -y
run ddev drush site:install --account-name=admin --account-pass=admin -y
assert_success
# ddev launch
run bash -c "DDEV_DEBUG=true ddev launch"
assert_output "FULLURL https://${PROJNAME}.ddev.site"
assert_success
# validate running project
run curl -sfI https://${PROJNAME}.ddev.site
assert_success
assert_output --partial "x-generator: Drupal 11 (https://www.drupal.org)"
assert_output --partial "HTTP/2 200"
}

@test "Drupal CMS composer quickstart with $(ddev --version)" {
# mkdir my-drupal-site && cd my-drupal-site
run mkdir my-drupal-site && cd my-drupal-site
assert_success
# ddev config --project-type=drupal11 --docroot=web
run ddev config --project-type=drupal11 --docroot=web
assert_success
# ddev start
run ddev start
assert_success
# ddev composer create drupal/cms
run ddev composer create drupal/cms
assert_success
# ddev launch
run bash -c "DDEV_DEBUG=true ddev launch"
assert_output "FULLURL https://${PROJNAME}.ddev.site"
assert_success
# validate running project
run curl -sfI https://${PROJNAME}.ddev.site
assert_success
assert_output --partial "location: /core/install.php"
assert_output --partial "HTTP/2 302"
assert_output --partial "x-generator: Drupal 11 (https://www.drupal.org)"
}

@test "Drupal CMS zip file quickstart with $(ddev --version)" {
skip "Skipping until script doesn't erroneously create a -1 on project name"
# CMS_VERSION=1.0.0
CMS_VERSION=1.0.0
# curl -o my-drupal-site.zip -fL https://ftp.drupal.org/files/projects/cms-1.0.0-${CMS_VERSION}.zip
run curl -o my-drupal-site.zip -fL https://ftp.drupal.org/files/projects/cms-${CMS_VERSION}.zip
assert_success
# unzip my-drupal-cms-zip.zip && rm my-drupal-cms-zip.zip
run unzip my-drupal-site.zip && rm my-drupal-site.zip
assert_success
# mv drupal-cms my-drupal-site
# (Not contained in quickstart but necessary to use PROJNAME in this test )
run mv drupal-cms my-drupal-site
assert_success
# Change directory
cd ${tmpdir}/${PROJNAME}
assert_success
# execute launch script
run bash -c "DDEV_DEBUG=true ./launch-drupal-cms.sh"
assert_success
# ddev launch
run bash -c "DDEV_DEBUG=true ddev launch"
assert_output "FULLURL https://${PROJNAME}.ddev.site"
assert_success
# validate running project
run curl -sfI https://${PROJNAME}.ddev.site
assert_success
assert_output --partial "location: /core/install.php"
assert_output --partial "HTTP/2 302"
assert_output --partial "x-generator: Drupal 11 (https://www.drupal.org)"
}
Loading
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