@@ -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//..."
@@ -35,13 +89,16 @@ timestamp() { date '+%Y-%m-%d %H:%M:%S'; }
3589
3690echo " === Integration Build Started $( timestamp) ===" | tee " ${SUMMARY_FILE} "
3791echo " Config: ${CONFIG} " | tee -a " ${SUMMARY_FILE} "
92+ if [[ -n " ${KNOWN_GOOD_FILE} " ]]; then
93+ echo " Known Good File: ${KNOWN_GOOD_FILE} " | tee -a " ${SUMMARY_FILE} "
94+ fi
3895echo " " >> " ${SUMMARY_FILE} "
3996echo " ## Build Groups Summary" >> " ${SUMMARY_FILE} "
4097echo " " >> " ${SUMMARY_FILE} "
4198# Markdown table header
4299{
43- echo " | Group | Status | Duration (s) | Warnings | Deprecated refs |" ;
44- echo " |-------|--------|--------------|----------|-----------------|" ;
100+ echo " | Group | Status | Duration (s) | Warnings | Deprecated refs | Commit/Version | " ;
101+ echo " |-------|--------|--------------|----------|-----------------|----------------| " ;
45102} >> " ${SUMMARY_FILE} "
46103
47104overall_warn_total=0
@@ -50,6 +107,7 @@ overall_depr_total=0
50107for group in " ${! BUILD_TARGET_GROUPS[@]} " ; do
51108 targets=" ${BUILD_TARGET_GROUPS[$group]} "
52109 log_file=" ${LOG_DIR} /${group} .log"
110+
53111 # Log build group banner only to stdout/stderr (not into summary table file)
54112 echo " --- Building group: ${group} ---"
55113 start_ts=$( date +%s)
@@ -73,16 +131,24 @@ for group in "${!BUILD_TARGET_GROUPS[@]}"; do
73131 else
74132 status_symbol=" ❌(${build_status} )"
75133 fi
76- echo " | ${group} | ${status_symbol} | ${duration} | ${w_count} | ${d_count} |" | tee -a " ${SUMMARY_FILE} "
134+
135+ # Get commit hash/version for this group (group name is the module name)
136+ commit_hash=$( get_commit_hash " ${group} " " ${KNOWN_GOOD_FILE} " )
137+ repo=$( get_module_repo " ${group} " " ${KNOWN_GOOD_FILE} " )
138+
139+ # Truncate commit hash for display (first 8 chars)
140+ if [[ " ${commit_hash} " != " N/A" ]] && [[ ${# commit_hash} -gt 8 ]]; then
141+ commit_hash_display=" ${commit_hash: 0: 8} "
142+ else
143+ commit_hash_display=" ${commit_hash} "
144+ fi
145+
146+ echo " | ${group} | ${status_symbol} | ${duration} | ${w_count} | ${d_count} | [${commit_hash_display} ](${repo} /tree/${commit_hash} ) |" | tee -a " ${SUMMARY_FILE} "
77147done
78148
79149# Append aggregate totals row to summary table
80- echo " | TOTAL | | | ${overall_warn_total} | ${overall_depr_total} |" >> " ${SUMMARY_FILE} "
81-
82- # Display the full build summary explicitly at the end
150+ echo " | TOTAL | | | ${overall_warn_total} | ${overall_depr_total} | |" >> " ${SUMMARY_FILE} " # Display the full build summary explicitly at the end
83151echo ' ::group::Build Summary'
84152echo ' === Build Summary (echo) ==='
85153cat " ${SUMMARY_FILE} " || echo " (Could not read summary file ${SUMMARY_FILE} )"
86- echo ' ::endgroup::'
87-
88- exit 0
154+ echo ' ::endgroup::'
0 commit comments