Skip to content

Commit cd72a22

Browse files
feat: update case4 execution method
1 parent a9c1c0a commit cd72a22

2 files changed

Lines changed: 145 additions & 79 deletions

File tree

releng/update-site-tests/run-all-cases.sh

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -76,56 +76,56 @@ else
7676
echo "⚠️ Skipping Case 3 (no milestone/RC detected)."
7777
fi
7878

79-
# echo "=== Preparing Espressif-IDE (latest stable) for Case 4 ==="
80-
# : "${ESP_IDE_VERSION:?ESP_IDE_VERSION not set by detection script}"
81-
# : "${ESPRESSIF_IDE_URL:?ESPRESSIF_IDE_URL not set by detection script}"
82-
83-
# ESP_IDE_WORK="$WORKROOT/espressif-ide-${ESP_IDE_VERSION}"
84-
# rm -rf "$ESP_IDE_WORK"
85-
# mkdir -p "$ESP_IDE_WORK"
86-
87-
# echo "Downloading Espressif-IDE from: $ESPRESSIF_IDE_URL"
88-
# curl -fsSL "$ESPRESSIF_IDE_URL" -o "$ESP_IDE_WORK/espressif-ide.tar.gz"
89-
90-
# echo "Extracting Espressif-IDE..."
91-
# tar -xzf "$ESP_IDE_WORK/espressif-ide.tar.gz" -C "$ESP_IDE_WORK"
92-
93-
# # Figure out where the eclipse executable is after extraction
94-
# # Usually archive contains a top-level "eclipse/" directory
95-
# if [[ -x "$ESP_IDE_WORK/Espressif-IDE/espressif-ide" ]]; then
96-
# export ESPRESSIF_IDE_SOURCE="$ESP_IDE_WORK/Espressif-IDE"
97-
# else
98-
# # fallback: search for an eclipse executable
99-
# FOUND_IDE="$(find "$ESP_IDE_WORK" -maxdepth 4 -type f -name espressif-ide -perm -111 | head -n1 || true)"
100-
# if [[ -z "$FOUND_IDE" ]]; then
101-
# echo "❌ Could not locate 'espressif-ide' launcher inside extracted Espressif-IDE."
102-
# echo "Top-level contents:"
103-
# ls -la "$ESP_IDE_WORK"
104-
# exit 1
105-
# fi
106-
# export ESPRESSIF_IDE_SOURCE="$(dirname "$FOUND_IDE")"
107-
# fi
108-
109-
# echo "ESPRESSIF_IDE_SOURCE resolved to: $ESPRESSIF_IDE_SOURCE"
110-
# test -x "$ESPRESSIF_IDE_SOURCE/espressif-ide" || { echo "❌ Invalid ESPRESSIF_IDE_SOURCE: $ESPRESSIF_IDE_SOURCE"; exit 1; }
111-
112-
# echo "=== Case 4: Espressif-IDE stable -> dev update ==="
113-
# : "${ESPRESSIF_IDE_SOURCE:?Provide ESPRESSIF_IDE_SOURCE for Case 4 (path to extracted IDE root)}"
114-
115-
# if CASE_ID="case4-espressif-ide-bundled-to-nightly" \
116-
# BASE_PRODUCT="espressif-ide" \
117-
# DO_DEV_UPDATE=1 \
118-
# SKIP_STABLE_INSTALL=1 \
119-
# ESPRESSIF_IDE_SOURCE="$ESPRESSIF_IDE_SOURCE" \
120-
# WORKROOT="$WORKROOT" OUTROOT="$OUTROOT" \
121-
# bash "$ROOT_DIR/run-single-case.sh"; then
122-
123-
# echo "✅ Test Case 4 completed successfully"
124-
125-
# else
126-
# echo "❌ Test Case 4 FAILED"
127-
# FAIL=1
128-
# fi
79+
echo "=== Preparing Espressif-IDE (latest stable) for Case 4 ==="
80+
: "${ESP_IDE_VERSION:?ESP_IDE_VERSION not set by detection script}"
81+
: "${ESPRESSIF_IDE_URL:?ESPRESSIF_IDE_URL not set by detection script}"
82+
83+
ESP_IDE_WORK="$WORKROOT/espressif-ide-${ESP_IDE_VERSION}"
84+
rm -rf "$ESP_IDE_WORK"
85+
mkdir -p "$ESP_IDE_WORK"
86+
87+
echo "Downloading Espressif-IDE from: $ESPRESSIF_IDE_URL"
88+
curl -fsSL "$ESPRESSIF_IDE_URL" -o "$ESP_IDE_WORK/espressif-ide.tar.gz"
89+
90+
echo "Extracting Espressif-IDE..."
91+
tar -xzf "$ESP_IDE_WORK/espressif-ide.tar.gz" -C "$ESP_IDE_WORK"
92+
93+
# Figure out where the eclipse executable is after extraction
94+
# Usually archive contains a top-level "eclipse/" directory
95+
if [[ -x "$ESP_IDE_WORK/Espressif-IDE/espressif-ide" ]]; then
96+
export ESPRESSIF_IDE_SOURCE="$ESP_IDE_WORK/Espressif-IDE"
97+
else
98+
# fallback: search for an eclipse executable
99+
FOUND_IDE="$(find "$ESP_IDE_WORK" -maxdepth 4 -type f -name espressif-ide -perm -111 | head -n1 || true)"
100+
if [[ -z "$FOUND_IDE" ]]; then
101+
echo "❌ Could not locate 'espressif-ide' launcher inside extracted Espressif-IDE."
102+
echo "Top-level contents:"
103+
ls -la "$ESP_IDE_WORK"
104+
exit 1
105+
fi
106+
export ESPRESSIF_IDE_SOURCE="$(dirname "$FOUND_IDE")"
107+
fi
108+
109+
echo "ESPRESSIF_IDE_SOURCE resolved to: $ESPRESSIF_IDE_SOURCE"
110+
test -x "$ESPRESSIF_IDE_SOURCE/espressif-ide" || { echo "❌ Invalid ESPRESSIF_IDE_SOURCE: $ESPRESSIF_IDE_SOURCE"; exit 1; }
111+
112+
echo "=== Case 4: Espressif-IDE stable -> dev update ==="
113+
: "${ESPRESSIF_IDE_SOURCE:?Provide ESPRESSIF_IDE_SOURCE for Case 4 (path to extracted IDE root)}"
114+
115+
if CASE_ID="case4-espressif-ide-bundled-to-nightly" \
116+
BASE_PRODUCT="espressif-ide" \
117+
DO_DEV_UPDATE=1 \
118+
SKIP_STABLE_INSTALL=1 \
119+
ESPRESSIF_IDE_SOURCE="$ESPRESSIF_IDE_SOURCE" \
120+
WORKROOT="$WORKROOT" OUTROOT="$OUTROOT" \
121+
bash "$ROOT_DIR/run-single-case.sh"; then
122+
123+
echo "✅ Test Case 4 completed successfully"
124+
125+
else
126+
echo "❌ Test Case 4 FAILED"
127+
FAIL=1
128+
fi
129129

