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

Introduce reproducer for broken function autoloading #773

Merged
merged 5 commits into from
Nov 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .github/workflows/e2e-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ jobs:
- 'e2e_032'
- 'e2e_033'
- 'e2e_034'
- 'e2e_035'
php:
- '8.1'

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
/.php-cs-fixer.cache
/box.json
/build/
!/build/.gitkeep
/clover.xml
/dist/
/fixtures/set004/scoper.inc.php
Expand Down
35 changes: 34 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ blackfire: vendor

.PHONY: e2e
e2e: ## Runs end-to-end tests
e2e: e2e_004 e2e_005 e2e_011 e2e_013 e2e_014 e2e_015 e2e_016 e2e_017 e2e_018 e2e_019 e2e_020 e2e_024 e2e_025 e2e_027 e2e_028 e2e_029 e2e_030 e2e_031 e2e_032 e2e_033 e2e_034
e2e: e2e_004 e2e_005 e2e_011 e2e_013 e2e_014 e2e_015 e2e_016 e2e_017 e2e_018 e2e_019 e2e_020 e2e_024 e2e_025 e2e_027 e2e_028 e2e_029 e2e_030 e2e_031 e2e_032 e2e_033 e2e_034 e2e_035

.PHONY: e2e_004
e2e_004: ## Runs end-to-end tests for the fixture set 004 — Minimalistic codebase
Expand Down Expand Up @@ -473,6 +473,25 @@ e2e_034: $(PHP_SCOPER_PHAR_BIN) fixtures/set034-installed-versions/vendor

diff fixtures/set034-installed-versions/expected-output build/set034-installed-versions/output

.PHONY: e2e_035
e2e_035: ## Runs end-to-end tests for the fixture set 035 — Tests tha composer autoloaded files are working fine
e2e_035: $(PHP_SCOPER_PHAR_BIN) fixtures/set035-composer-files-autoload/vendor fixtures/set035-composer-files-autoload/guzzle5-include/vendor
rm -rf build/set035-composer-files-autoload || true
cp -R fixtures/set035-composer-files-autoload build/set035-composer-files-autoload

$(PHP_SCOPER_PHAR) add-prefix \
--working-dir=fixtures/set035-composer-files-autoload/guzzle5-include \
--output-dir=../../../build/set035-composer-files-autoload/scoped-guzzle5-include \
--force \
--no-config \
--no-interaction \
--stop-on-failure
composer --working-dir=build/set035-composer-files-autoload/scoped-guzzle5-include dump-autoload
rm -rf build/set035-composer-files-autoload/guzzle5-include || true

php build/set035-composer-files-autoload/index.php &> build/set035-composer-files-autoload/output || true
php build/set035-composer-files-autoload/test.php


#
# Rules from files
Expand Down Expand Up @@ -667,3 +686,17 @@ fixtures/set034-installed-versions/vendor: fixtures/set034-installed-versions/co
fixtures/set034-installed-versions/composer.lock: fixtures/set034-installed-versions/composer.json
@echo "$(@) is not up to date. You may want to run the following command:"
@echo "$$ composer --working-dir=fixtures/set034-installed-versions update --lock && touch -c $(@)"

fixtures/set035-composer-files-autoload/vendor: fixtures/set035-composer-files-autoload/composer.lock
composer --working-dir=fixtures/set035-composer-files-autoload install --no-dev --no-scripts
touch -c $@
fixtures/set035-composer-files-autoload/composer.lock: fixtures/set035-composer-files-autoload/composer.json
@echo "$(@) is not up to date. You may want to run the following command:"
@echo "$$ composer --working-dir=fixtures/set035-composer-files-autoload update --lock && touch -c $(@)"

fixtures/set035-composer-files-autoload/guzzle5-include/vendor: fixtures/set035-composer-files-autoload/guzzle5-include/composer.lock
composer --working-dir=fixtures/set035-composer-files-autoload/guzzle5-include install --no-dev --no-scripts
touch -c $@
fixtures/set035-composer-files-autoload/guzzle5-include/composer.lock: fixtures/set035-composer-files-autoload/guzzle5-include/composer.json
@echo "$(@) is not up to date. You may want to run the following command:"
@echo "$$ composer --working-dir=fixtures/set035-composer-files-autoload/guzzle5-include update --lock && touch -c $(@)"
Empty file added build/.gitkeep
Empty file.
2 changes: 2 additions & 0 deletions fixtures/set035-composer-files-autoload/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/vendor/
/guzzle5-include/vendor/
6 changes: 6 additions & 0 deletions fixtures/set035-composer-files-autoload/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"bin": "index.php",
"require": {
"guzzlehttp/guzzle": "^6.0"
}
}
Loading