Skip to content

Conversation

@DanielRuthardt
Copy link

πŸ“‘ What

Fix exit code and options handling in core::test::assert_exit_code.
Improve exit code and options handling in all similar assert functions.

❓ Why

As tests are getting added, tests that use core::test::assert_exit_code, all assert functions need to work reliably.

⚑ How to Review

βœ… Testing

  • I have tested my work
  • I need you to test it too

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes critical bugs in exit code handling for test assertion functions (assert_success, assert_failure, and assert_exit_code) and improves their reliability when used with shell option set -e.

Key Changes:

  • Fixed incorrect exit code capture logic that was broken in the old implementations (exit codes were being captured from the wrong commands)
  • Added proper set -e option handling to prevent premature script termination when assertions run commands that may fail
  • Applied consistent implementation pattern across all three assertion functions

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
libs/core/test/assert_success Fixed exit code capture and added set -e handling to properly test commands that should succeed
libs/core/test/assert_failure Fixed exit code capture and added set -e handling to properly test commands that should fail
libs/core/test/assert_exit_code Added set -e handling to properly test commands with specific exit codes

πŸ’‘ Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Daniel Ruthardt and others added 4 commits November 14, 2025 11:03
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.


πŸ’‘ Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@DanielRuthardt DanielRuthardt merged commit 6fe1c3c into main Nov 14, 2025
8 checks passed
@DanielRuthardt DanielRuthardt deleted the fix/assert_exit_code branch November 14, 2025 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants