streamdal 0.0.3 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/spec_helper.rb +13 -1
  3. data/lib/wasm_spec.rb +6 -6
  4. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ff825b88dbb81240b3ea5c3fd2cf264a88ecdafbb197ba886ed11acfe098ab93
4
- data.tar.gz: 11a9e57851f4296c715b393d8c3ca7f33506d0050e6a4bf74121f92c141288c4
3
+ metadata.gz: 3155bf2291800b32739e87feef04d880584c07e34e93c08c2892d3d88125e124
4
+ data.tar.gz: b3aae0f7358dd519ac149d1d9b8bdde83e8220b384dbfb6c833b49c6435555f5
5
5
  SHA512:
6
- metadata.gz: e9a744de7a691f637c48289c4647a3b369e89659c02ba4140b57addd8dbf5c3b98e769016b8cdd9158563622570aa82e98bd36fba237f6ec8802590c6c63f943
7
- data.tar.gz: 698cdc39714da510b577bd7bc98d8da174da6c13c32c32c47041e51c64d444e7d5368d3f090b3ec239092fa3db01c93248a7ef14512491c0d6e2122b2446d58c
6
+ metadata.gz: 05f26c41cf0d5cd9236f3fda68233cc624ac8eb1db401c0e621a4bf08be59b09003559f2afcbf1b14d3cc5ef1017743c9924b5cd33a448dd1935d3f624658a9b
7
+ data.tar.gz: 0cae707c2dc3a9a18f9c502d845ae2b80ffd982cb97b5598cebe7ec41b15e7faabcaf50840111f118db17963c6587afa4469cf7eee02e9f47d06a97049440a81
data/lib/spec_helper.rb CHANGED
@@ -1,2 +1,14 @@
1
1
  require 'simplecov'
2
- SimpleCov.start
2
+ require 'simplecov_json_formatter'
3
+ SimpleCov.formatter = SimpleCov::Formatter::JSONFormatter
4
+ SimpleCov.start
5
+
6
+ # This environment variable exists so that we can run WASM tests
7
+ # via the CI process for libs/wasm* and not just through the CI
8
+ # of the ruby-sdk
9
+ WASM_DIR = ENV['WASM_DIR'] || File.join(File.dirname(__FILE__), '..', 'test-assets', 'wasm')
10
+
11
+ # Load the WebAssembly module
12
+ def load_wasm(name)
13
+ File.read(File.join(WASM_DIR, name))
14
+ end
data/lib/wasm_spec.rb CHANGED
@@ -41,7 +41,7 @@ RSpec.describe 'WASM' do
41
41
 
42
42
  context 'detective.wasm' do
43
43
  before(:each) do
44
- wasm_bytes = File.read(File.join(File.dirname(__FILE__), '..', 'test-assets', 'wasm', 'detective.wasm'))
44
+ wasm_bytes = load_wasm('detective.wasm')
45
45
 
46
46
  @step = Streamdal::Protos::PipelineStep.new
47
47
  @step.name = 'detective'
@@ -77,7 +77,7 @@ RSpec.describe 'WASM' do
77
77
 
78
78
  context 'httprequest.wasm' do
79
79
  before(:each) do
80
- wasm_bytes = File.read(File.join(File.dirname(__FILE__), '..', 'test-assets', 'wasm', 'httprequest.wasm'))
80
+ wasm_bytes = load_wasm('httprequest.wasm')
81
81
 
82
82
  http_req_step = Streamdal::Protos::HttpRequestStep.new
83
83
  http_req_step.request = Streamdal::Protos::HttpRequest.new
@@ -104,7 +104,7 @@ RSpec.describe 'WASM' do
104
104
 
105
105
  context 'inferschema.wasm' do
106
106
  before(:each) do
107
- wasm_bytes = File.read(File.join(File.dirname(__FILE__), '..', 'test-assets', 'wasm', 'inferschema.wasm'))
107
+ wasm_bytes = load_wasm('inferschema.wasm')
108
108
 
109
109
  @step = Streamdal::Protos::PipelineStep.new
110
110
  @step.name = 'schema inference'
@@ -130,7 +130,7 @@ RSpec.describe 'WASM' do
130
130
 
131
131
  context 'transform.wasm' do
132
132
  before(:each) do
133
- wasm_bytes = File.read(File.join(File.dirname(__FILE__), '..', 'test-assets', 'wasm', 'transform.wasm'))
133
+ wasm_bytes = load_wasm('transform.wasm')
134
134
 
135
135
  @step = Streamdal::Protos::PipelineStep.new
136
136
  @step.name = 'transform'
@@ -194,7 +194,7 @@ RSpec.describe 'WASM' do
194
194
 
195
195
  context 'validjson.wasm' do
196
196
  before(:each) do
197
- wasm_bytes = File.read(File.join(File.dirname(__FILE__), '..', 'test-assets', 'wasm', 'validjson.wasm'))
197
+ wasm_bytes = load_wasm('validjson.wasm')
198
198
 
199
199
  @step = Streamdal::Protos::PipelineStep.new
200
200
  @step.name = 'validate json'
@@ -226,7 +226,7 @@ RSpec.describe 'WASM' do
226
226
 
227
227
  context 'kv.wasm' do
228
228
  before(:each) do
229
- wasm_bytes = File.read(File.join(File.dirname(__FILE__), '..', 'test-assets', 'wasm', 'kv.wasm'))
229
+ wasm_bytes = load_wasm('kv.wasm')
230
230
 
231
231
  client.kv.set('test', 'test')
232
232
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: streamdal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Gregan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-19 00:00:00.000000000 Z
11
+ date: 2024-06-20 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: mark@streamdal.com
@@ -46,7 +46,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - '='
48
48
  - !ruby/object:Gem::Version
49
- version: 0.0.3
49
+ version: 0.0.5
50
50
  required_rubygems_version: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="