Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 974fb37
Author: Mohamed ELIDRISSI <[email protected]>
Date:   Fri Mar 10 10:15:57 2023 +0100

    Remove `chroot` and `chdir` completely

commit ded6e16
Author: Mohamed ELIDRISSI <[email protected]>
Date:   Fri Mar 10 10:13:08 2023 +0100

    Comment out `chroot` and `chdir`

commit 6fd3aba
Author: Sven Reichel <[email protected]>
Date:   Sun Jan 15 02:39:27 2023 +0100

    Test No3

commit 943f5c2
Author: Sven Reichel <[email protected]>
Date:   Sun Jan 15 02:19:36 2023 +0100

    Test No2

commit acf73d7
Author: Sven Reichel <[email protected]>
Date:   Sun Jan 15 01:53:48 2023 +0100

    Test

commit f77300c
Author: Mohamed ELIDRISSI <[email protected]>
Date:   Wed Jan 11 11:50:43 2023 +0100

    Remove ProxyPassMatch from apache site

    Should fallback to php7.3-fpm.conf since it's enabled AFAIK

commit d633e04
Author: Colin Mollenhour <[email protected]>
Date:   Wed Jan 11 01:07:57 2023 -0500

    Troubleshooting Selenium/Apache

commit 59d6343
Author: Colin Mollenhour <[email protected]>
Date:   Wed Jan 11 01:02:03 2023 -0500

    Troubleshooting Selenium/Apache

commit df8f211
Author: Colin Mollenhour <[email protected]>
Date:   Tue Jan 10 18:27:56 2023 -0500

    Migrate MTF from Travis to Github Actions. First attempt.

commit 46e5c36
Merge: b0acd23 bd0cb12
Author: Colin Mollenhour <[email protected]>
Date:   Tue Jan 10 16:55:59 2023 -0500

    Merge remote-tracking branch 'openmage/1.9.4.x' into functional-test-suite

