Skip to content

Commit 8e472a5

Browse files
mbeczynskiclaude
andcommitted
test: neutral machine key in tests instead of a real person's name
The `<name>-mac-studio-3` machine key in the budget, folder and visibility tests is plain test data (the real key is read at runtime from MachineIdentity.storedKey), so it is replaced with `home-mac-studio-3`. The doc comment in MachineBudget uses a placeholder. No behaviour change. The copyright line in Info.plist is the author attribution, like LICENSE, and stays. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ww8BFyxe5Efb9pvhshhtig
1 parent 395628c commit 8e472a5

4 files changed

Lines changed: 11 additions & 11 deletions

File tree

‎mac-app/Sources/CloudMachineCore/MachineBudget.swift‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public enum MachineBudget {
3131
///
3232
/// Also under `machineKey`, the way `machines.json` was keyed before the
3333
/// folder became the key. On a Mac set up then, the two differ: on this
34-
/// project's own Mac the entry is `marcin-mac-studio-3` with 3500 GB, while
34+
/// project's own Mac the entry is `<user>-mac-studio-3` with 3500 GB, while
3535
/// the folder is `mac-studio`. Until 09.10.2026 only the folder was looked
3636
/// up, so the limit was there in the file and nowhere in effect: no usage
3737
/// measurement, no 90% / 100% alarm. The folder's own entry wins - it is the

‎mac-app/Tests/CloudMachineAppTests/BackupVisibilityTests.swift‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ final class BackupVisibilityTests: XCTestCase {
4949
"mac-studio.sparsebundle")
5050
XCTAssertNil(
5151
InstallationTraces.cachedImage(
52-
folder: "marcin-mac-studio-3", imageName: "marcin-mac-studio-3", cacheDir: directory))
52+
folder: "home-mac-studio-3", imageName: "home-mac-studio-3", cacheDir: directory))
5353
}
5454

5555
func testNoCacheMeansNoTraces() {
@@ -116,13 +116,13 @@ final class BackupVisibilityTests: XCTestCase {
116116
XCTAssertEqual(
117117
DriveFolder.decide(
118118
existing: nil, requested: nil, legacyEvidence: evidence,
119-
machineKey: "marcin-mac-studio-3"),
119+
machineKey: "home-mac-studio-3"),
120120
.assign("mac-studio"))
121121
}
122122
XCTAssertEqual(DriveFolder.legacyEvidence(remoteConfigured: false, cachedFolders: []), false)
123123
XCTAssertNil(DriveFolder.legacyEvidence(remoteConfigured: nil, cachedFolders: []))
124124
XCTAssertEqual(
125-
DriveFolder.legacyEvidence(remoteConfigured: false, cachedFolders: ["marcin-mac-studio-3"]),
125+
DriveFolder.legacyEvidence(remoteConfigured: false, cachedFolders: ["home-mac-studio-3"]),
126126
false)
127127
}
128128

‎mac-app/Tests/CloudMachineAppTests/DriveFolderTests.swift‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ final class DriveFolderTests: XCTestCase {
4040
/// in `mac-studio`, would have been given its machine key as a new, empty
4141
/// folder.
4242
func testUnknownLegacyEvidenceRefusesInsteadOfGuessing() {
43-
for requested in [nil, "mac-studio", "marcin-mac-studio-3"] {
43+
for requested in [nil, "mac-studio", "home-mac-studio-3"] {
4444
guard
4545
case .refuse = DriveFolder.decide(
4646
existing: nil, requested: requested, legacyEvidence: nil,
47-
machineKey: "marcin-mac-studio-3")
47+
machineKey: "home-mac-studio-3")
4848
else { return XCTFail("chose a folder without knowing whether a backup already exists") }
4949
}
5050
}

‎mac-app/Tests/CloudMachineAppTests/MachineBudgetTests.swift‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ final class MachineBudgetTests: XCTestCase {
114114
private func productionLikeConfig() -> MachinesConfig {
115115
var config = MachinesConfig.empty
116116
config.machines = [
117-
MachineEntry(key: "marcin-mac-studio-3", displayName: "Marcin Mac Studio 3", limitGB: 3500)
117+
MachineEntry(key: "home-mac-studio-3", displayName: "Home Mac Studio 3", limitGB: 3500)
118118
]
119119
return config
120120
}
@@ -124,15 +124,15 @@ final class MachineBudgetTests: XCTestCase {
124124
func testLimitUnderTheMachineKeyCounts() {
125125
XCTAssertEqual(
126126
MachineBudget.limitGB(
127-
in: productionLikeConfig(), folder: "mac-studio", machineKey: "marcin-mac-studio-3"),
127+
in: productionLikeConfig(), folder: "mac-studio", machineKey: "home-mac-studio-3"),
128128
3500)
129129
}
130130

131131
func testFolderEntryWinsOverTheMachineKey() {
132132
var config = productionLikeConfig()
133133
config.machines.append(MachineEntry(key: "mac-studio", displayName: "x", limitGB: 1000))
134134
XCTAssertEqual(
135-
MachineBudget.limitGB(in: config, folder: "mac-studio", machineKey: "marcin-mac-studio-3"),
135+
MachineBudget.limitGB(in: config, folder: "mac-studio", machineKey: "home-mac-studio-3"),
136136
1000)
137137
}
138138

@@ -145,10 +145,10 @@ final class MachineBudgetTests: XCTestCase {
145145
/// Setting the limit moves the old entry, so one Mac is not counted twice.
146146
func testSettingTheLimitMovesTheOldEntry() {
147147
let config = MachineBudget.withLimit(
148-
3000, folder: "mac-studio", machineKey: "marcin-mac-studio-3", in: productionLikeConfig())
148+
3000, folder: "mac-studio", machineKey: "home-mac-studio-3", in: productionLikeConfig())
149149
XCTAssertEqual(config.machines.map(\.key), ["mac-studio"])
150150
XCTAssertEqual(config.machines.first?.limitGB, 3000)
151-
XCTAssertEqual(config.machines.first?.displayName, "Marcin Mac Studio 3")
151+
XCTAssertEqual(config.machines.first?.displayName, "Home Mac Studio 3")
152152
XCTAssertEqual(config.allocatedGB, 3000)
153153
}
154154

0 commit comments

Comments
 (0)