@@ -3,16 +3,70 @@ set -euo pipefail
33
44# Integration build script.
55# Captures warning counts for regression tracking.
6+ #
7+ # Usage: ./integration_test.sh [--known-good <path>]
8+ # --known-good: Optional path to known_good.json file
69
710CONFIG=${CONFIG:- bl-x86_64-linux}
811LOG_DIR=${LOG_DIR:- _logs/ logs}
912SUMMARY_FILE=${SUMMARY_FILE:- _logs/ build_summary.md}
13+ KNOWN_GOOD_FILE=" "
14+
15+ # Parse command line arguments
16+ while [[ $# -gt 0 ]]; do
17+ case $1 in
18+ --known-good)
19+ KNOWN_GOOD_FILE=" $2 "
20+ shift 2
21+ ;;
22+ * )
23+ echo " Unknown option: $1 "
24+ echo " Usage: $0 [--known-good <path>]"
25+ exit 1
26+ ;;
27+ esac
28+ done
29+
1030mkdir -p " ${LOG_DIR} " || true
1131
32+ # Function to extract commit hash from known_good.json
33+ get_commit_hash () {
34+ local module_name=$1
35+ local known_good_file=$2
36+
37+ if [[ -z " ${known_good_file} " ]] || [[ ! -f " ${known_good_file} " ]]; then
38+ echo " N/A"
39+ return
40+ fi
41+
42+ # Get the script directory
43+ local script_dir=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) "
44+
45+ # Use the Python script to extract module info
46+ python3 " ${script_dir} /tools/get_module_info.py" " ${known_good_file} " " ${module_name} " " hash" 2> /dev/null || echo " N/A"
47+ }
48+
49+ # Function to extract repo URL from known_good.json
50+ get_module_repo () {
51+ local module_name=$1
52+ local known_good_file=$2
53+
54+ if [[ -z " ${known_good_file} " ]] || [[ ! -f " ${known_good_file} " ]]; then
55+ echo " N/A"
56+ return
57+ fi
58+
59+ # Get the script directory
60+ local script_dir=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) "
61+
62+ # Use the Python script to extract module repo
63+ python3 " ${script_dir} /tools/get_module_info.py" " ${known_good_file} " " ${module_name} " " repo" 2> /dev/null || echo " N/A"
64+ }
65+
1266declare -A BUILD_TARGET_GROUPS=(
13- [baselibs ]=" @score_baselibs//score/..."
67+ [score_baselibs ]=" @score_baselibs//score/..."
1468 [communication]=" @communication//score/mw/com:com"
15- [persistency ]=" @score_persistency//src/cpp/src/... @score_persistency//src/rust/..."
69+ [score_persistency ]=" @score_persistency//src/cpp/src/... @score_persistency//src/rust/..."
1670 # [score_logging]="@score_logging//src/..."
1771 [score_orchestrator]=" @score_orchestrator//src/..."
1872 [score_test_scenarios]=" @score_test_scenarios//..."
@@ -34,13 +88,16 @@ timestamp() { date '+%Y-%m-%d %H:%M:%S'; }
3488
3589echo " === Integration Build Started $( timestamp) ===" | tee " ${SUMMARY_FILE} "
3690echo " Config: ${CONFIG} " | tee -a " ${SUMMARY_FILE} "
91+ if [[ -n " ${KNOWN_GOOD_FILE} " ]]; then
92+ echo " Known Good File: ${KNOWN_GOOD_FILE} " | tee -a " ${SUMMARY_FILE} "
93+ fi
3794echo " " >> " ${SUMMARY_FILE} "
3895echo " ## Build Groups Summary" >> " ${SUMMARY_FILE} "
3996echo " " >> " ${SUMMARY_FILE} "
4097# Markdown table header
4198{
42- echo " | Group | Status | Duration (s) | Warnings | Deprecated refs |" ;
43- echo " |-------|--------|--------------|----------|-----------------|" ;
99+ echo " | Group | Status | Duration (s) | Warnings | Deprecated refs | Commit/Version | " ;
100+ echo " |-------|--------|--------------|----------|-----------------|----------------| " ;
44101} >> " ${SUMMARY_FILE} "
45102
46103overall_warn_total=0
@@ -49,6 +106,7 @@ overall_depr_total=0
49106for group in " ${! BUILD_TARGET_GROUPS[@]} " ; do
50107 targets=" ${BUILD_TARGET_GROUPS[$group]} "
51108 log_file=" ${LOG_DIR} /${group} .log"
109+
52110 # Log build group banner only to stdout/stderr (not into summary table file)
53111 echo " --- Building group: ${group} ---"
54112 start_ts=$( date +%s)
@@ -72,16 +130,24 @@ for group in "${!BUILD_TARGET_GROUPS[@]}"; do
72130 else
73131 status_symbol=" ❌(${build_status} )"
74132 fi
75- echo " | ${group} | ${status_symbol} | ${duration} | ${w_count} | ${d_count} |" | tee -a " ${SUMMARY_FILE} "
133+
134+ # Get commit hash/version for this group (group name is the module name)
135+ commit_hash=$( get_commit_hash " ${group} " " ${KNOWN_GOOD_FILE} " )
136+ repo=$( get_module_repo " ${group} " " ${KNOWN_GOOD_FILE} " )
137+
138+ # Truncate commit hash for display (first 8 chars)
139+ if [[ " ${commit_hash} " != " N/A" ]] && [[ ${# commit_hash} -gt 8 ]]; then
140+ commit_hash_display=" ${commit_hash: 0: 8} "
141+ else
142+ commit_hash_display=" ${commit_hash} "
143+ fi
144+
145+ echo " | ${group} | ${status_symbol} | ${duration} | ${w_count} | ${d_count} | [${commit_hash_display} ](${repo} /tree/${commit_hash} ) |" | tee -a " ${SUMMARY_FILE} "
76146done
77147
78148# Append aggregate totals row to summary table
79- echo " | TOTAL | | | ${overall_warn_total} | ${overall_depr_total} |" >> " ${SUMMARY_FILE} "
80-
81- # Display the full build summary explicitly at the end
149+ echo " | TOTAL | | | ${overall_warn_total} | ${overall_depr_total} | |" >> " ${SUMMARY_FILE} " # Display the full build summary explicitly at the end
82150echo ' ::group::Build Summary'
83151echo ' === Build Summary (echo) ==='
84152cat " ${SUMMARY_FILE} " || echo " (Could not read summary file ${SUMMARY_FILE} )"
85- echo ' ::endgroup::'
86-
87- exit 0
153+ echo ' ::endgroup::'
0 commit comments