Releases: palkan/wsdirector
1.0.0
We're glad to announce our first major release 🎉
The primary purpose of this release is to separate CLI from library (and thus provide an ability to use WS Director programmatically).
You can run WS Director from your code using a simple API:
WSDirector.run(scenario_path_or_hash, url:, **options)
There are also various additions and improvements, see below.
Read also WebSocket Director: scenario-based integration tests for realtime apps
Changes
-
WS Director is now distributed in two forms (gems):
wsdirector-core
andwsdirector-cli
. The latter includes the former and adds an executable and CLI-specific dependencies. -
The
receive
action is no order-independent.
Usingreceive
now looks up a matching message through all the mailbox (already received or newly arrived messages). If you need strict order guarantees, addordered: true
to thereceive
step. This change makes it easier to write scenario and reflect the asynchronous nature of WebSockets. -
It's now possible (and recommended) to specify URL and scenario file via the
-u
and-f
options respectively. It's still possible to specify URL and file path using the positional arguments.
Features
-
Added Phoenix Channels protocol (v2) support.
-
Added support for partial
receive
data matching (viadata>
field). -
Added connection options support (headers, cookies, query).
-
Added ability to load custom protocols when running
wsdirector
CLI. -
Added
-vv
option to print colorful action logs. -
[Experimental] Added
WSDirector::Snapshot
, an utility class which could be used to record WebSocket interactions and dump them into files to re-use later (like VCR).
0.5.0
0.4.0
Features
- Added sampling support.
You can specify a sample
option for a step to only run this step by specified number of clients from the group:
- perform:
sample: ":scale / 2"
channel: "chat"
params:
id: 2
action: "speak"
data:
message: "Hello!"
Useful in combination with :scale
.
NOTE: Sample size is always greater or equal to 1.
- Added ERB support.
Now you can, for example, parameterize scenarios with env vars:
- perform:
channel: "chat"
params:
id: <%= ENV["CHAT_ID"] %>
action: "speak"
data:
message: "Hello!"
Changes
- Ruby 2.5 is now required.