Skip to content

Commit 0e067ef

Browse files
committed
Fix runtime compatibility check service
1 parent b5d0adb commit 0e067ef

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

app/models/function_definition.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ class FunctionDefinition < ApplicationRecord
2222
validates :identifier, presence: true, uniqueness: { case_sensitive: false, scope: :runtime_id }
2323
validates :design, length: { maximum: 200 }
2424

25+
delegate :parsed_version, to: :runtime_function_definition
26+
2527
def to_grpc
2628
Tucana::Shared::FunctionDefinition.new(
2729
runtime_name: identifier,

spec/services/runtimes/check_runtime_compatibility_service_spec.rb

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,20 +80,34 @@
8080
runtime_flow_type: runtime_flow_type,
8181
identifier: 'ft1',
8282
version: '2.2.0')
83-
create(
83+
primary_rfd = create(
8484
:runtime_function_definition,
8585
runtime_name: 'rfd1',
8686
runtime: primary_runtime,
8787
runtime_module: primary_module,
8888
version: '3.0.0'
8989
)
90-
create(
90+
secondary_rfd = create(
9191
:runtime_function_definition,
9292
runtime_name: 'rfd1',
9393
runtime: runtime,
9494
runtime_module: secondary_module,
9595
version: '3.1.0'
9696
)
97+
create(
98+
:function_definition,
99+
runtime_function_definition: primary_rfd,
100+
identifier: 'fd1',
101+
runtime: primary_runtime,
102+
runtime_module: primary_module
103+
)
104+
create(
105+
:function_definition,
106+
runtime_function_definition: secondary_rfd,
107+
identifier: 'fd1',
108+
runtime: runtime,
109+
runtime_module: secondary_module
110+
)
97111
end
98112

99113
it 'returns success with the runtime as payload' do

0 commit comments

Comments
 (0)