Skip to content

Commit 7b0cbf8

Browse files
Merge pull request #376 from cncf/feature/#327_platform_totals
#327 platform totals
2 parents 5b14e5f + 3f0afd5 commit 7b0cbf8

File tree

8 files changed

+20
-20
lines changed

8 files changed

+20
-20
lines changed

config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ toggles:
1414
# I.E. your cluster and host (your dev box if you are using
1515
# kind) will be changed, rebooted, chaos tested, etc
1616
- name: destructive
17-
toggle_on: false
17+
toggle_on: false
1818
loglevel: info
1919

points-all.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,6 @@
101101
- name: node_failure
102102
tags: platform, dynamic
103103
- name: recover_from_node_failure
104-
tags: platform, dynamic
104+
tags: platform, platform:resilience, dynamic
105105
- name: oci_compliant
106-
tags: platform, dynamic
106+
tags: platform, platform:hardware_and_scheduling, dynamic

points.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,9 @@
107107
#- name: performance
108108
# tags: hardware, dynamic
109109

110-
# - name: k8s_conformance
111-
# tags: platform, dynamic
112-
# - name: node_failure
113-
# tags: platform, dynamic
114-
# - name: recover_from_node_failure
115-
# tags: platform, dynamic
116-
- name: oci_compliant
110+
- name: k8s_conformance
117111
tags: platform, dynamic
112+
- name: recover_from_node_failure
113+
tags: platform, platform:resilience, dynamic
114+
- name: oci_compliant
115+
tags: platform, platform:hardware_and_scheduling, dynamic

spec/utils/utils_spec.cr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ describe "Utils" do
112112

113113
it "'all_task_test_names' should return all tasks names" do
114114
clean_results_yml
115-
(all_task_test_names()).should eq(["reasonable_image_size", "reasonable_startup_time", "privileged", "increase_capacity", "decrease_capacity", "network_chaos", "ip_addresses", "liveness", "readiness", "rolling_update", "nodeport_not_used", "hardcoded_ip_addresses_in_k8s_runtime_configuration", "helm_deploy", "install_script_helm", "helm_chart_valid", "helm_chart_published", "chaos_network_loss", "chaos_cpu_hog", "chaos_container_kill", "volume_hostpath_not_found", "oci_compliant"])
115+
(all_task_test_names()).should eq(["reasonable_image_size", "reasonable_startup_time", "privileged", "increase_capacity", "decrease_capacity", "network_chaos", "ip_addresses", "liveness", "readiness", "rolling_update", "nodeport_not_used", "hardcoded_ip_addresses_in_k8s_runtime_configuration", "helm_deploy", "install_script_helm", "helm_chart_valid", "helm_chart_published", "chaos_network_loss", "chaos_cpu_hog", "chaos_container_kill", "volume_hostpath_not_found"])
116116
end
117117

118118
it "'all_result_test_names' should return the tasks assigned to a tag" do

src/tasks/platform/hardware_and_scheduling.cr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace "platform" do
99
VERBOSE_LOGGING.info "hardware_and_scheduling" if check_verbose(args)
1010
VERBOSE_LOGGING.debug "hardware_and_scheduling args.raw: #{args.raw}" if check_verbose(args)
1111
VERBOSE_LOGGING.debug "hardware_and_scheduling args.named: #{args.named}" if check_verbose(args)
12-
stdout_score("resilience")
12+
stdout_score("platform:hardware_and_scheduling")
1313
end
1414

1515
desc "Does the Platform use a runtime that is oci compliant"

src/tasks/platform/platform.cr

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
desc "Platform Tests"
2-
task "platform", ["k8s_conformance"] do |_, args|
2+
task "platform", ["k8s_conformance", "platform:resilience", "platform:hardware_and_scheduling"] do |_, args|
33
VERBOSE_LOGGING.info "platform" if check_verbose(args)
4+
stdout_score("platform")
45
end
56

67
desc "Does the platform pass the K8s conformance tests?"
@@ -21,11 +22,11 @@ task "k8s_conformance" do |_, args|
2122
#TODO when in test mode --mode quick, prod mode no quick
2223
testrun = ""
2324
VERBOSE_LOGGING.info ENV["CRYSTAL_ENV"]? if check_verbose(args)
24-
if ENV["CRYSTAL_ENV"]? == "TEST"
25+
# if ENV["CRYSTAL_ENV"]? == "TEST"
2526
testrun = `#{sonobuoy} run --wait --mode quick`
26-
else
27-
testrun = `#{sonobuoy} run --wait`
28-
end
27+
# else
28+
# testrun = `#{sonobuoy} run --wait`
29+
# end
2930
VERBOSE_LOGGING.info testrun if check_verbose(args)
3031

3132
results = `results=$(#{sonobuoy} retrieve); #{sonobuoy} results $results`

src/tasks/platform/resilience.cr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace "platform" do
99
VERBOSE_LOGGING.info "resilience" if check_verbose(args)
1010
VERBOSE_LOGGING.debug "resilience args.raw: #{args.raw}" if check_verbose(args)
1111
VERBOSE_LOGGING.debug "resilience args.named: #{args.named}" if check_verbose(args)
12-
stdout_score("resilience")
12+
stdout_score("platform:resilience")
1313
end
1414

1515
desc "Does the Platform recover the node and reschedule pods when a worker node fails"

src/tasks/utils/utils.cr

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,8 @@ end
521521

522522
def all_task_test_names
523523
result_items = points_yml.reduce([] of String) do |acc, x|
524-
if x["name"].as_s == "default_scoring"
524+
if x["name"].as_s == "default_scoring" ||
525+
x["tags"].as_s.split(",").find{|x|x=="platform"}
525526
acc
526527
else
527528
acc << x["name"].as_s
@@ -585,7 +586,7 @@ end
585586

586587
def stdout_score(test_name)
587588
total = total_points(test_name)
588-
pretty_test_name = test_name.split("_").map(&.capitalize).join(" ")
589+
pretty_test_name = test_name.split(/:|_/).map(&.capitalize).join(" ")
589590
test_log_msg = "#{pretty_test_name} final score: #{total} of #{total_max_points(test_name)}"
590591

591592
if total > 0

0 commit comments

Comments
 (0)