Merged
Conversation
Add test infrastructure for verifying after_transaction callbacks are properly invoked on GraphQL mutations: - AfterTransactionChange: sends message to test process on transaction completion - AfterActionErrorChange: simulates after_action errors for rollback testing - AfterTransactionEts: ETS-based resource with success/error action variants - AfterTransactionMnesia: Mnesia-based resource for real transaction testing
Verify after_transaction callbacks fire correctly for all mutation types:
ETS tests (6 tests):
- Create/update/destroy success: callback receives {:ok, result}
- Create/update/destroy error: callback receives {:error, error}
Mnesia tests (9 tests):
- Same success/error tests as ETS
- Rollback verification: records not persisted when after_action fails
(Mnesia supports real transactions unlike ETS)
Contributor
|
🚀 Thank you for your contribution! 🚀 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add comprehensive tests for
after_transactioncallback behavior in GraphQL mutations.Description
Tests verify that
after_transactionhooks are properly invoked for all mutation types (create, update, destroy) inboth success and error scenarios.
Depends on: ash-project/ash#2532
Test Coverage
Test Infrastructure
AfterTransactionChange: Sends{:after_transaction, action_name, result}to test processAfterActionErrorChange: Simulates after_action errors for rollback testingAfterTransactionEts/AfterTransactionMnesia: Test resources with success/error action variantsTest Plan
Contributor checklist
Leave anything that you believe does not apply unchecked.