Skip to content

test: add OpenMage/Magento 1 quickstart test and split it from Magento 2, for #7094 - #7091

Merged
rfay merged 9 commits into
ddev:mainfrom
sreichel:openmage-bats
Mar 19, 2025
Merged

rfay merged 9 commits into
ddev:mainfrom
sreichel:openmage-bats

Conversation

@sreichel

@sreichel sreichel commented Mar 14, 2025 •

Copy link
Copy Markdown
Contributor

@sreichel
sreichel requested a review from a team as a code owner March 14, 2025 21:47
@sreichel
sreichel marked this pull request as draft March 14, 2025 21:47
@sreichel sreichel changed the title [wip] openmage.bats [wip] openmage bats Mar 14, 2025
@sreichel sreichel changed the title [wip] openmage bats test: openmage bats Mar 14, 2025
@rfay rfay changed the title test: openmage bats test: Add quickstart test for OpenMage/Magento 1 Mar 14, 2025

@rpkoller rpkoller left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

At first thank you for working on the bats test! I've made a few observations going through the test:

at first one fundamental question, the goal of those bats tests is to mirror the corresponding quickstart and make sure to notice anything breaking early on by running those regular tests, but the bats test you've created uses another approach (git clone based) than the quickstart https://ddev.readthedocs.io/en/stable/users/quickstart/#magento-openmagemagento-1 (zip archive downloaded by curl). you are the expert and regular user of openmage/magento 1, so the question would be what is the best practice for setting up an instance of openmage these days from your point of view, by downloading a zip archive or better by git clone? in consequence it would be either necessary to adjust the quickstart to the approach you are using in the bats test, or adjust the bats test to the approach used in the quickstart? which would be the preferable way?

run ddev config --project-type=magento --php_version=8.1 --webserver_type=nginx-fpm is using the wrong syntax. instead of underscores it is necessary to use hyphens: run ddev config --project-type=magento --php-version=8.1 --webserver-type=nginx-fpm

you are using run ddev start -ywhich is the preferable way to start ddev, but the openmage quickstart needs to reflect that as well. would it be possible to add the -yto the quickstart as well? it can be found at: docs/content/users/quickstart.md

and aside the assertion for ddev launch a few more checks could be added. a few suggestions are included in the following snippet:

  run curl -sfI https://${PROJNAME}.ddev.site
  assert_success
  assert_output --partial "server: nginx"
  assert_output --partial "HTTP/2 200"
  assert_output --partial "set-cookie: om_frontend"
  run curl -sf https://${PROJNAME}.ddev.site
  assert_success
  assert_output --partial "2020 OpenMage Demo Store. All Rights Reserved."
  run curl -sf https://${PROJNAME}.ddev.site/index.php/customer/account/login/
  assert_success
  assert_output --partial "<title>Customer Login</title>"
  assert_output --partial "2020 OpenMage Demo Store. All Rights Reserved."

@sreichel

sreichel commented Mar 15, 2025 •

Copy link
Copy Markdown
Contributor Author

Thanks for your reply.

This PR is on a very early stage. It does not work locally for some reason, so i have to do it in small chunks.

However ...

the goal of those bats tests is to mirror the corresponding quickstart and make sure to notice anything breaking early on by running those regular tests, but the bats test you've created uses another approach (git clone based) than the quickstart https://ddev.readthedocs.io/en/stable/users/quickstart/#magento-openmagemagento-1 (zip archive downloaded by curl).

I was not really aware of that documentation. OpenMage offered downloading zip-archive until some months ago, but it never was recommended. OM supports "git clone" for devs and "composer" install.

For now i thinks its enough to test "git clone" install. Custom commands like openmage-install are not present for compser install at the moment. (yeah, needs to be fixed). So i'd recommend to update quickstart-docs - and replace zip-download part.

Thanks again for your suggestions, as soon it works locally .... :)

@rpkoller

Copy link
Copy Markdown
Collaborator

