-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests to ensure environment variables are correctly forwarded (#116)
Closes #63
- Loading branch information
Showing
7 changed files
with
67 additions
and
1 deletion.
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,6 @@ | ||
/actual.txt | ||
/.composer/ | ||
/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 @@ | ||
Check that the composer environment variables are well respected when commands are forwarded to the namespaces. |
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,2 @@ | ||
./.composer | ||
.composer |
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,31 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -Eeuo pipefail | ||
|
||
# Set env envariables in order to experience a behaviour closer to what happens | ||
# in the CI locally. It should not hurt to set those in the CI as the CI should | ||
# contain those values. | ||
export CI=1 | ||
export COMPOSER_NO_INTERACTION=1 | ||
|
||
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 || true | ||
rm -rf composer.lock || true | ||
rm -rf vendor || true | ||
rm -rf vendor-bin/*/composer.lock || true | ||
rm -rf vendor-bin/*/vendor || true | ||
rm -rf vendor-bin/*/.composer || true | ||
|
||
readonly CUSTOM_COMPOSER_DIR=$(pwd)/.composer | ||
COMPOSER_CACHE_DIR=$CUSTOM_COMPOSER_DIR composer update | ||
|
||
# Actual command to execute the test itself | ||
find . ".composer" -name ".composer" -type d 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,5 @@ | ||
{ | ||
"require": { | ||
"nikic/iter": "v1.6.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 |
---|---|---|
@@ -1 +1 @@ | ||
Tests that extra arguments and options are not lost when forwarding the command to a bin namespace. | ||
Tests that plugins installed in a namespace are loaded when a command is executed in the namespace. |