<commit_before>#!/usr/bin/env ruby
# This is DTK Server smoke test
require 'rubygems'
require 'rest_client'
require 'pp'
require 'json'
require 'awesome_print'
require './lib/dtk_common'
require './lib/assembly_and_service_operations_spec'
require './lib/parameters_setting_spec'
require './lib/component_modules_spec'

service_name = 'smoke_test_instance'
assembly_name = 'bootstrap::node_with_params'
os_templates = ['trusty','amazon']
os_attribute = 'os_identifier'
instance_size = 't1.micro'
instance_size_attribute = 'instance_size'
node_name = 'node1'
component_module_name = "test_module"
component_module_namespace = "dtk17"
local_component_module_name = 'dtk17:test_module'
component_module_filesystem_location = "~/dtk/component_modules/dtk17"

dtk_common = Common.new(service_name, assembly_name)

describe "DTK Server smoke test" do

  before(:all) do
    puts "*********************",""
  end

  context "Import component module function" do
    include_context "Import remote component module", component_module_namespace + "/" + component_module_name
  end

  context "Get component module components list" do
    include_context "Get component module components list", dtk_common, local_component_module_name
  end

  context "Check if component module imported on local filesystem" do
    include_context "Check component module imported on local filesystem", component_module_filesystem_location, component_module_name
  end

  os_templates.each do |os|
    context "Stage service function on #{assembly_name} assembly" do
      include_context "Stage", dtk_common
    end

    context "List services after stage" do    
      include_context "List services after stage", dtk_common
    end

    context "Add components from test module to service node" do<commit_msg>small fix<commit_after>#!/usr/bin/env ruby
# This is DTK Server smoke test
require 'rubygems'
require 'rest_client'
require 'pp'
require 'json'
require 'awesome_print'
require './lib/dtk_common'
require './lib/assembly_and_service_operations_spec'
require './lib/parameters_setting_spec'
require './lib/component_modules_spec'

service_name = 'smoke_test_instance'
assembly_name = 'bootstrap::node_with_params'
os_templates = ['trusty','amazon']
node_name = 'node1'
component_module_name = "test_module"
component_module_namespace = "dtk17"
local_component_module_name = 'dtk17:test_module'
component_module_filesystem_location = "~/dtk/component_modules/dtk17"

dtk_common = Common.new(service_name, assembly_name)

describe "DTK Server smoke test" do

  before(:all) do
    puts "*********************",""
  end

  context "Import component module function" do
    include_context "Import remote component module", component_module_namespace + "/" + component_module_name
  end

  context "Get component module components list" do
    include_context "Get component module components list", dtk_common, local_component_module_name
  end

  context "Check if component module imported on local filesystem" do
    include_context "Check component module imported on local filesystem", component_module_filesystem_location, component_module_name
  end

  os_templates.each do |os|
    context "Stage service function on #{assembly_name} assembly" do
      include_context "Stage", dtk_common
    end

    context "List services after stage" do    
      include_context "List services after stage", dtk_common
    end

    context "Set image attribute" do
      include_context "Set attribute", dtk_common, 'node1/image', os
    end

    context "Add components from test module to service node" do
{'fraction_non_alphanumeric': 0.08986882500697739, 'fraction_numerical': 0.004465531677365337, 'mean_word_length': 5.446043165467626, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2139670', 'n_tokens_mistral': 1048, 'n_tokens_neox': 1011, 'n_words': 306}