Skip to content

Commit 51b87dd

Browse files
committed
fix
1 parent 3bce9f8 commit 51b87dd

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Tests/SparkConnectTests/SQLTests.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ struct SQLTests {
3636
let regexOwner = /(runner|185)/
3737

3838
private func cleanUp(_ str: String) -> String {
39-
return removeOwner(removeID(removeLocation(str)))
39+
return removeOwner(removeID(removeLocation(replaceUserName(str))))
4040
}
4141

4242
private func removeID(_ str: String) -> String {
@@ -51,6 +51,14 @@ struct SQLTests {
5151
return str.replacing(regexOwner, with: "*").replacing(/"Owner\|[^|]*"/, with: "Owner|*|")
5252
}
5353

54+
private func replaceUserName(_ str: String) -> String {
55+
#if os(macOS) || os(Linux)
56+
return str.replacing(ProcessInfo.processInfo.userName, with: "spark")
57+
#else
58+
return str
59+
#endif
60+
}
61+
5462
private func normalize(_ str: String) -> String {
5563
return str.replacing(/[-]+/, with: "-").replacing(/[ ]+/, with: " ")
5664
}

0 commit comments

Comments
 (0)