From 32d857423353bd6e9b241c02564ec80f1218db09 Mon Sep 17 00:00:00 2001
From: Lucas Nussbaum <lucas.nussbaum@inria.fr>
Date: Wed, 22 Jan 2025 10:47:14 +0100
Subject: [PATCH 1/3] valid:homogeneity: clean up output

---
 lib/refrepo/valid/homogeneity.rb | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/lib/refrepo/valid/homogeneity.rb b/lib/refrepo/valid/homogeneity.rb
index dff390dbd51..bf2910ce9ce 100644
--- a/lib/refrepo/valid/homogeneity.rb
+++ b/lib/refrepo/valid/homogeneity.rb
@@ -241,14 +241,25 @@ def check_cluster_homogeneity(options = {:verbose => false})
   options[:api][:pwd] = conf['password']
 
   verbose = options[:verbose]
-  puts "Differences found between successive nodes, per cluster:\n\n"
-
   total_count, count = cluster_homogeneity(refapi_hash, options)
   puts "\n" if verbose
 
-  puts count.to_yaml unless verbose
-
-  puts "\nUse 'VERBOSE=1' option for details." unless verbose
+  unless verbose
+    count.each_pair do |site, v|
+      next if v.values.select { |c| c != 0 }.empty?
+      puts "#{site} ..."
+      v.each_pair do |cluster, c|
+        next if c == 0
+        puts "  #{cluster}: #{c}"
+      end
+    end
+  end
 
-  return total_count == 0
+  if total_count == 0
+    puts "OK"
+    return true
+  else
+    puts "Use 'VERBOSE=1' option for details." unless verbose
+    return false
+  end
 end
-- 
GitLab


From d8e768015beda638d25989d5bab9d55da2b57cd5 Mon Sep 17 00:00:00 2001
From: Lucas Nussbaum <lucas.nussbaum@inria.fr>
Date: Wed, 22 Jan 2025 10:47:28 +0100
Subject: [PATCH 2/3] valid:schema: clean up output

---
 lib/refrepo/valid/input/schema.rb | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/refrepo/valid/input/schema.rb b/lib/refrepo/valid/input/schema.rb
index 7d2d916306b..ed1cd8fc180 100644
--- a/lib/refrepo/valid/input/schema.rb
+++ b/lib/refrepo/valid/input/schema.rb
@@ -45,5 +45,10 @@ def yaml_input_schema_validator(options)
       end
     end
   end
+  if r
+    puts "OK"
+  else
+    puts "FAILED"
+  end
   return r
 end
-- 
GitLab


From ee845cd6f9770da3360c7b7af5a1f4daf4e94236 Mon Sep 17 00:00:00 2001
From: Lucas Nussbaum <lucas.nussbaum@inria.fr>
Date: Wed, 22 Jan 2025 10:47:38 +0100
Subject: [PATCH 3/3] Rakefile: add 'rake valid:base'

---
 Rakefile | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/Rakefile b/Rakefile
index 974567ef287..e9afa9e6127 100644
--- a/Rakefile
+++ b/Rakefile
@@ -35,6 +35,25 @@ end
 
 namespace :valid do
 
+  desc "Run all base checks (homogeneity, duplicates, schema)  -- parameters: [SITE={grenoble,..}] [CLUSTER={yeti,..}] [VERBOSE=1]"
+  task "base" do
+    require 'refrepo/valid/homogeneity'
+    require 'refrepo/valid/input/duplicates'
+    require 'refrepo/valid/input/schema'
+    options = {}
+    options[:sites] = ( ENV['SITE'] ? ENV['SITE'].split(',') : G5K_SITES )
+    options[:clusters] = ( ENV['CLUSTER'] ? ENV['CLUSTER'].split(',') : [] )
+    options[:verbose] = ENV['VERBOSE'].to_i if ENV['VERBOSE']
+
+    puts "# Checking homogeneity ..."
+    ret1 = check_cluster_homogeneity(options)
+    puts "# Checking duplicates ..."
+    ret2 = yaml_input_find_duplicates(options)
+    puts "# Checking schema ..."
+    ret3 = yaml_input_schema_validator(options)
+    exit(ret1 && ret2 && ret3)
+  end
+
   desc "Check homogeneity of clusters -- parameters: [SITE={grenoble,..}] [CLUSTER={yeti,..}] [VERBOSE=1]"
   task "homogeneity" do
     require 'refrepo/valid/homogeneity'
-- 
GitLab