130130
echo ""
131131
echo "All cases finished. Artifacts in: $OUTROOT"

releng/update-site-tests/run-single-case.sh

Lines changed: 95 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,21 @@ else
6666
fi
6767
echo "Using launcher: $LAUNCHER"
6868

69+
JAVA_LAUNCHER=""
70+
EQUINOX_LAUNCHER_JAR=""
71+
72+
if [[ "$BASE_PRODUCT" == "espressif-ide" ]]; then
73+
EQUINOX_LAUNCHER_JAR="$(find "$ECLIPSE_HOME/plugins" -maxdepth 1 -name 'org.eclipse.equinox.launcher_*.jar' | head -n1 || true)"
74+
[[ -n "$EQUINOX_LAUNCHER_JAR" ]] || { echo "❌ Equinox launcher jar not found under $ECLIPSE_HOME/plugins"; exit 1; }
75+
76+
JAVA_LAUNCHER=( java -jar "$EQUINOX_LAUNCHER_JAR" )
77+
echo "Using Equinox launcher jar for Espressif-IDE: $EQUINOX_LAUNCHER_JAR"
78+
fi
79+
6980
# Common director flags: IMPORTANT to keep same destination/profile/bundlepool across steps
7081
P2_DEST_ARGS=( -destination "$ECLIPSE_HOME" -profile SDKProfile -bundlepool "$WORKDIR/p2" -roaming )
82+
WORKSPACE_DIR="$WORKDIR/workspace"
83+
mkdir -p "$WORKSPACE_DIR"
7184

