vouchington-tooling 0.74.0 → 0.74.1
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.
|
@@ -17,6 +17,9 @@ export type Scenario = {
|
|
|
17
17
|
jobErrors?: number[];
|
|
18
18
|
transient?: number[];
|
|
19
19
|
transientFailures?: number;
|
|
20
|
+
listing?: 'error' | 'empty' | 'null';
|
|
21
|
+
pullError?: boolean;
|
|
22
|
+
listingStatus?: Status;
|
|
20
23
|
env?: Record<string, string>;
|
|
21
24
|
};
|
|
22
25
|
export declare const sha: (digit: string) => string;
|
|
@@ -47,12 +47,20 @@ case "$*" in
|
|
|
47
47
|
if [[ -f "$file" ]]; then cat "$file"; else echo '{"jobs":[{"name":"build","conclusion":"success"}]}'; fi
|
|
48
48
|
exit 0 ;;
|
|
49
49
|
*"/pulls/"*)
|
|
50
|
+
if [[ "$FAKE_PULL_ERROR" == "true" ]]; then echo 'gh: Server Error (HTTP 502)' >&2; exit 1; fi
|
|
50
51
|
echo "$FAKE_MERGED"
|
|
51
52
|
exit 0 ;;
|
|
52
53
|
esac
|
|
53
54
|
[[ "$1 $2" == "api --paginate" ]] || { echo "unexpected gh call: $*" >&2; exit 99; }
|
|
54
55
|
status="\${url#*status=}"
|
|
55
56
|
status="\${status%%&*}"
|
|
57
|
+
mode="\${FAKE_LISTING:-}"
|
|
58
|
+
if [[ -n "\${FAKE_LISTING_STATUS:-}" && "$FAKE_LISTING_STATUS" != "$status" ]]; then mode=; fi
|
|
59
|
+
case "$mode" in
|
|
60
|
+
error) echo 'gh: Server Error (HTTP 502)' >&2; exit 1 ;;
|
|
61
|
+
empty) exit 0 ;;
|
|
62
|
+
null) echo 'null'; exit 0 ;;
|
|
63
|
+
esac
|
|
56
64
|
file="$FAKE_GH_DIR/list-$status.json"
|
|
57
65
|
if [[ -f "$file" ]]; then cat "$file"; else echo '{"total_count":0,"workflow_runs":[]}'; fi
|
|
58
66
|
`;
|
|
@@ -95,6 +103,9 @@ export function createHarness(script, defaultEnv = {}) {
|
|
|
95
103
|
FAKE_JOB_ERROR_IDS: (scenario.jobErrors ?? []).join(' '),
|
|
96
104
|
FAKE_TRANSIENT_IDS: (scenario.transient ?? []).join(' '),
|
|
97
105
|
FAKE_TRANSIENT_FAILURES: String(scenario.transientFailures ?? 1),
|
|
106
|
+
FAKE_LISTING: scenario.listing ?? '',
|
|
107
|
+
FAKE_LISTING_STATUS: scenario.listingStatus ?? '',
|
|
108
|
+
FAKE_PULL_ERROR: String(scenario.pullError ?? false),
|
|
98
109
|
FAKE_MERGED: String(scenario.merged ?? false),
|
|
99
110
|
GH_TOKEN: 'token',
|
|
100
111
|
PR_NUMBER: scenario.pr ?? '14',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vouchington-tooling",
|
|
3
|
-
"version": "0.74.
|
|
3
|
+
"version": "0.74.1",
|
|
4
4
|
"description": "Vouchington CLI and extractable tooling libraries.",
|
|
5
5
|
"homepage": "https://github.com/vouchington/vouchington-tooling/tree/main/packages/vouchington-tooling#readme",
|
|
6
6
|
"bugs": {
|
|
Binary file
|