commit b0acd23
Author: akrzemianowski <[email protected]>
Date:   Mon Jun 29 16:11:44 2020 +0200

    Fixed issue with admin login after forced password rehash (#1071)

commit 24e1d5c
Author: szymonbdeligo <[email protected]>
Date:   Thu Jun 25 00:40:51 2020 +0200

    Fix static tests forPHP 7.4 (#1058)

commit 08c79ad
Author: Colin Mollenhour <[email protected]>
Date:   Mon Jun 22 00:57:39 2020 -0400

    Fix install command to use same password as mtf.

commit 58ff3c6
Author: Colin Mollenhour <[email protected]>
Date:   Sun Jun 21 20:44:13 2020 -0400

    Add travis timeout for 30 minutes as per @szymonbdeligo.

commit e544ea9
Author: Tymoteusz Motylewski <[email protected]>
Date:   Mon May 18 22:49:23 2020 +0200

    Make script files executable

commit 17a4131
Author: Colin Mollenhour <[email protected]>
Date:   Tue May 5 18:14:12 2020 -0400

    Add script for running MTF locally via Docker.

commit 8219636
Author: Colin Mollenhour <[email protected]>
Date:   Tue May 5 17:03:45 2020 -0400

    Remove DownloaderPart2Test and DownloaderTest as they do not run and we do not support downloader.

commit 4620035
Author: Colin Mollenhour <[email protected]>
Date:   Tue May 5 15:17:47 2020 -0400

    Fix Composer install for PHP 7.4

commit 2aed58c
Author: Colin Mollenhour <[email protected]>
Date:   Tue May 5 15:13:59 2020 -0400

    Generate tests and remove filter.

commit 8ff94e7
Author: Colin Mollenhour <[email protected]>
Date:   Tue May 5 14:35:23 2020 -0400

    Try to reconcile magento/mtf updates and PHPUnit updates.

commit 6eee8a0
Author: Colin Mollenhour <[email protected]>
Date:   Tue May 5 12:56:59 2020 -0400

    Disable `mtf troubleshooting:check-all` command as it appears to only fork for Magento 2

commit 50b837e
Author: Colin Mollenhour <[email protected]>
Date:   Mon May 4 20:13:41 2020 -0400

    Try updating PHPUnit dependencies. May require PHPUnit 8.

commit 2deb37d
Author: Colin Mollenhour <[email protected]>
Date:   Mon May 4 20:02:20 2020 -0400

    Trying Magento MTF rc64.

commit 6ac2ed3
Author: Colin Mollenhour <[email protected]>
Date:   Mon May 4 19:12:08 2020 -0400

    Add back troubleshooting:check-all step.

commit 5095481
Author: Colin Mollenhour <[email protected]>
Date:   Mon May 4 19:08:10 2020 -0400

    Add missing travis_acceptance.xml

commit a0f4b10
Author: Colin Mollenhour <[email protected]>
Date:   Mon May 4 18:51:56 2020 -0400

    Fix before_script.sh for functional test. Skip composer install for static test.

commit b9134fe
Author: Colin Mollenhour <[email protected]>
Date:   Mon May 4 18:37:24 2020 -0400

    Fix invalid password for admin, remove unneeded static test steps.

commit 01e04da
Author: Colin Mollenhour <[email protected]>
Date:   Mon May 4 18:23:58 2020 -0400

    Fix Magento install.

commit 30564cc
Author: Colin Mollenhour <[email protected]>
Date:   Mon May 4 18:09:32 2020 -0400

    Shell scriupts must be executable.

commit c57d92c
Author: Colin Mollenhour <[email protected]>
Date:   Mon May 4 18:04:19 2020 -0400

    First attempt to get functional tests working using magento2 travis files.

Conflicts:
	dev/tests/functional/lib/Magento/Mtf/App/State/AbstractState.php
	dev/tests/functional/lib/Magento/Mtf/App/State/State1.php
	dev/tests/functional/lib/Magento/Mtf/Client/Driver/Selenium/Driver.php
	dev/tests/functional/lib/Magento/Mtf/Client/Element/SimpleElement.php
	dev/tests/functional/lib/Magento/Mtf/Util/Generate/Page.php
  • Loading branch information
colinmollenhour committed Apr 4, 2023
1 parent 4acf457 commit b5df99e
Show file tree
Hide file tree
Showing 275 changed files with 3,840 additions and 1,747 deletions.
12 changes: 12 additions & 0 deletions .github/mtf/apache_virtual_host
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<VirtualHost *:80>
DocumentRoot $GITHUB_WORKSPACE
ServerName $MAGENTO_HOST_NAME
DirectoryIndex /index.php index.php

<Directory "$GITHUB_WORKSPACE">
Options FollowSymLinks MultiViews ExecCGI
AllowOverride All
Require all granted
</Directory>

</VirtualHost>
14 changes: 14 additions & 0 deletions .github/mtf/www.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[www]

user = www-data
group = www-data

listen = 127.0.0.1:9000

pm = dynamic
pm.max_children = 10
pm.start_servers = 4
pm.min_spare_servers = 2
pm.max_spare_servers = 6

php_admin_value[date.timezone] = UTC
151 changes: 151 additions & 0 deletions .github/workflows/mtf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
name: Magento Test Framework
on: [pull_request]
jobs:
functional:
runs-on: ubuntu-latest

env:
PHP_VERSION: 7.3 # 8.1.14 is broken (https://github.com/php/php-src/commit/d12ba111e03fa4e6d76a66a029f5dbe6265b1ea9)
MAGENTO_HOST_NAME: localhost
SELENIUM_HOST: http://selenium:4444/wd/hub

services:
mysql:
image: bitnami/mysql:8.0.31
env:
ALLOW_EMPTY_PASSWORD: yes
MYSQL_USER: openmage
MYSQL_PASSWORD: openmage
MYSQL_DATABASE: openmage
MYSQL_AUTHENTICATION_PLUGIN: mysql_native_password
ports:
- 3306/tcp
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
selenium:
image: selenium/standalone-firefox
# options: --health-cmd "curl http://127.0.0.1:4444" --health-interval=5s
ports:
- 4444:4444

steps:
- name: Checkout OpenMage repo
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PHP_VERSION }}
extensions: ctype, curl, dom, gd, hash, iconv, intl, json, libxml, mbstring, pdo_mysql, xml, soap, zlib

- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache Composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install OpenMage dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader

- name: Install OpenMage
env:
DB_PORT: ${{ job.services.mysql.ports[3306] }}
run: |
mysqladmin ping -u root -h 127.0.0.1 -P $DB_PORT --wait=1
sudo chmod 770 app/etc var/ media/
sudo chgrp -R www-data .
php -d date.timezone=UTC -f install.php -- \
--license_agreement_accepted yes \
--locale en_US \
--timezone "America/Los_Angeles" \
--default_currency USD \
--db_host 127.0.0.1:${DB_PORT} \
--db_name openmage \
--db_user openmage \
--db_pass openmage \
--url "http://${MAGENTO_HOST_NAME}/" \
--skip_url_validation \
--use_rewrites yes \
--use_secure no \
--secure_base_url "http://${MAGENTO_HOST_NAME}/" \
--use_secure_admin no \
--admin_lastname Owner \
--admin_firstname Store \
--admin_email "[email protected]" \
--admin_username admin \
--admin_password 123123q123123q \
--encryption_key "I2V7t7fiCIRKw9FWz4m3CStgeBG1T+ATZ0Us+W8jAIk="
- name: Install MTF dependencies
working-directory: ./dev/tests/functional
run: composer install --no-ansi --no-interaction --no-scripts --no-progress --ignore-platform-reqs

- name: Substitute vars for web server
uses: dominicwatson/github-action-envsubst@v1
with:
files: .github/mtf/apache_virtual_host .github/mtf/www.conf dev/tests/functional/etc/config.xml
patterns: $GITHUB_WORKSPACE $MAGENTO_HOST_NAME $PHP_VERSION

