Skip to content

Add exit code assertions to integration tests#115

Merged
carole-lavillonniere merged 1 commit intomainfrom
carole/drg-581
Mar 16, 2026
Merged

Add exit code assertions to integration tests#115
carole-lavillonniere merged 1 commit intomainfrom
carole/drg-581

Conversation

@carole-lavillonniere
Copy link
Copy Markdown
Collaborator

@carole-lavillonniere carole-lavillonniere commented Mar 16, 2026

Exit codes are part of the contract and must never change with new versions.
Add explicit assertions so that any accidental change to exit behavior is caught immediately.

Towards DRG-581

@carole-lavillonniere carole-lavillonniere marked this pull request as ready for review March 16, 2026 11:01
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 16, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: d22d8487-2f82-4cd5-8070-131fd99e2523

📥 Commits

Reviewing files that changed from the base of the PR and between 2ce11ae and 243bb8a.

📒 Files selected for processing (12)
  • test/integration/awsconfig_test.go
  • test/integration/config_test.go
  • test/integration/license_test.go
  • test/integration/login_test.go
  • test/integration/logout_test.go
  • test/integration/logs_test.go
  • test/integration/main_test.go
  • test/integration/non_interactive_test.go
  • test/integration/start_test.go
  • test/integration/stop_test.go
  • test/integration/telemetry_test.go
  • test/integration/update_test.go

📝 Walkthrough

Walkthrough

This PR adds explicit exit code assertions throughout the integration test suite to validate process termination behavior. A helper function requireExitCode is introduced to check that commands exit with code 0 for success and 1 for failure scenarios.

Changes

Cohort / File(s) Summary
Test Helper Function
test/integration/main_test.go
Added requireExitCode helper function to validate exit codes from executed commands, supporting both zero and non-zero exit codes via exec.ExitError.
Integration Test Exit Code Assertions
test/integration/awsconfig_test.go, test/integration/config_test.go, test/integration/license_test.go, test/integration/login_test.go, test/integration/logout_test.go, test/integration/logs_test.go, test/integration/non_interactive_test.go, test/integration/start_test.go, test/integration/stop_test.go, test/integration/telemetry_test.go, test/integration/update_test.go
Added explicit exit code assertions in success paths (expect 0) and failure paths (expect 1) across multiple integration tests to enforce proper process termination validation alongside existing error and output checks.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • localstack/lstk#92: Initial changes to integration tests including modifications to the test files now being extended with exit code assertions.

Suggested reviewers

  • silv-io
  • anisaoshafi
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title accurately and concisely describes the main change: adding exit code assertions to integration tests throughout the codebase.
Description check ✅ Passed The description is related to the changeset, explaining the rationale for adding exit code assertions and referencing the related work item (DRG-581).

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch carole/drg-581
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can generate a title for your PR based on the changes with custom instructions.

Set the reviews.auto_title_instructions setting to generate a title for your PR based on the changes in the PR with custom instructions.

Copy link
Copy Markdown
Contributor

@anisaoshafi anisaoshafi left a comment

Choose a reason for hiding this comment

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

LGTM!

@carole-lavillonniere carole-lavillonniere merged commit b4532f4 into main Mar 16, 2026
8 checks passed
@carole-lavillonniere carole-lavillonniere deleted the carole/drg-581 branch March 16, 2026 11:57
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.

2 participants