File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ set -euo pipefail
3+
4+ # Required environment variables:
5+ # ONEDRIVE_BIN
6+ # E2E_TARGET
7+ # RUN_ID
8+
9+ OUT_DIR=" ci/e2e/out"
10+ SYNC_ROOT=" $RUNNER_TEMP /sync-${E2E_TARGET} "
11+
12+ mkdir -p " $OUT_DIR "
13+ mkdir -p " $SYNC_ROOT "
14+
15+ RESULTS_FILE=" ${OUT_DIR} /results.json"
16+ LOG_FILE=" ${OUT_DIR} /sync.log"
17+
18+ echo " E2E target: ${E2E_TARGET} "
19+ echo " Sync root: ${SYNC_ROOT} "
20+
21+ CASE_NAME=" basic-resync"
22+
23+ pass_count=0
24+ fail_count=0
25+
26+ echo " Running: onedrive --sync --verbose --resync --resync-auth"
27+
28+ set +e
29+ " $ONEDRIVE_BIN " \
30+ --sync \
31+ --verbose \
32+ --resync \
33+ --resync-auth \
34+ --syncdir " $SYNC_ROOT " \
35+ > " $LOG_FILE " 2>&1
36+ rc=$?
37+ set -e
38+
39+ if [ " $rc " -eq 0 ]; then
40+ pass_count=1
41+ status=" pass"
42+ else
43+ fail_count=1
44+ status=" fail"
45+ fi
46+
47+ # Write minimal results.json
48+ cat > " $RESULTS_FILE " << EOF
49+ {
50+ "target": "${E2E_TARGET} ",
51+ "run_id": ${RUN_ID} ,
52+ "cases": [
53+ {
54+ "name": "${CASE_NAME} ",
55+ "status": "${status} "
56+ }
57+ ]
58+ }
59+ EOF
60+
61+ echo " Exit code: ${rc} "
62+ echo " Results written to ${RESULTS_FILE} "
63+ echo " Passed: ${pass_count} "
64+ echo " Failed: ${fail_count} "
65+
66+ # Fail job if command failed
67+ if [ " $rc " -ne 0 ]; then
68+ echo " E2E failed - see sync.log"
69+ exit 1
70+ fi
You can’t perform that action at this time.
0 commit comments