Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,28 @@ jobs:
- name: Lint and test
run: bin/rake

test_ofrep_provider:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./providers/openfeature-ofrep-provider
strategy:
matrix:
ruby-version:
- "3.3"
- "3.2"
- "3.1"
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
working-directory: ./providers/openfeature-ofrep-provider
- name: Lint and test
run: bin/rake

test_flipt_provider:
runs-on: ubuntu-latest
defaults:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
require "spec_helper"
require "open_feature/sdk"
require "tempfile"
require_relative "../../../../../shared_config/conformance/provider_shared_examples"

# https://openfeature.dev/docs/specification/sections/providers

Expand All @@ -15,6 +16,13 @@

subject(:flagd_client) { described_class.build_client }

describe "conformance" do
let(:provider) { described_class.build_client }

it_behaves_like "an OpenFeature provider"
it_behaves_like "an OpenFeature provider with integer and float support"
end

context "#configure" do
context "when defining host, port and tls options of gRPC service it wishes to access with configure method" do
subject(:explicit_configuration) do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ def mock_flag(feature_name:, enabled:, value:)
allow(::Flagsmith::Client).to receive(:new).and_return(mock_flagsmith_client)
end

it_behaves_like "an OpenFeature provider"
it_behaves_like "an OpenFeature provider with integer and float support"

describe "#initialize" do
it "should create provider with options" do
expect(provider.options).to eq(options)
Expand Down
2 changes: 1 addition & 1 deletion providers/openfeature-flipt-provider/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
openfeature-flipt-provider (0.0.2)
openfeature-flipt-provider (0.0.3)
ffi (~> 1.17)
flipt_client (~> 0.10.0)
openfeature-sdk (~> 0.4.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

module OpenFeature
module Flipt
VERSION = "0.0.2"
VERSION = "0.0.3"
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
allow(::Flipt::EvaluationClient).to receive(:new).with("test-namespace", {}).and_return(client_stub)
end

it_behaves_like "an OpenFeature provider"
it_behaves_like "an OpenFeature provider with integer and float support"

context "2.1 - Feature Provider Interface" do
describe "#metadata" do
it "returns a name field which identifies the provider implementation" do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@

it_behaves_like "an OpenFeature provider"

describe "conformance" do
let(:provider) { goff_provider }

it_behaves_like "an OpenFeature provider"
end

context "#metadata" do
it "metadata name is defined" do
expect(goff_provider).to respond_to(:metadata)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@
)
end

describe "conformance" do
let(:provider) { meta_provider }

it_behaves_like "an OpenFeature provider"
end

describe "#metadata" do
it "combines all metadata names" do
expect(meta_provider.metadata.name).to eq("MetaProvider: In-memory Provider, In-memory Provider")
Expand Down
10 changes: 10 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@
"README.md"
]
},
"providers/openfeature-ofrep-provider": {
"package-name": "openfeature-ofrep-provider",
"version-file": "lib/openfeature/ofrep/provider/version.rb",
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": true,
"versioning": "default",
"extra-files": [
"README.md"
]
},
"providers/openfeature-flagsmith-provider": {
"package-name": "openfeature-flagsmith-provider",
"version-file": "lib/openfeature/flagsmith/version.rb",
Expand Down