- name: Start PHP-FPM
run: |
# Other files of interest: /etc/php/7.3/fpm/php-fpm.conf /etc/php/7.3/fpm/php.ini
sudo cp -f .github/mtf/www.conf /etc/php/${{ env.PHP_VERSION}}/fpm/pool.d/www.conf
sudo php-fpm -v
sudo php-fpm -t
sudo systemctl start php${{ env.PHP_VERSION}}-fpm
- name: Start Apache web server
run: |
ls -l /etc/apache2/*
sudo cp -f .github/mtf/apache_virtual_host /etc/apache2/sites-available/000-default.conf
sudo cp robots.txt.sample robots.txt
sudo chown -R www-data:www-data var media
sudo a2enmod rewrite proxy proxy_fcgi
sudo a2enconf php${{ env.PHP_VERSION}}-fpm.conf
sudo apache2ctl -t
sudo systemctl restart apache2
curl --no-progress-meter http://$MAGENTO_HOST_NAME/robots.txt
curl --no-progress-meter http://$MAGENTO_HOST_NAME/index.php
curl --no-progress-meter http://$MAGENTO_HOST_NAME/
- name: Setup and check MTF
working-directory: ./dev/tests/functional
run: |
cp ./phpunit.xml.dist ./phpunit.xml
sed -e "s?localhost?${MAGENTO_HOST_NAME}?g" --in-place ./phpunit.xml
sed -e "s?basic?travis_acceptance?g" --in-place ./phpunit.xml
php -f utils/generate.php
cd ./utils
#php -f mtf troubleshooting:check-all
- name: Check Selenium server
env:
SELENIUM_PORT: ${{ job.services.selenium.ports[4444] }}
run: |
curl --no-progress-meter http://localhost:$SELENIUM_PORT/wd/hub/status
- name: Run Magento Test Framework test suite
working-directory: ./dev/tests/functional
run: vendor/phpunit/phpunit/phpunit

# - name: Run Magento Test Framework test suite
# uses: GabrielBB/xvfb-action@v1
# with:
# run: vendor/phpunit/phpunit/phpunit
# working-directory: ./dev/tests/functional

- name: Publish test results
uses: EnricoMi/[email protected]
if: always()
continue-on-error: true
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
files: output/*.xml
2 changes: 1 addition & 1 deletion app/code/core/Mage/Core/Model/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,7 @@ public function getDistroServerVars()

$baseUrl = $scheme . $host . $port . rtrim($path, '/') . '/';
} else {
$baseUrl = 'http://localhost/';
$baseUrl = 'http://127.0.0.1/';
}

$options = $this->getOptions();
Expand Down
2 changes: 1 addition & 1 deletion app/design/adminhtml/default/openmage/template/login.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<div class="clear"></div>
<div class="form-buttons">
<a class="left" href="<?php echo Mage::helper('adminhtml')->getUrl('adminhtml/index/forgotpassword', ['_nosecret' => true]) ?>"><?php echo Mage::helper('adminhtml')->__('Forgot your password?') ?></a>
<input type="submit" class="form-button" value="<?php echo Mage::helper('core')->quoteEscape(Mage::helper('adminhtml')->__('Login')) ?>" title="<?php echo Mage::helper('core')->quoteEscape(Mage::helper('adminhtml')->__('Login')) ?>" />
<input type="submit" class="link-login form-button" value="<?php echo Mage::helper('core')->quoteEscape(Mage::helper('adminhtml')->__('Login')) ?>" title="<?php echo Mage::helper('core')->quoteEscape(Mage::helper('adminhtml')->__('Login')) ?>" />
</div>
</div>
<p class="legal"><?php echo Mage::helper('adminhtml')->__('Powered by OpenMage') ?></p>
Expand Down
2 changes: 2 additions & 0 deletions dev/tests/functional/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
vendor
generated
32 changes: 32 additions & 0 deletions dev/tests/functional/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Magento Functional Tests

This suite of tests is based on the abandoned magento/mtf project.

## Install

First, install dependencies using composer:

```sh
docker run --rm -it \
--volume $PWD:/app --volume ${COMPOSER_HOME:-$HOME/.composer}:/tmp \
--user $(id -u):$(id -g) \
composer --ignore-platform-reqs install
```

Then generate tests using PHP:

```sh
docker run --rm -it \
--volume $(realpath $PWD/../../../):/app --workdir /app \
php:7.2 \
php -f dev/tests/functional/utils/generate.php
```

Run tests:

```sh
docker run --rm -it \
--volume $(realpath $PWD/../../../):/app --workdir /app \
php:7.2 \
dev/tests/functional/vendor/phpunit/phpunit/phpunit -c dev/tests/functional
```
13 changes: 7 additions & 6 deletions dev/tests/functional/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@
"repositories": [
{
"type": "git",
"url": "https://github.com/magento/mtf.git"
"url": "https://github.com/openmage/mtf.git"
},
{
"type": "vcs",
"url": "https://github.com/giorgiosironi/phpunit-selenium.git"
}
],
"require": {
"magento/mtf": "1.0.0-rc41",
"php": ">=5.4.0",
"phpunit/phpunit": "4.1.0",
"phpunit/phpunit-selenium": ">=1.2",
"netwing/selenium-server-standalone": ">=2.35"
"magento/mtf": "1.0.0-rc64",
"php": "~7.1.0||~7.2.0||~7.3.0",
"phpunit/phpunit": "~6.5.0",
"phpunit/phpunit-selenium": "~4.1.0",
"php-webdriver/webdriver": "~1.8.2",
"se/selenium-server-standalone": "2.53.1"
},
"autoload": {
"psr-4": {
Expand Down
Loading

0 comments on commit b5df99e

Please sign in to comment.