Skip to content

Commit

Permalink
"Hab launch returns the error code returned by the called alias" testing
Browse files Browse the repository at this point in the history
  • Loading branch information
MHendricks committed Jan 15, 2024
1 parent 5084337 commit cbda1dd
Show file tree
Hide file tree
Showing 28 changed files with 84 additions and 4 deletions.
2 changes: 2 additions & 0 deletions tests/reference_scripts/ps1_activate_launch/hab_config.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,5 @@ function pip() {

# Run the requested command
pip
# Ensure the exit-code is reported to the calling process.
exit $LASTEXITCODE
3 changes: 2 additions & 1 deletion tests/reference_scripts/ps1_env/hab_launch.ps1
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
powershell.exe -NoExit -ExecutionPolicy Unrestricted . "{{ tmpdir / "hab_config.ps1" }}"
powershell.exe -NoExit -ExecutionPolicy Unrestricted -File "{{ tmpdir / "hab_config.ps1" }}"
exit $LASTEXITCODE
2 changes: 2 additions & 0 deletions tests/reference_scripts/ps1_env_launch/hab_config.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,5 @@ function pip() {

# Run the requested command
pip
# Ensure the exit-code is reported to the calling process.
exit $LASTEXITCODE
3 changes: 2 additions & 1 deletion tests/reference_scripts/ps1_env_launch/hab_launch.ps1
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
powershell.exe -NoExit -ExecutionPolicy Unrestricted . "{{ tmpdir / "hab_config.ps1" }}"
powershell.exe -NoExit -ExecutionPolicy Unrestricted -File "{{ tmpdir / "hab_config.ps1" }}"
exit $LASTEXITCODE
2 changes: 2 additions & 0 deletions tests/reference_scripts/ps1_launch/hab_config.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,5 @@ function pip() {

# Run the requested command
pip
# Ensure the exit-code is reported to the calling process.
exit $LASTEXITCODE
3 changes: 2 additions & 1 deletion tests/reference_scripts/ps1_launch/hab_launch.ps1
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
powershell.exe -ExecutionPolicy Unrestricted . "{{ tmpdir / "hab_config.ps1" }}"
powershell.exe -ExecutionPolicy Unrestricted -File "{{ tmpdir / "hab_config.ps1" }}"
exit $LASTEXITCODE
2 changes: 2 additions & 0 deletions tests/reference_scripts/ps1_launch_args/hab_config.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,5 @@ function pip() {

# Run the requested command
as_str -c "print('Running...');import sys;print('sys', sys)"
# Ensure the exit-code is reported to the calling process.
exit $LASTEXITCODE
3 changes: 2 additions & 1 deletion tests/reference_scripts/ps1_launch_args/hab_launch.ps1
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
powershell.exe -ExecutionPolicy Unrestricted . "{{ tmpdir / "hab_config.ps1" }}"
powershell.exe -ExecutionPolicy Unrestricted -File "{{ tmpdir / "hab_config.ps1" }}"
exit $LASTEXITCODE
5 changes: 5 additions & 0 deletions tests/reference_scripts/sh_linux_activate/hab_config.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Customize the prompt
export PS1="[not_set/child] $PS1"

# Exit immediately if a command exits with a non-zero status.
# This ensures that if any exit codes are encountered it gets propagated to
# whatever originally called hab.
set -e

# Setting global environment variables:
unset UNSET_VARIABLE
export TEST="case"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Customize the prompt
export PS1="[not_set/child] $PS1"

# Exit immediately if a command exits with a non-zero status.
# This ensures that if any exit codes are encountered it gets propagated to
# whatever originally called hab.
set -e

# Setting global environment variables:
unset UNSET_VARIABLE
export TEST="case"
Expand Down
5 changes: 5 additions & 0 deletions tests/reference_scripts/sh_linux_env/hab_config.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Customize the prompt
export PS1="[not_set/child] $PS1"

# Exit immediately if a command exits with a non-zero status.
# This ensures that if any exit codes are encountered it gets propagated to
# whatever originally called hab.
set -e

# Setting global environment variables:
unset UNSET_VARIABLE
export TEST="case"
Expand Down
1 change: 1 addition & 0 deletions tests/reference_scripts/sh_linux_env/hab_launch.sh
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
set -e
bash --init-file "{{ tmpdir / "hab_config.sh" }}"
5 changes: 5 additions & 0 deletions tests/reference_scripts/sh_linux_env_launch/hab_config.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Customize the prompt
export PS1="[not_set/child] $PS1"

# Exit immediately if a command exits with a non-zero status.
# This ensures that if any exit codes are encountered it gets propagated to
# whatever originally called hab.
set -e

# Setting global environment variables:
unset UNSET_VARIABLE
export TEST="case"
Expand Down
1 change: 1 addition & 0 deletions tests/reference_scripts/sh_linux_env_launch/hab_launch.sh
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
set -e
bash --init-file "{{ tmpdir / "hab_config.sh" }}"
5 changes: 5 additions & 0 deletions tests/reference_scripts/sh_linux_launch/hab_config.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Customize the prompt
export PS1="[not_set/child] $PS1"

# Exit immediately if a command exits with a non-zero status.
# This ensures that if any exit codes are encountered it gets propagated to
# whatever originally called hab.
set -e

# Setting global environment variables:
unset UNSET_VARIABLE
export TEST="case"
Expand Down
1 change: 1 addition & 0 deletions tests/reference_scripts/sh_linux_launch/hab_launch.sh
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
set -e
bash --init-file "{{ tmpdir / "hab_config.sh" }}"
5 changes: 5 additions & 0 deletions tests/reference_scripts/sh_linux_launch_args/hab_config.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Customize the prompt
export PS1="[not_set/child] $PS1"

# Exit immediately if a command exits with a non-zero status.
# This ensures that if any exit codes are encountered it gets propagated to
# whatever originally called hab.
set -e

# Setting global environment variables:
unset UNSET_VARIABLE
export TEST="case"
Expand Down
1 change: 1 addition & 0 deletions tests/reference_scripts/sh_linux_launch_args/hab_launch.sh
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
set -e
bash --init-file "{{ tmpdir / "hab_config.sh" }}"
5 changes: 5 additions & 0 deletions tests/reference_scripts/sh_win_activate/hab_config.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Customize the prompt
export PS1="[not_set/child] $PS1"

# Exit immediately if a command exits with a non-zero status.
# This ensures that if any exit codes are encountered it gets propagated to
# whatever originally called hab.
set -e

# Setting global environment variables:
unset UNSET_VARIABLE
export TEST="case"
Expand Down
5 changes: 5 additions & 0 deletions tests/reference_scripts/sh_win_activate_launch/hab_config.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Customize the prompt
export PS1="[not_set/child] $PS1"

# Exit immediately if a command exits with a non-zero status.
# This ensures that if any exit codes are encountered it gets propagated to
# whatever originally called hab.
set -e

# Setting global environment variables:
unset UNSET_VARIABLE
export TEST="case"
Expand Down
5 changes: 5 additions & 0 deletions tests/reference_scripts/sh_win_env/hab_config.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Customize the prompt
export PS1="[not_set/child] $PS1"

# Exit immediately if a command exits with a non-zero status.
# This ensures that if any exit codes are encountered it gets propagated to
# whatever originally called hab.
set -e

# Setting global environment variables:
unset UNSET_VARIABLE
export TEST="case"
Expand Down
1 change: 1 addition & 0 deletions tests/reference_scripts/sh_win_env/hab_launch.sh
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
set -e
bash --init-file "{{ tmpdir / "hab_config.sh" }}"
5 changes: 5 additions & 0 deletions tests/reference_scripts/sh_win_env_launch/hab_config.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Customize the prompt
export PS1="[not_set/child] $PS1"

# Exit immediately if a command exits with a non-zero status.
# This ensures that if any exit codes are encountered it gets propagated to
# whatever originally called hab.
set -e

# Setting global environment variables:
unset UNSET_VARIABLE
export TEST="case"
Expand Down
1 change: 1 addition & 0 deletions tests/reference_scripts/sh_win_env_launch/hab_launch.sh
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
set -e
bash --init-file "{{ tmpdir / "hab_config.sh" }}"
5 changes: 5 additions & 0 deletions tests/reference_scripts/sh_win_launch/hab_config.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Customize the prompt
export PS1="[not_set/child] $PS1"

# Exit immediately if a command exits with a non-zero status.
# This ensures that if any exit codes are encountered it gets propagated to
# whatever originally called hab.
set -e

# Setting global environment variables:
unset UNSET_VARIABLE
export TEST="case"
Expand Down
1 change: 1 addition & 0 deletions tests/reference_scripts/sh_win_launch/hab_launch.sh
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
set -e
bash --init-file "{{ tmpdir / "hab_config.sh" }}"
5 changes: 5 additions & 0 deletions tests/reference_scripts/sh_win_launch_args/hab_config.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Customize the prompt
export PS1="[not_set/child] $PS1"

# Exit immediately if a command exits with a non-zero status.
# This ensures that if any exit codes are encountered it gets propagated to
# whatever originally called hab.
set -e

# Setting global environment variables:
unset UNSET_VARIABLE
export TEST="case"
Expand Down
1 change: 1 addition & 0 deletions tests/reference_scripts/sh_win_launch_args/hab_launch.sh
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
set -e
bash --init-file "{{ tmpdir / "hab_config.sh" }}"

0 comments on commit cbda1dd

Please sign in to comment.