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

Powershell alias return correct exit codes #1778

Conversation

brycegbrazen
Copy link
Contributor

Fixes issue where powershell plugins were not correctly capturing exit codes when aliased commands failed.

Closes #1776.

@brycegbrazen brycegbrazen requested a review from a team as a code owner June 21, 2024 17:29
Signed-off-by: brycegbrazen <bryce.gattis@brazenanimation.com>
… a process as they both seem to miss certain circumstances

Signed-off-by: brycegbrazen <bryce.gattis@brazenanimation.com>
@brycegbrazen brycegbrazen force-pushed the powershell_alias_exit_codes branch from a20d7de to fcc4b38 Compare June 21, 2024 17:31
Copy link

codecov bot commented Jun 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 58.40%. Comparing base (a13f7bb) to head (3a90505).
Report is 55 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1778      +/-   ##
==========================================
- Coverage   58.41%   58.40%   -0.01%     
==========================================
  Files         126      126              
  Lines       17163    17165       +2     
  Branches     3506     3506              
==========================================
+ Hits        10025    10026       +1     
- Misses       6473     6474       +1     
  Partials      665      665              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@brycegbrazen
Copy link
Contributor Author

Looks like Python isn't installed to all of our action VMs? Not sure what other command I could use that's shell agnostic outside of echo. I don't think there's a way to make echo fail as I need this test to.

@JeanChristopheMorinPerso
Copy link
Member

@brycegbrazen these tests are complex, so reuse what's already there and don't call python directly. Look at the test_command test. It uses a pre-configured hello_world command that I think can be instructed to exit with a specific exit code.

@JeanChristopheMorinPerso
Copy link
Member

https://github.com/AcademySoftwareFoundation/rez/blob/main/src%2Frez%2Fbind%2Fhello_world.py#L34

@JeanChristopheMorinPerso JeanChristopheMorinPerso added this to the Next milestone Jun 22, 2024
Co-authored-by: Jean-Christophe Morin <38703886+JeanChristopheMorinPerso@users.noreply.github.com>
Signed-off-by: Bryce Gattis <69012021+brycegbrazen@users.noreply.github.com>
@JeanChristopheMorinPerso JeanChristopheMorinPerso merged commit 63326f2 into AcademySoftwareFoundation:main Sep 22, 2024
47 checks passed
Pixel-Minions added a commit to Pixel-Minions/rez that referenced this pull request Sep 26, 2024
…areFoundation#1778)

Fixes issue where powershell plugins were not correctly capturing exit codes when aliased commands failed (AcademySoftwareFoundation#1778)

---------

Signed-off-by: brycegbrazen <bryce.gattis@brazenanimation.com>
Co-authored-by: Jean-Christophe Morin <38703886+JeanChristopheMorinPerso@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using aliases in Powershell muffles exit code
3 participants