-
Notifications
You must be signed in to change notification settings - Fork 56
TestFeatureStore usage #141
Comments
The file-based test fixture has been on our list for quite a while - I've done some work on it in Java and it shouldn't be too hard to finish it, but it's just taken a back seat to other feature work so I'm not sure what the plan is at present. Knowing that there's another request for it now may help to speed things up. To your other question, no, currently TestFeatureStore doesn't support that. All it really is right now is an InMemoryFeatureStore with some convenience methods for constructing a flag that always returns the same value. Constructing different kinds of flags would require a much richer API that duplicates the internal flag model to some extent, which is probably not a path we want to take - there are a lot of different ways people might want to correlate users with values. The current plan for the file-based fixture was that for each flag key, it would allow you to either specify JSON data for the complete flag model - allowing any kinds of rules - or just a simple value. I imagine that this could be extended with other options such as a mapping of user keys to values - would that work for your purposes or would you require something that is based on attributes? Either way, the advantage of implementing this in the fixture rather than in the client is that they would be separate projects, so adding features to the fixture would not require re-releasing the client. |
Update: we're hoping to release the file-based fixture in Java this week. |
Sorry, some design issues have been holding this up, but it is very close to being available. |
OK, sorry for the delay, but we have just released Java SDK 4.5.0 which includes a file-based test fixture. Here's an example of how you could configure the client to use it:
There are several options for how the data files can be formatted (see the
|
I'm going to close this issue now, but please feel free to reopen it or open a new one if you have any questions or problems regarding this feature. |
fix NewRelic reflection logic to avoid shading
In the context of some unit tests, I'm using an LDClient configured in offline mode along with a TestFeatureStore that I'm using to stub out values of feature flags. This allows me to completely turn a flag on or off, but is there any way to make that more granular? Specifically, I'm setting some custom attributes on the LDUser, and the actual Feature Toggle when deployed has rules set to look at them, but is there any way to achieve that same effect with TestFeatureStore?
Also, I noticed in the Java docs that TestFeatureStore is deprecated with the hints of a file-based test fixture coming... any update on that?
Thanks
The text was updated successfully, but these errors were encountered: