From 054c3bd448f74f8c94f552ecb4e94e34be9cbed3 Mon Sep 17 00:00:00 2001 From: denverwilliams Date: Wed, 6 May 2020 19:59:14 -0400 Subject: [PATCH] Rename image_size task to reasonable_image_size cncf/cnf-conformance#155 --- points.yml | 2 +- spec/cnf_conformance_spec.cr | 2 +- spec/microservice_spec.cr | 8 ++++---- spec/utils/utils_spec.cr | 2 +- src/tasks/microservice.cr | 11 ++++++----- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/points.yml b/points.yml index 0faec514f..896165da4 100644 --- a/points.yml +++ b/points.yml @@ -4,7 +4,7 @@ pass: 5 fail: -1 -- name: image_size_large +- name: reasonable_image_size tags: microservice, dynamic - name: reasonable_startup_time tags: microservice, dynamic diff --git a/spec/cnf_conformance_spec.cr b/spec/cnf_conformance_spec.cr index e2c204fa5..5ef58de6c 100644 --- a/spec/cnf_conformance_spec.cr +++ b/spec/cnf_conformance_spec.cr @@ -38,7 +38,7 @@ describe CnfConformance do (/PASSED: Replicas decreased to 1/ =~ response_s).should_not be_nil (/PASSED: Published Helm Chart Repo added/ =~ response_s).should_not be_nil (/Final score:/ =~ response_s).should_not be_nil - (all_result_test_names(final_cnf_results_yml)).should eq(["privileged", "increase_capacity", "decrease_capacity", "ip_addresses", "liveness", "readiness", "install_script_helm", "helm_chart_valid", "helm_chart_published", "image_size_large", "reasonable_startup_time"]) + (all_result_test_names(final_cnf_results_yml)).should eq(["privileged", "increase_capacity", "decrease_capacity", "ip_addresses", "liveness", "readiness", "install_script_helm", "helm_chart_valid", "helm_chart_published", "reasonable_image_size", "reasonable_startup_time"]) end it "'scalability' should run all of the scalability tests" do diff --git a/spec/microservice_spec.cr b/spec/microservice_spec.cr index 4af5035f6..87d8acf50 100644 --- a/spec/microservice_spec.cr +++ b/spec/microservice_spec.cr @@ -34,10 +34,10 @@ describe "Microservice" do `crystal src/cnf-conformance.cr cnf_cleanup cnf-path=sample-cnfs/sample_envoy_slow_startup` end - it "'image_size_large' should pass if image is smaller than 5gb", tags: "image_size_large" do + it "'reasonable_image_size' should pass if image is smaller than 5gb", tags: "reasonable_image_size" do begin `crystal src/cnf-conformance.cr sample_coredns_setup` - response_s = `crystal src/cnf-conformance.cr image_size_large verbose` + response_s = `crystal src/cnf-conformance.cr reasonable_image_size verbose` puts response_s $?.success?.should be_true (/Image size is good/ =~ response_s).should_not be_nil @@ -46,11 +46,11 @@ describe "Microservice" do end end - it "'image_size_large' should fail if image is larger than 5gb", tags: "image_size_large" do + it "'reasonable_image_size' should fail if image is larger than 5gb", tags: "reasonable_image_size" do begin `crystal src/cnf-conformance.cr cnf_cleanup cnf-path=sample-cnfs/sample-large-cnf` `crystal src/cnf-conformance.cr cnf_setup cnf-path=sample-cnfs/sample-large-cnf deploy_with_chart=false` - response_s = `crystal src/cnf-conformance.cr image_size_large verbose` + response_s = `crystal src/cnf-conformance.cr reasonable_image_size verbose` puts response_s $?.success?.should be_true (/Image size too large/ =~ response_s).should_not be_nil diff --git a/spec/utils/utils_spec.cr b/spec/utils/utils_spec.cr index 47b48d41c..e2b6c4e41 100644 --- a/spec/utils/utils_spec.cr +++ b/spec/utils/utils_spec.cr @@ -105,7 +105,7 @@ describe "Utils" do it "'all_task_test_names' should return all tasks names"do create_results_yml - (all_task_test_names()).should eq(["image_size_large", "reasonable_startup_time","cni_spec", "api_snoop_alpha", "api_snoop_beta", "api_snoop_general_apis", "reset_cnf", "check_reaped", "privileged", "shells", "protected_access", "increase_capacity", "decrease_capacity", "small_autoscaling", "large_autoscaling", "network_chaos", "external_retry", "versioned_helm_chart", "ip_addresses", "liveness", "readiness", "no_volume_with_configuration", "rolling_update", "fluentd_traffic", "jaeger_traffic", "prometheus_traffic", "opentelemetry_compatible", "openmetric_compatible", "helm_deploy", "install_script_helm", "helm_chart_valid", "helm_chart_published", "hardware_affinity", "static_accessing_hardware", "dynamic_accessing_hardware", "direct_hugepages", "performance", "k8s_conformance"]) + (all_task_test_names()).should eq(["reasonable_image_size", "reasonable_startup_time","cni_spec", "api_snoop_alpha", "api_snoop_beta", "api_snoop_general_apis", "reset_cnf", "check_reaped", "privileged", "shells", "protected_access", "increase_capacity", "decrease_capacity", "small_autoscaling", "large_autoscaling", "network_chaos", "external_retry", "versioned_helm_chart", "ip_addresses", "liveness", "readiness", "no_volume_with_configuration", "rolling_update", "fluentd_traffic", "jaeger_traffic", "prometheus_traffic", "opentelemetry_compatible", "openmetric_compatible", "helm_deploy", "install_script_helm", "helm_chart_valid", "helm_chart_published", "hardware_affinity", "static_accessing_hardware", "dynamic_accessing_hardware", "direct_hugepages", "performance", "k8s_conformance"]) end it "'all_result_test_names' should return the tasks assigned to a tag"do diff --git a/src/tasks/microservice.cr b/src/tasks/microservice.cr index da74b18d4..616e2fd11 100644 --- a/src/tasks/microservice.cr +++ b/src/tasks/microservice.cr @@ -1,3 +1,4 @@ +# coding: utf-8 require "sam" require "file_utils" require "colorize" @@ -7,7 +8,7 @@ require "halite" require "totem" desc "The CNF conformance suite checks to see if CNFs follows microservice principles" -task "microservice", ["image_size_large", "reasonable_startup_time"] do |_, args| +task "microservice", ["reasonable_image_size", "reasonable_startup_time"] do |_, args| end desc "Does the CNF have a reasonable startup time?" @@ -62,8 +63,8 @@ task "reasonable_startup_time" do |_, args| end end -desc "Is the image size large?" -task "image_size_large", ["retrieve_manifest"] do |_, args| +desc "Does the CNF have a reasonable container image size?" +task "reasonable_image_size", ["retrieve_manifest"] do |_, args| begin config = cnf_conformance_yml helm_directory = config.get("helm_directory").as_s @@ -102,10 +103,10 @@ task "image_size_large", ["retrieve_manifest"] do |_, args| docker_resp && docker_resp.status_code == 200 && micro_size.to_s.to_i64 < 50000000 - upsert_passed_task("image_size_large") + upsert_passed_task("reasonable_image_size") puts "PASSED: Image size is good".colorize(:green) else - upsert_failed_task("image_size_large") + upsert_failed_task("reasonable_image_size") puts "FAILURE: Image size too large".colorize(:red) end rescue ex