Allow RULE_EXEC_CONTEXT column access by GenQuery1 - #829
Open
d-w-moore wants to merge 3 commits into
Open
Conversation
korydraughn
reviewed
Aug 28, 2026
Comment on lines
+443
to
+445
| if self.sess.server_version < (4, 3): | ||
| self.skipTest("""RuleExec's "context" attribute not available before 4.3.0""") | ||
|
|
Contributor
There was a problem hiding this comment.
This check isn't necessary since iRODS 4.2 is EOL.
Assume the iRODS server is 4.3.0 or later.
| random_int = random.randint(1<<30, (1<<31)-1) | ||
| r = Rule( | ||
| self.sess, | ||
| body=f'''delay("<PLUSET>{n_minutes}m</PLUSET>") {{writeLine("serverLog","{random_int}")}}''' |
Contributor
There was a problem hiding this comment.
Suggested change
| body=f'''delay("<PLUSET>{n_minutes}m</PLUSET>") {{writeLine("serverLog","{random_int}")}}''' | |
| body=f'''delay("<PLUSET>{n_minutes}m</PLUSET>") {{ writeLine("serverLog","{random_int}") }}''' |
| random_int = random.randint(1<<30, (1<<31)-1) | ||
| r = Rule( | ||
| self.sess, | ||
| body=f'''delay("<PLUSET>{n_minutes}m</PLUSET>") {{writeLine("serverLog","{random_int}")}}''' |
Contributor
There was a problem hiding this comment.
Consider specifying the value to <PLUSET> as seconds instead of using the minutes (m) suffix.
| rule_id = l[0][RuleExec.id] | ||
|
|
||
| # Assert context exists, is of string type, and is not empty. | ||
| self.assertGreater(l[0][RuleExec.context], "") |
Contributor
There was a problem hiding this comment.
Let's also assert that RULE_EXEC_CONTEXT is parsable as a JSON string since that is how it is stored in the database.
| self.assertRegex(lines[1], r"\[STRING\]\[A String\]") | ||
|
|
||
|
|
||
| def test_rule_exec_context(self): |
Contributor
There was a problem hiding this comment.
Let's use more words to describe what the test is about. For example:
def test_RULE_EXEC_CONTEXT_column_is_available_via_genquery1(self):| self.assertRegex(lines[1], r"\[STRING\]\[A String\]") | ||
|
|
||
|
|
||
| def test_rule_exec_context(self): |
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.
No description provided.