-
Notifications
You must be signed in to change notification settings - Fork 154
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
SieveScript/test: Allow prepopulating variables so your sieve scripts can behave differently during test #5176
base: master
Are you sure you want to change the base?
Conversation
This way consumers can validate identifiers if they need to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This all looks sane to me (assuming CI passes)
This way, a sieve script can behave differently in test mode based on provided parameters to the JMAP call.
Otherwise, a second SieveScript/test call in the same process will fail because template will be invalid. Also add logging if this happens so we can maybe figure out what went wrong.
This way SieveScript/test can reconstruct it properly
This will make it easy to test the SieveScript/test endpoint with various inputs and outputs.
... so you can specify a bunch of related tests together. Also fill in all of the fileinto tests we need for now. With this, you can say: ./testrunner Cyrus::JMAPSieve.sieve_test_extensive_fileinto* to run all of the fileinto tests defined in this file
Otherwise we might try to install weird subroutines and it just won't end well.
The escaping of '\' was surprising and problematic when doing other types of tests, like inline jmapquery expressions. Rather than using that, escape manually when needed.
Without this, and jmapquerys that depend on the conversations db don't work. Also, we need to configure Cassandane::Cyrus::JMAPSieve to allow specific flags to be counted so we can use SomeInThreadHaveKeyword in our tests.
c22fc98
to
adcd55c
Compare
@@ -2257,7 +2259,6 @@ static int jmap_sieve_test(struct jmap_req *req) | |||
} | |||
} | |||
|
|||
if (interp_ctx.cstate) conversations_commit(&interp_ctx.cstate); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The convdb is opened for us by jmap_api. If we commit it here, we'll crash later because jmap_api.c will try to commit it too
Avoid a crash when freeing the memory by freeing the strarray the same way all of the other strarrays are freed here. It appears that parts of the data are from a mmap'd read-only segment so they can't be freed with normal strarray_free().
@rsto I've added include-in-fastmail to this one o/ |
No description provided.