@osfactory/har 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -43,7 +43,7 @@ mkdir -p "$ARTIFACT_DIR"
|
|
|
43
43
|
log "Running Playwright against $BASE_URL (API: $API_URL)"
|
|
44
44
|
log "Work dir: $WORK_DIR"
|
|
45
45
|
|
|
46
|
-
START_TOTAL=$(
|
|
46
|
+
START_TOTAL=$(now_ms)
|
|
47
47
|
|
|
48
48
|
set +e
|
|
49
49
|
cd "$WORK_DIR"
|
|
@@ -51,7 +51,7 @@ PW_OUTPUT=$(npx playwright test 2>&1)
|
|
|
51
51
|
PW_EXIT=$?
|
|
52
52
|
set -e
|
|
53
53
|
|
|
54
|
-
END_TOTAL=$(
|
|
54
|
+
END_TOTAL=$(now_ms)
|
|
55
55
|
TOTAL_MS=$(( END_TOTAL - START_TOTAL ))
|
|
56
56
|
|
|
57
57
|
echo "$PW_OUTPUT" >&2
|
|
@@ -78,7 +78,11 @@ if [ -n "$FLOW_FILTER" ]; then
|
|
|
78
78
|
exit 1
|
|
79
79
|
fi
|
|
80
80
|
else
|
|
81
|
-
|
|
81
|
+
# while-read instead of mapfile: stock macOS bash is 3.2, which lacks mapfile.
|
|
82
|
+
FLOW_SCRIPTS=()
|
|
83
|
+
while IFS= read -r flow_script; do
|
|
84
|
+
FLOW_SCRIPTS+=("$flow_script")
|
|
85
|
+
done < <(find "$FLOWS_DIR" -maxdepth 1 -name "*.sh" ! -name ".*" | sort)
|
|
82
86
|
fi
|
|
83
87
|
|
|
84
88
|
if [ ${#FLOW_SCRIPTS[@]} -eq 0 ]; then
|
|
@@ -103,7 +107,7 @@ mkdir -p "$ARTIFACT_DIR"
|
|
|
103
107
|
log "Running ${#FLOW_SCRIPTS[@]} flow(s) against simulator..."
|
|
104
108
|
|
|
105
109
|
OVERALL_PASS=true
|
|
106
|
-
START_TOTAL=$(
|
|
110
|
+
START_TOTAL=$(now_ms)
|
|
107
111
|
FLOW_RESULTS="[]"
|
|
108
112
|
|
|
109
113
|
for FLOW_SCRIPT in "${FLOW_SCRIPTS[@]}"; do
|
|
@@ -113,7 +117,7 @@ for FLOW_SCRIPT in "${FLOW_SCRIPTS[@]}"; do
|
|
|
113
117
|
FLOW_ARTIFACT_DIR="$ARTIFACT_DIR/$FLOW_NAME"
|
|
114
118
|
mkdir -p "$FLOW_ARTIFACT_DIR"
|
|
115
119
|
|
|
116
|
-
FLOW_START=$(
|
|
120
|
+
FLOW_START=$(now_ms)
|
|
117
121
|
|
|
118
122
|
set +e
|
|
119
123
|
FLOW_OUTPUT=$(
|
|
@@ -128,7 +132,7 @@ for FLOW_SCRIPT in "${FLOW_SCRIPTS[@]}"; do
|
|
|
128
132
|
FLOW_EXIT=$?
|
|
129
133
|
set -e
|
|
130
134
|
|
|
131
|
-
FLOW_END=$(
|
|
135
|
+
FLOW_END=$(now_ms)
|
|
132
136
|
FLOW_MS=$(( FLOW_END - FLOW_START ))
|
|
133
137
|
|
|
134
138
|
if [ "$FLOW_EXIT" = "0" ]; then
|
|
@@ -162,7 +166,7 @@ process.stdout.write(JSON.stringify(arr));
|
|
|
162
166
|
" 2>/dev/null || echo "$FLOW_RESULTS")
|
|
163
167
|
done
|
|
164
168
|
|
|
165
|
-
END_TOTAL=$(
|
|
169
|
+
END_TOTAL=$(now_ms)
|
|
166
170
|
TOTAL_MS=$(( END_TOTAL - START_TOTAL ))
|
|
167
171
|
|
|
168
172
|
# ── Output ────────────────────────────────────────────────────────────────────
|