forked from BasedHardware/omi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdesktop-release-lifecycle.test.ts
More file actions
104 lines (95 loc) · 3.06 KB
/
Copy pathdesktop-release-lifecycle.test.ts
File metadata and controls
104 lines (95 loc) · 3.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
import { describe, expect, it } from "vitest";
import {
desktopReleaseLifecycle,
desktopReleaseLifecycleLabel,
desktopStableCandidateFromMetadata,
newestSparkleVersion,
tagBuildNumber,
} from "../desktop-release-lifecycle";
const completeNomination = {
stableCandidate: "true",
stableCandidateTag: "v1.2.3+123-macos",
stableCandidateSha: "a".repeat(40),
stableCandidateAt: "2026-07-10T12:00:00Z",
stableCandidateBy: "release-operator",
stableCandidateRationale: "soak passed",
stableCandidateSoakReview: "24h reviewed",
stableCandidateTelemetryReview: "health reviewed",
stableCandidateReleaseNotesReview: "rollup reviewed",
};
const expectedNomination = {
releaseTag: "v1.2.3+123-macos",
};
describe("desktop release lifecycle", () => {
it("requires every nomination field before declaring a stable candidate", () => {
expect(
desktopStableCandidateFromMetadata(completeNomination, expectedNomination)
.complete,
).toBe(true);
expect(
desktopStableCandidateFromMetadata(
{
...completeNomination,
stableCandidateTelemetryReview: "",
},
expectedNomination,
).complete,
).toBe(false);
});
it("rejects a nomination tied to a different release tag", () => {
expect(
desktopStableCandidateFromMetadata(completeNomination, {
releaseTag: "v9.9.9+999-macos",
}).complete,
).toBe(false);
});
it("does not require qualification evidence for a stable candidate", () => {
expect(
desktopStableCandidateFromMetadata(
{
...completeNomination,
stableCandidateQualificationEvidence: "",
},
expectedNomination,
).complete,
).toBe(true);
});
it("distinguishes candidate, live beta, stable-candidate, and stable", () => {
const notNominated = desktopStableCandidateFromMetadata(
{},
expectedNomination,
);
const nominated = desktopStableCandidateFromMetadata(
completeNomination,
expectedNomination,
);
expect(desktopReleaseLifecycle("candidate", false, notNominated)).toBe(
"build_candidate",
);
expect(desktopReleaseLifecycle("beta", true, notNominated)).toBe(
"beta_live",
);
expect(desktopReleaseLifecycle("beta", true, nominated)).toBe(
"stable_candidate",
);
expect(desktopReleaseLifecycle("stable", true, nominated)).toBe("stable");
});
it("uses the canonical operator labels", () => {
expect(desktopReleaseLifecycleLabel("build_candidate")).toBe(
"Build candidate",
);
expect(desktopReleaseLifecycleLabel("beta_live")).toBe("Beta");
expect(desktopReleaseLifecycleLabel("stable_candidate")).toBe(
"Stable candidate",
);
expect(desktopReleaseLifecycleLabel("stable")).toBe("Stable");
});
it("matches live beta by the newest sparkle version", () => {
expect(tagBuildNumber("v0.12.172+12172-macos")).toBe(12172);
expect(
newestSparkleVersion(
'<item><sparkle:version>12170</sparkle:version></item><item sparkle:version="12172"/>',
),
).toBe(12172);
});
});