7285
build_repo_list() {
7386
local primary="$1"
@@ -81,47 +94,100 @@ build_repo_list() {
8194

8295
install_iu () {
8396
local repo="$1"
84-
"$LAUNCHER" \
85-
-nosplash \
86-
-application org.eclipse.equinox.p2.director \
87-
-repository "$repo" \
88-
-installIU "$FEATURE_ID" \
89-
"${P2_DEST_ARGS[@]}" \
90-
-consoleLog
97+
98+
if [[ "$BASE_PRODUCT" == "espressif-ide" ]]; then
99+
"${JAVA_LAUNCHER[@]}" \
100+
-clean \
101+
-nosplash \
102+
-data "$WORKSPACE_DIR" \
103+
-application org.eclipse.equinox.p2.director \
104+
-repository "$repo" \
105+
-installIU "$FEATURE_ID" \
106+
"${P2_DEST_ARGS[@]}" \
107+
-consoleLog
108+
else
109+
"$LAUNCHER" \
110+
-nosplash \
111+
-application org.eclipse.equinox.p2.director \
112+
-repository "$repo" \
113+
-installIU "$FEATURE_ID" \
114+
"${P2_DEST_ARGS[@]}" \
115+
-consoleLog
116+
fi
91117
}
92118

93119
replace_iu () {
94120
local repo="$1"
95-
"$LAUNCHER" \
96-
-nosplash \
97-
-application org.eclipse.equinox.p2.director \
98-
-repository "$repo" \
99-
-uninstallIU "$FEATURE_ID" \
100-
-installIU "$FEATURE_ID" \
101-
"${P2_DEST_ARGS[@]}" \
102-
-consoleLog
121+
122+
if [[ "$BASE_PRODUCT" == "espressif-ide" ]]; then
123+
"${JAVA_LAUNCHER[@]}" \
124+
-clean \
125+
-nosplash \
126+
-data "$WORKSPACE_DIR" \
127+
-application org.eclipse.equinox.p2.director \
128+
-repository "$repo" \
129+
-uninstallIU "$FEATURE_ID" \
130+
-installIU "$FEATURE_ID" \
131+
"${P2_DEST_ARGS[@]}" \
132+
-consoleLog
133+
else
134+
"$LAUNCHER" \
135+
-nosplash \
136+
-application org.eclipse.equinox.p2.director \
137+
-repository "$repo" \
138+
-uninstallIU "$FEATURE_ID" \
139+
-installIU "$FEATURE_ID" \
140+
"${P2_DEST_ARGS[@]}" \
141+
-consoleLog
142+
fi
103143
}
104144

105145
list_ius () {
106146
local out="$1"
107-
"$LAUNCHER" \
108-
-nosplash \
109-
-application org.eclipse.equinox.p2.director \
110-
-list \
111-
"${P2_DEST_ARGS[@]}" \
112-
-consoleLog \
113-
> "$LOGDIR/$out" 2>&1 || true
147+
148+
if [[ "$BASE_PRODUCT" == "espressif-ide" ]]; then
149+
"${JAVA_LAUNCHER[@]}" \
150+
-clean \
151+
-nosplash \
152+
-data "$WORKSPACE_DIR" \
153+
-application org.eclipse.equinox.p2.director \
154+
-list \
155+
"${P2_DEST_ARGS[@]}" \
156+
-consoleLog \
157+
> "$LOGDIR/$out" 2>&1 || true
158+
else
159+
"$LAUNCHER" \
160+
-nosplash \
161+
-application org.eclipse.equinox.p2.director \
162+
-list \
163+
"${P2_DEST_ARGS[@]}" \
164+
-consoleLog \
165+
> "$LOGDIR/$out" 2>&1 || true
166+
fi
114167
}
115168

116169
list_roots () {
117170
local out="$1"
118-
"$LAUNCHER" \
119-
-nosplash \
120-
-application org.eclipse.equinox.p2.director \
121-
-listInstalledRoots \
122-
"${P2_DEST_ARGS[@]}" \
123-
-consoleLog \
124-
> "$LOGDIR/$out" 2>&1 || true
171+
172+
if [[ "$BASE_PRODUCT" == "espressif-ide" ]]; then
173+
"${JAVA_LAUNCHER[@]}" \
174+
-clean \
175+
-nosplash \
176+
-data "$WORKSPACE_DIR" \
177+
-application org.eclipse.equinox.p2.director \
178+
-listInstalledRoots \
179+
"${P2_DEST_ARGS[@]}" \
180+
-consoleLog \
181+
> "$LOGDIR/$out" 2>&1 || true
182+
else
183+
"$LAUNCHER" \
184+
-nosplash \
185+
-application org.eclipse.equinox.p2.director \
186+
-listInstalledRoots \
187+
"${P2_DEST_ARGS[@]}" \
188+
-consoleLog \
189+
> "$LOGDIR/$out" 2>&1 || true
190+
fi
125191
}
126192

127193
# --- Step A: install stable ---

0 commit comments

Comments
 (0)