From b9b6e5faef329942093594d85f6bb5c500076b79 Mon Sep 17 00:00:00 2001 From: Daniel Clavijo Coca Date: Wed, 13 Dec 2023 13:46:54 -0600 Subject: [PATCH] Improved tests --- .gitignore | 1 + tests/lib/common.rb | 14 ++++++++++++++ tests/lib/crud.rb | 1 + tests/templates/sr_faas_capacity.json | 4 ++-- 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index dbb4358..20c8f45 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .vs* +.DS_Store Gemfile.lock vendor/ diff --git a/tests/lib/common.rb b/tests/lib/common.rb index 049cfd9..2f152e4 100644 --- a/tests/lib/common.rb +++ b/tests/lib/common.rb @@ -192,3 +192,17 @@ def increase_runtime_hardware(specification, mode = 'multiply') end end end + +def strip_consequential_info(specification) + ['ID', 'SERVICE_ID'].each do |ri| + specification[SRR].delete(ri) + end + + ProvisionEngine::Function::FUNCTIONS.each do |function| + next unless specification[SRR][function] + + ['VM_ID', 'STATE'].each do |fi| + specification[SRR][function].delete(fi) + end + end +end diff --git a/tests/lib/crud.rb b/tests/lib/crud.rb index 2f40632..af6d4dc 100644 --- a/tests/lib/crud.rb +++ b/tests/lib/crud.rb @@ -23,6 +23,7 @@ runtime = JSON.parse(response.body) verify_sr_spec(@conf[:specification], runtime) + strip_consequential_info(runtime) @conf[:runtime] = runtime end diff --git a/tests/templates/sr_faas_capacity.json b/tests/templates/sr_faas_capacity.json index c3bb9be..80413a3 100644 --- a/tests/templates/sr_faas_capacity.json +++ b/tests/templates/sr_faas_capacity.json @@ -2,9 +2,9 @@ "SERVERLESS_RUNTIME": { "NAME": "Function as a Service", "FAAS": { - "MEMORY": 111, + "MEMORY": 177, "CPU": 3, - "DISK_SIZE": 420, + "DISK_SIZE": 1338, "FLAVOUR": "Function" }, "SCHEDULING": {