yeah i was well aware that your PR is still in draft status and a work in progress, the reason i've already commented on was when i saw that your test was using a different approach than the existing quickstart, and i just wanted to give you a headsup about the fundamental approach to keep the test as close as possible to the quickstart.

i agree based on the docs it might be a good thing to drop the zip based quickstart approach for openmage and the git based approach seems like the right pick at this point. the composer instructions are not actionable easily it looks like.

@sreichel

Copy link
Copy Markdown
Contributor Author

Thanks. I did not knew that the tests are tied to quickstart guides. That makes sense, of course :)

Update docs in #7093 first.

@sreichel
sreichel marked this pull request as ready for review March 15, 2025 23:53
@rfay

rfay commented Mar 16, 2025

Copy link
Copy Markdown
Member

This needs a rebase after magento2 changes, thanks.

@sreichel

Copy link
Copy Markdown
Contributor Author

Ping @kiatng

@sreichel

Copy link
Copy Markdown
Contributor Author

@rpkoller pls let me know for improvements.. Thanks :)

@rpkoller rpkoller left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

found a few more details on the PR. and one remark about splitting openmage and magento2. at first i was a bit reluctant and puzzled cuz i thought magento2 and openmage are just two different major versions of magento but on closer look they are not. so splitting up the two in the quickstart is a good thing. thank you for that as well as for all the work so far!

Comment thread docs/content/users/quickstart.md Resolved
Comment thread docs/tests/openmage.bats Resolved
Comment thread docs/content/users/quickstart.md Resolved
Comment thread docs/content/users/quickstart.md Resolved
Comment thread docs/tests/openmage.bats Resolved
Comment thread docs/content/users/quickstart.md Resolved
Comment thread docs/content/users/quickstart.md Resolved
@sreichel

Copy link
Copy Markdown
Contributor Author

puzzled cuz i thought magento2 and openmage are just two different major versions of magento but on closer look they are not.

They are definitely not. OpenMage is M2's successor 😀

Thanks for review, I'll fix everything else later.

@rfay

rfay commented Mar 17, 2025

Copy link
Copy Markdown
Member

Rebased, thanks for your work on this! We had a bunch of quickstart edits go in and wanted to make sure this was updated after that.

@rpkoller

rpkoller commented Mar 18, 2025 •

Copy link
Copy Markdown
Collaborator

the failing expression engine test should now be fixed as well

@rfay
rfay requested a review from rpkoller March 18, 2025 19:31
@rfay

rfay commented Mar 18, 2025

Copy link
Copy Markdown
Member

Rebased again

@rfay rfay changed the title test: Add quickstart test for OpenMage/Magento 1 test: Add quickstart test, split out quickstart for OpenMage/Magento 1, fixes #7094 Mar 18, 2025

@stasadev stasadev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Rebased and fixed markdown.

Select Hide whitespace checkbox when doing a review:

whitespaces

@stasadev stasadev changed the title test: Add quickstart test, split out quickstart for OpenMage/Magento 1, fixes #7094 test: add OpenMage/Magento 1 quickstart test and split it from Magento 2, for #7094 Mar 19, 2025

@rpkoller rpkoller left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

overall it looks good and very close, thank you! i've only found two remaining details to note.

Comment thread docs/tests/openmage.bats Resolved
ddev composer install
# Silent OpenMage install with sample data
# See `ddev openmage-install -h` for more options
ddev openmage-install -q

@rpkoller rpkoller Mar 19, 2025 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

