Skip to content

Commit 2350a9f

Browse files
authored
Merge pull request #7 from rdbumstead/release/v2.2.0
Release v2.2.0: Robustness Fixes & Testing Overhaul
2 parents 4f7aa81 + 02bf453 commit 2350a9f

26 files changed

+2406
-2540
lines changed

.github/workflows/test-auth.yml

Lines changed: 450 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 336 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,336 @@
1+
# ============================================================================
2+
# .github/workflows/test-critical.yml
3+
# Critical tests that must pass for every commit
4+
# ============================================================================
5+
name: Critical Tests
6+
7+
on:
8+
push:
9+
branches: [main, develop]
10+
paths:
11+
- "action.yml"
12+
- ".github/workflows/test-critical.yml"
13+
pull_request:
14+
branches: [main, develop]
15+
paths:
16+
- "action.yml"
17+
- ".github/workflows/test-critical.yml"
18+
workflow_dispatch:
19+
20+
concurrency:
21+
group: critical-tests-${{ github.ref }}
22+
cancel-in-progress: true
23+
24+
jobs:
25+
health-check:
26+
name: CLI Health Check
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
32+
- name: Setup Salesforce CLI
33+
uses: ./
34+
with:
35+
skip_auth: "true"
36+
37+
- name: Comprehensive CLI Health Check
38+
shell: bash
39+
run: |
40+
echo "🔍 Verifying CLI functionality..."
41+
sf --version || exit 1
42+
sf plugins --core || exit 1
43+
sf --help >/dev/null 2>&1 || exit 1
44+
sf config list >/dev/null 2>&1 || exit 1
45+
echo "✅ All checks passed"
46+
47+
cli-only:
48+
name: CLI Installation Only
49+
runs-on: ubuntu-latest
50+
51+
steps:
52+
- name: Checkout
53+
uses: actions/checkout@v4
54+
55+
- name: Setup Salesforce (Skip Auth)
56+
uses: ./
57+
with:
58+
skip_auth: "true"
59+
60+
- name: Verify CLI Installation
61+
run: |
62+
echo "Verifying SF CLI installation..."
63+
sf --version | head -n 1
64+
65+
echo ""
66+
echo "Verifying plugin system..."
67+
sf plugins
68+
69+
echo ""
70+
echo "✅ CLI installed successfully without authentication"
71+
72+
error-handling:
73+
name: Error Handling
74+
runs-on: ubuntu-latest
75+
76+
steps:
77+
- name: Checkout
78+
uses: actions/checkout@v4
79+
80+
- name: Test Missing Required Inputs
81+
id: test-missing-inputs
82+
continue-on-error: true
83+
uses: ./
84+
with:
85+
skip_auth: "false"
86+
# Intentionally missing jwt_key, client_id, username
87+
88+
- name: Verify Error Was Caught
89+
run: |
90+
if [ "${{ steps.test-missing-inputs.outcome }}" = "failure" ]; then
91+
echo "✅ Action correctly failed with missing inputs"
92+
else
93+
echo "❌ Action should have failed with missing inputs"
94+
exit 1
95+
fi
96+
97+
cache-behavior:
98+
name: Cache Behavior
99+
runs-on: ubuntu-latest
100+
101+
steps:
102+
- name: Checkout
103+
uses: actions/checkout@v4
104+
105+
- name: First Run (Cache Miss Expected)
106+
id: first-run
107+
uses: ./
108+
with:
109+
skip_auth: "true"
110+
install_delta: "true"
111+
112+
- name: Second Run (Cache Hit Expected)
113+
id: second-run
114+
uses: ./
115+
with:
116+
skip_auth: "true"
117+
install_delta: "true"
118+
119+
- name: Verify Cache Was Used
120+
run: |
121+
echo "📦 Cache behavior test completed"
122+
echo ""
123+
echo "Both runs completed successfully."
124+
echo "Cache hit/miss can be verified in the action logs above."
125+
echo ""
126+
echo "✅ Cache test passed"
127+
128+
cache-granularity:
129+
name: Cache Granularity
130+
runs-on: ubuntu-latest
131+
132+
steps:
133+
- name: Checkout
134+
uses: actions/checkout@v4
135+
136+
- name: Setup with Major Cache Granularity
137+
id: setup-major
138+
uses: ./
139+
with:
140+
skip_auth: "true"
141+
cli_version_for_cache: "major"
142+
143+
- name: Setup with Minor Cache Granularity
144+
id: setup-minor
145+
uses: ./
146+
with:
147+
skip_auth: "true"
148+
cli_version_for_cache: "minor"
149+
150+
- name: Setup with Exact Cache Granularity
151+
id: setup-exact
152+
uses: ./
153+
with:
154+
skip_auth: "true"
155+
cli_version_for_cache: "exact"
156+
157+
- name: Verify
158+
run: |
159+
echo "✅ Cache granularity test completed"
160+
echo "All three granularity options accepted: major, minor, exact"
161+
162+
cli-retry:
163+
name: CLI Install Retry Logic
164+
runs-on: ubuntu-latest
165+
166+
steps:
167+
- name: Checkout
168+
uses: actions/checkout@v4
169+
170+
- name: Setup Salesforce (with retry simulation)
171+
id: setup-retry
172+
continue-on-error: true
173+
uses: ./
174+
with:
175+
skip_auth: "true"
176+
cli_version: "999.999.999" # Non-existent version to trigger retries
177+
178+
- name: Verify Retry Behavior
179+
run: |
180+
if [ "${{ steps.setup-retry.outcome }}" = "failure" ]; then
181+
echo "✅ CLI install failed after retries as expected"
182+
else
183+
echo "❌ Action unexpectedly succeeded with invalid CLI version"
184+
exit 1
185+
fi
186+
187+
source-flags:
188+
name: Source Flags Output
189+
runs-on: ubuntu-latest
190+
191+
steps:
192+
- name: Checkout
193+
uses: actions/checkout@v4
194+
195+
- name: Create Mock Directories
196+
run: mkdir -p force-app src packages/core
197+
198+
- name: Setup with Multiple Directories
199+
id: setup-dirs
200+
uses: ./
201+
with:
202+
skip_auth: "true"
203+
source_dirs: "force-app,src,packages/core"
204+
205+
- name: Verify Source Flags
206+
run: |
207+
FLAGS="${{ steps.setup-dirs.outputs.source_flags }}"
208+
echo "Source flags: $FLAGS"
209+
210+
# Verify each directory is present with --source-dir prefix
211+
for dir in force-app src packages/core; do
212+
if [[ "$FLAGS" == *"--source-dir $dir"* ]]; then
213+
echo "✅ Found: --source-dir $dir"
214+
else
215+
echo "❌ Missing: --source-dir $dir"
216+
exit 1
217+
fi
218+
done
219+
220+
echo "✅ source_flags output correct"
221+
222+
pinned-cli-version:
223+
name: Pinned CLI Version
224+
runs-on: ubuntu-latest
225+
226+
steps:
227+
- name: Checkout
228+
uses: actions/checkout@v4
229+
230+
- name: Setup with Pinned Version
231+
id: setup
232+
uses: ./
233+
with:
234+
skip_auth: "true"
235+
cli_version: "2.67.7" # Known stable version
236+
237+
- name: Verify CLI Version
238+
run: |
239+
INSTALLED=$(sf --version | head -n 1)
240+
echo "Installed: $INSTALLED"
241+
242+
if [[ "$INSTALLED" == *"2.67.7"* ]]; then
243+
echo "✅ Correct CLI version installed"
244+
else
245+
echo "❌ Expected version 2.67.7, got: $INSTALLED"
246+
exit 1
247+
fi
248+
249+
summary:
250+
name: Critical Tests Summary
251+
runs-on: ubuntu-latest
252+
needs:
253+
- health-check
254+
- cli-only
255+
- error-handling
256+
- cache-behavior
257+
- cache-granularity
258+
- cli-retry
259+
- source-flags
260+
- pinned-cli-version
261+
if: always()
262+
263+
steps:
264+
- name: Generate Summary
265+
run: |
266+
echo "## 🛡️ Critical Test Results" >> $GITHUB_STEP_SUMMARY
267+
echo "" >> $GITHUB_STEP_SUMMARY
268+
echo "These tests must pass for every commit." >> $GITHUB_STEP_SUMMARY
269+
echo "" >> $GITHUB_STEP_SUMMARY
270+
271+
FAILED=false
272+
273+
if [ "${{ needs.health-check.result }}" = "success" ]; then
274+
echo "✅ **Health Check**: Passed" >> $GITHUB_STEP_SUMMARY
275+
else
276+
echo "❌ **Health Check**: Failed" >> $GITHUB_STEP_SUMMARY
277+
FAILED=true
278+
fi
279+
280+
if [ "${{ needs.cli-only.result }}" = "success" ]; then
281+
echo "✅ **CLI Installation Only**: Passed" >> $GITHUB_STEP_SUMMARY
282+
else
283+
echo "❌ **CLI Installation Only**: Failed" >> $GITHUB_STEP_SUMMARY
284+
FAILED=true
285+
fi
286+
287+
if [ "${{ needs.error-handling.result }}" = "success" ]; then
288+
echo "✅ **Error Handling**: Passed" >> $GITHUB_STEP_SUMMARY
289+
else
290+
echo "❌ **Error Handling**: Failed" >> $GITHUB_STEP_SUMMARY
291+
FAILED=true
292+
fi
293+
294+
if [ "${{ needs.cache-behavior.result }}" = "success" ]; then
295+
echo "✅ **Cache Behavior**: Passed" >> $GITHUB_STEP_SUMMARY
296+
else
297+
echo "❌ **Cache Behavior**: Failed" >> $GITHUB_STEP_SUMMARY
298+
FAILED=true
299+
fi
300+
301+
if [ "${{ needs.cache-granularity.result }}" = "success" ]; then
302+
echo "✅ **Cache Granularity**: Passed" >> $GITHUB_STEP_SUMMARY
303+
else
304+
echo "❌ **Cache Granularity**: Failed" >> $GITHUB_STEP_SUMMARY
305+
FAILED=true
306+
fi
307+
308+
if [ "${{ needs.cli-retry.result }}" = "success" ]; then
309+
echo "✅ **CLI Install Retry**: Passed" >> $GITHUB_STEP_SUMMARY
310+
else
311+
echo "❌ **CLI Install Retry**: Failed" >> $GITHUB_STEP_SUMMARY
312+
FAILED=true
313+
fi
314+
315+
if [ "${{ needs.source-flags.result }}" = "success" ]; then
316+
echo "✅ **Source Flags Output**: Passed" >> $GITHUB_STEP_SUMMARY
317+
else
318+
echo "❌ **Source Flags Output**: Failed" >> $GITHUB_STEP_SUMMARY
319+
FAILED=true
320+
fi
321+
322+
if [ "${{ needs.pinned-cli-version.result }}" = "success" ]; then
323+
echo "✅ **Pinned CLI Version**: Passed" >> $GITHUB_STEP_SUMMARY
324+
else
325+
echo "❌ **Pinned CLI Version**: Failed" >> $GITHUB_STEP_SUMMARY
326+
FAILED=true
327+
fi
328+
329+
echo "" >> $GITHUB_STEP_SUMMARY
330+
331+
if [ "$FAILED" = true ]; then
332+
echo "❌ **Status**: One or more critical tests failed" >> $GITHUB_STEP_SUMMARY
333+
exit 1
334+
else
335+
echo "✅ **Status**: All critical tests passed" >> $GITHUB_STEP_SUMMARY
336+
fi

0 commit comments

Comments
 (0)