forked from bamarni/composer-bin-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Capture buggy behaviour with forwarded command (bamarni#113)
Related to bamarni#106
- Loading branch information
Showing
12 changed files
with
144 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/actual.txt | ||
/composer.lock | ||
/vendor/ | ||
/vendor-bin/*/composer.lock | ||
/vendor-bin/*/vendor/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Tests that dev dependencies are not installed if no-dev is passed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"repositories": [ | ||
{ | ||
"type": "path", | ||
"url": "../../" | ||
} | ||
], | ||
"require": { | ||
"bamarni/composer-bin-plugin": "dev-master" | ||
}, | ||
"config": { | ||
"allow-plugins": { | ||
"bamarni/composer-bin-plugin": true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[bamarni-bin] Current working directory: /path/to/project/e2e/scenario7 | ||
[bamarni-bin] Configuring bin directory to /path/to/project/e2e/scenario7/vendor/bin. | ||
[bamarni-bin] Checking namespace vendor-bin/ns1 | ||
[bamarni-bin] Changed current directory to vendor-bin/ns1. | ||
[bamarni-bin] Running `@composer update --no-dev --verbose --working-dir='.' -- foo`. | ||
Cannot update only a partial set of packages without a lock file present. Run `composer update` to generate a lock file. | ||
[bamarni-bin] Changed current directory to /path/to/project/e2e/scenario7. | ||
––––––––––––––––––––– | ||
No dependencies installed. Try running composer install or update. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -Eeuo pipefail | ||
|
||
readonly ORIGINAL_WORKING_DIR=$(pwd) | ||
|
||
trap "cd ${ORIGINAL_WORKING_DIR}" err exit | ||
|
||
# Change to script directory | ||
cd "$(dirname "$0")" | ||
|
||
# Ensure we have a clean state | ||
rm -rf actual.txt || true | ||
rm -rf composer.lock || true | ||
rm -rf vendor || true | ||
rm -rf vendor-bin/*/composer.lock || true | ||
rm -rf vendor-bin/*/vendor || true | ||
|
||
composer update | ||
|
||
# Actual command to execute the test itself | ||
composer bin ns1 update --no-dev --verbose -- foo 2>&1 | tee > actual.txt || true | ||
echo "–––––––––––––––––––––" >> actual.txt | ||
composer bin ns1 show --direct --name-only 2>&1 | tee >> actual.txt || true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"require": { | ||
"nikic/iter": "v1.6.0" | ||
}, | ||
"require-dev": { | ||
"phpstan/phpstan": "1.8.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/actual.txt | ||
/composer.lock | ||
/vendor/ | ||
/vendor-bin/*/composer.lock | ||
/vendor-bin/*/vendor/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Tests that extra arguments and options are not lost when forwarding the command to a bin namespace. | ||
In this scenario the dependencies are not install in the bin namespace since the parsed (forwarded) | ||
command is invalid. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"repositories": [ | ||
{ | ||
"type": "path", | ||
"url": "../../" | ||
} | ||
], | ||
"require": { | ||
"bamarni/composer-bin-plugin": "dev-master" | ||
}, | ||
"config": { | ||
"allow-plugins": { | ||
"bamarni/composer-bin-plugin": true | ||
} | ||
}, | ||
"extra": { | ||
"bamarni-bin": { | ||
"forward-command": true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Loading composer repositories with package information | ||
Updating dependencies | ||
Lock file operations: 1 install, 0 updates, 0 removals | ||
- Locking bamarni/composer-bin-plugin (dev-hash) | ||
Writing lock file | ||
Installing dependencies from lock file | ||
Package operations: 1 install, 0 updates, 0 removals | ||
- Installing bamarni/composer-bin-plugin (dev-hash): Symlinking from ../.. | ||
Generating autoload files | ||
[bamarni-bin] The command is being forwarded. | ||
Loading composer repositories with package information | ||
Updating dependencies | ||
Lock file operations: 2 installs, 0 updates, 0 removals | ||
- Locking nikic/iter (v1.6.0) | ||
- Locking phpstan/phpstan (1.8.0) | ||
Writing lock file | ||
Installing dependencies from lock file | ||
Package operations: 1 install, 0 updates, 0 removals | ||
- Installing nikic/iter (v1.6.0): Extracting archive | ||
Generating autoload files | ||
–––––––––––––– | ||
nikic/iter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -Eeuo pipefail | ||
|
||
readonly ORIGINAL_WORKING_DIR=$(pwd) | ||
|
||
trap "cd ${ORIGINAL_WORKING_DIR}" err exit | ||
|
||
# Change to script directory | ||
cd "$(dirname "$0")" | ||
|
||
# Ensure we have a clean state | ||
rm -rf actual.txt || true | ||
rm -rf composer.lock || true | ||
rm -rf vendor || true | ||
rm -rf vendor-bin/*/composer.lock || true | ||
rm -rf vendor-bin/*/vendor || true | ||
|
||
# Actual command to execute the test itself | ||
composer update --no-dev 2>&1 | tee > actual.txt || true | ||
echo "––––––––––––––" >> actual.txt | ||
composer bin ns1 show --direct --name-only 2>&1 | tee >> actual.txt || true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"require": { | ||
"nikic/iter": "v1.6.0" | ||
}, | ||
"require-dev": { | ||
"phpstan/phpstan": "1.8.0" | ||
} | ||
} |