diff --git a/.github/workflows/test-harness.yml b/.github/workflows/test-harness.yml index 35c41c2..d1957ea 100644 --- a/.github/workflows/test-harness.yml +++ b/.github/workflows/test-harness.yml @@ -2,7 +2,7 @@ name: Run Test Harness on: pull_request: - branches: [ main ] + branches: [main] jobs: harness-tests: @@ -14,4 +14,3 @@ jobs: with: sdks-to-test: ruby sdk-github-sha: ${{github.event.pull_request.head.sha}} - github-token: ${{ secrets.TEST_HARNESS_GH_SECRET }} diff --git a/.github/workflows/unit-tests.yaml b/.github/workflows/unit-tests.yaml index 93c75e2..812f50b 100644 --- a/.github/workflows/unit-tests.yaml +++ b/.github/workflows/unit-tests.yaml @@ -16,7 +16,8 @@ jobs: strategy: matrix: ruby-version: [ '3.1.0', '3.2.0', '3.3.0' ] - + env: + DEVCYCLE_SERVER_SDK_KEY: ${{ secrets.DEVCYCLE_SERVER_SDK_KEY_UNIT_TESTS }} steps: - uses: actions/checkout@v4 - name: Set up Ruby diff --git a/benchmark/benchmark.rb b/benchmark/benchmark.rb index a30ba12..3fb0f6c 100644 --- a/benchmark/benchmark.rb +++ b/benchmark/benchmark.rb @@ -7,7 +7,7 @@ WebMock.enable! WebMock.disable_net_connect! -stub_request(:get, 'https://config-cdn.devcycle.com/config/v1/server/dvc_server_token_hash.json'). +stub_request(:get, 'https://config-cdn.devcycle.com/config/v2/server/dvc_server_token_hash.json'). to_return(headers: { 'Etag': 'test' }, body: File.new('../examples/local/local-bucketing-example/test_data/large_config.json'), status: 200) stub_request(:post, 'https://events.devcycle.com/v1/events/batch'). diff --git a/examples/local/config/application.rb b/examples/local/config/application.rb index 260b46c..c14b433 100644 --- a/examples/local/config/application.rb +++ b/examples/local/config/application.rb @@ -27,7 +27,7 @@ WebMock.disable_net_connect! config_path = File.expand_path('../test_data/large_config.json', __dir__) - stub_request(:get, "https://config-cdn.devcycle.com/config/v1/server/#{ENV['DEVCYCLE_SERVER_SDK_KEY']}.json"). + stub_request(:get, "https://config-cdn.devcycle.com/config/v2/server/#{ENV['DEVCYCLE_SERVER_SDK_KEY']}.json"). to_return(headers: { 'Etag': 'test' }, body: File.new(config_path).read, status: 200) stub_request(:post, 'https://events.devcycle.com/v1/events/batch'). diff --git a/lib/devcycle-ruby-server-sdk/localbucketing/bucketing-lib.release.wasm b/lib/devcycle-ruby-server-sdk/localbucketing/bucketing-lib.release.wasm index ccc710a..348b8bd 100644 Binary files a/lib/devcycle-ruby-server-sdk/localbucketing/bucketing-lib.release.wasm and b/lib/devcycle-ruby-server-sdk/localbucketing/bucketing-lib.release.wasm differ diff --git a/lib/devcycle-ruby-server-sdk/localbucketing/config_manager.rb b/lib/devcycle-ruby-server-sdk/localbucketing/config_manager.rb index bf30c3a..2b84acb 100644 --- a/lib/devcycle-ruby-server-sdk/localbucketing/config_manager.rb +++ b/lib/devcycle-ruby-server-sdk/localbucketing/config_manager.rb @@ -17,7 +17,7 @@ class ConfigManager ).void } def initialize(sdkKey, local_bucketing, wait_for_init) @first_load = true - @config_version = "v1" + @config_version = "v2" @local_bucketing = local_bucketing @sdkKey = sdkKey @sse_url = "" diff --git a/lib/devcycle-ruby-server-sdk/localbucketing/update_wasm.sh b/lib/devcycle-ruby-server-sdk/localbucketing/update_wasm.sh old mode 100644 new mode 100755 index 88c7efa..2bec7aa --- a/lib/devcycle-ruby-server-sdk/localbucketing/update_wasm.sh +++ b/lib/devcycle-ruby-server-sdk/localbucketing/update_wasm.sh @@ -1,5 +1,5 @@ #!/bin/bash -BUCKETING_LIB_VERSION="1.24.2" +BUCKETING_LIB_VERSION="1.25.3" WAT_DOWNLOAD=0 rm bucketing-lib.release.wasm wget "https://unpkg.com/@devcycle/bucketing-assembly-script@$BUCKETING_LIB_VERSION/build/bucketing-lib.release.wasm" \ No newline at end of file diff --git a/spec/api/devcycle_api_spec.rb b/spec/api/devcycle_api_spec.rb index 70c9240..3e22ba9 100644 --- a/spec/api/devcycle_api_spec.rb +++ b/spec/api/devcycle_api_spec.rb @@ -18,9 +18,14 @@ # Please update as you see appropriate describe 'DevCycle::Client' do before(:all) do + sdk_key = ENV["DEVCYCLE_SERVER_SDK_KEY"] + if sdk_key.nil? + puts("SDK KEY NOT SET - SKIPPING INIT") + return + end # run before each test options = DevCycle::Options.new(enable_cloud_bucketing: true) - @api_instance = DevCycle::Client.new("dvc_server_token_hash", options) + @api_instance = DevCycle::Client.new(sdk_key, options) @user = DevCycle::User.new({ user_id: 'test-user', @@ -57,12 +62,12 @@ # @param user # @param [Hash] opts the optional parameters # @return [Variable] - describe 'get_variable_by_key activate-flag' do + describe 'get_variable_by_key ruby-example-tests' do it 'should work' do - result = @api_instance.variable(@user, "activate-flag", false) + result = @api_instance.variable(@user, "ruby-example-tests-default", false) expect(result.isDefaulted).to eq true - result = @api_instance.variable_value(@user, "activate-flag", true) + result = @api_instance.variable_value(@user, "ruby-example-tests-default", true) expect(result).to eq true end end @@ -75,11 +80,11 @@ # @return [Variable] describe 'get_variable_by_key test' do it 'should work' do - result = @api_instance.variable(@user, "test", false) + result = @api_instance.variable(@user, "ruby-example-tests", false) expect(result.isDefaulted).to eq false expect(result.value).to eq true - result = @api_instance.variable_value(@user, "test", true) + result = @api_instance.variable_value(@user, "ruby-example-tests", true) expect(result).to eq true end end @@ -93,7 +98,7 @@ it 'should work' do result = @api_instance.all_variables(@user) - expect(result.length).to eq 5 + expect(result.length >= 1).to eq true end end