when manually testing the latest state i've noticed something i'Ve missed before (not sure if it was already there but if you look at the output of the command

$> ddev openmage-install -q
Enable maintenance mode...
ERROR 1045 (28000): Access denied for user 'db'@'172.19.0.2' (using password: YES)
Creating Sample Data directory...
Downloading Sample Data...
--2025-03-19 13:27:01--  https://github.com/Vinai/compressed-magento-sample-data/raw/master/compressed-magento-sample-data-1.9.2.4.tgz
Resolving github.com (github.com)... 140.82.121.3
Connecting to github.com (github.com)|140.82.121.3|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://raw.githubusercontent.com/Vinai/compressed-magento-sample-data/master/compressed-magento-sample-data-1.9.2.4.tgz [following]
--2025-03-19 13:27:01--  https://raw.githubusercontent.com/Vinai/compressed-magento-sample-data/master/compressed-magento-sample-data-1.9.2.4.tgz
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.111.133, 185.199.108.133, 185.199.109.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.111.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 68614817 (65M) [application/octet-stream]
Saving to: ‘sample_data.tgz’

sample_data.tgz                 100%[======================================================>]  65.44M  2.55MB/s    in 26s     

2025-03-19 13:27:27 (2.54 MB/s) - ‘sample_data.tgz’ saved [68614817/68614817]

Uncompressing Sample Data...
Copying Sample Data into the OpenMage directory...
Clearing var/cache...
Importing Sample Data into the database...
ERROR 1045 (28000): Access denied for user 'db'@'172.19.0.2' (using password: YES)
Removing sample data...
SUCCESS: 71c2935475b8419becde5876a190b5b7
Disable maintenance mode...

it looks like the import into the db fails?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I see this too, thank you, I'll investigate.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It happened to me too, but i thought i've missed to config something.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@stasadev "it happened to me" here ... playing around with cypress add-on. Now it works.

Love DDEV ❤️

Thanks @rfay @rpkoller @stasadev @tyler36

@rpkoller

Copy link
Copy Markdown
Collaborator

this PR looks good to go now. the only detail i wonder how should the openmage-install issue be handled? the upstream fix got already approved but question is when it would get into a release? should the openmage-install line be removed from the quickstart for now? in the test it does not really any harm. the test passes since it is only tested if the command runs through not the actual result. or should the PR simply go in as is now with the openmage-install on the quickstart? either way it would be an improvement compared to the current state. personally i would lean towards commit it in the current state.

@rpkoller

Copy link
Copy Markdown
Collaborator

oh lol just noticed the upstream fix got already committed ^^

@sreichel

Copy link
Copy Markdown
Contributor Author

but question is when it would get into a release?

I think it will take a month till next release.

@rfay rfay left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is great, and thanks for maintaining on behalf of the community @sreichel

I do happen to note how outdated this is:

Latest Message: UPS APIs will stop working on 3rd June 2024 (https://openmage.github.io/Web_Notifications//2024/03/17/Ups.html)

@rpkoller you confirm that the Magento2 stuff is the same and doing fine right?

Comment on lines +758 to +759
mkdir my-openmage-site && cd my-openmage-site
git clone https://github.com/OpenMage/magento-lts .

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This does no harm, but wouldn't it be simpler to do this? Wouldn't people understand it ok?

Suggested change
mkdir my-openmage-site && cd my-openmage-site
git clone https://github.com/OpenMage/magento-lts .
git clone https://github.com/OpenMage/magento-lts my-openmage-site

```bash
mkdir my-openmage-site && cd my-openmage-site
git clone https://github.com/OpenMage/magento-lts .
ddev config --project-type=magento --php-version=8.1 --web-environment-add=MAGE_IS_DEVELOPER_MODE=1

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why are we using an old version of PHP here? I do see that suggestion in https://docs.openmage.org/users/requirements/ but am surprised that they'd be that far back. DDEV's default is currently 8.3, and will change to 8.4 in the fall. If this is OK and recommended, it's OK, but I was wondering if maybe the OpenMage doc was out of date.

@sreichel sreichel Mar 20, 2025 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks. DOCS are not up 2 date. Current OM release supports php74, but with next release we require php81

OpenMage/magento-lts#4124 (not released yet)

Moving to php83 was planned for upcoming releases.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, I know you'll update when it supports current stable.

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.

4 participants