This commit is contained in:
@@ -1,62 +0,0 @@
|
||||
@_spi(Internal) import CliClient
|
||||
import Dependencies
|
||||
import ShellClient
|
||||
import Testing
|
||||
|
||||
@Test
|
||||
func testFindConfigPaths() throws {
|
||||
try withTestLogger(key: "testFindConfigPaths") {
|
||||
$0.fileClient = .liveValue
|
||||
} operation: {
|
||||
@Dependency(\.logger) var logger
|
||||
let urls = try findConfigurationFiles()
|
||||
logger.debug("urls: \(urls)")
|
||||
// #expect(urls.count == 1)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
func loadConfiguration() throws {
|
||||
try withTestLogger(key: "loadConfiguration", logLevel: .debug) {
|
||||
$0.cliClient = .liveValue
|
||||
$0.fileClient = .liveValue
|
||||
} operation: {
|
||||
@Dependency(\.cliClient) var client
|
||||
@Dependency(\.logger) var logger
|
||||
let config = try client.loadConfiguration()
|
||||
logger.debug("\(config)")
|
||||
#expect(config.playbookDir != nil)
|
||||
}
|
||||
}
|
||||
|
||||
func withTestLogger(
|
||||
key: String,
|
||||
label: String = "CliClientTests",
|
||||
logLevel: Logger.Level = .debug,
|
||||
operation: @escaping @Sendable () throws -> Void
|
||||
) rethrows {
|
||||
try withDependencies {
|
||||
$0.logger = .init(label: label)
|
||||
$0.logger[metadataKey: "test"] = "\(key)"
|
||||
$0.logger.logLevel = logLevel
|
||||
} operation: {
|
||||
try operation()
|
||||
}
|
||||
}
|
||||
|
||||
func withTestLogger(
|
||||
key: String,
|
||||
label: String = "CliClientTests",
|
||||
logLevel: Logger.Level = .debug,
|
||||
dependencies setupDependencies: @escaping (inout DependencyValues) -> Void,
|
||||
operation: @escaping @Sendable () throws -> Void
|
||||
) rethrows {
|
||||
try withDependencies {
|
||||
$0.logger = .init(label: label)
|
||||
$0.logger[metadataKey: "test"] = "\(key)"
|
||||
$0.logger.logLevel = logLevel
|
||||
setupDependencies(&$0)
|
||||
} operation: {
|
||||
try operation()
|
||||
}
|
||||
}
|
||||
@@ -1,156 +0,0 @@
|
||||
@_spi(Internal) import CliDoc
|
||||
@preconcurrency import Rainbow
|
||||
import Testing
|
||||
import XCTest
|
||||
|
||||
final class CliDocTests: XCTestCase {
|
||||
|
||||
override func setUp() {
|
||||
super.setUp()
|
||||
Rainbow.outputTarget = .console
|
||||
Rainbow.enabled = true
|
||||
}
|
||||
|
||||
func testStringChecks() {
|
||||
let expected = "Foo".green.bold
|
||||
|
||||
XCTAssert("Foo".green.bold == expected)
|
||||
XCTAssert(expected != "Foo")
|
||||
}
|
||||
|
||||
func testRepeatingModifier() {
|
||||
let node = AnyNode {
|
||||
Text("foo").color(.green).style(.bold)
|
||||
"\n".repeating(2)
|
||||
Text("bar").repeating(2, separator: " ")
|
||||
}
|
||||
let expected = """
|
||||
\("foo".green.bold)
|
||||
|
||||
bar bar
|
||||
"""
|
||||
XCTAssert(node.render() == expected)
|
||||
}
|
||||
|
||||
func testGroup1() {
|
||||
let arguments = [
|
||||
(true, "foo bar"),
|
||||
(false, """
|
||||
foo
|
||||
bar
|
||||
""")
|
||||
]
|
||||
|
||||
for (inline, expected) in arguments {
|
||||
let node = AnyNode {
|
||||
Group(separator: inline ? " " : "\n") {
|
||||
Text("foo")
|
||||
Text("bar")
|
||||
}
|
||||
}
|
||||
XCTAssert(node.render() == expected)
|
||||
}
|
||||
}
|
||||
|
||||
func testHeader() {
|
||||
let header = Header("Foo")
|
||||
let expected = "\("Foo".yellow.bold)"
|
||||
XCTAssert(header.render() == expected)
|
||||
|
||||
let header2 = Header {
|
||||
"Foo".yellow.bold
|
||||
}
|
||||
XCTAssert(header2.render() == expected)
|
||||
}
|
||||
|
||||
func testGroup() {
|
||||
let group = Group {
|
||||
Text("foo")
|
||||
Text("bar")
|
||||
}
|
||||
|
||||
XCTAssert(group.render() == "foo bar")
|
||||
|
||||
let group2 = Group(separator: "\n") {
|
||||
Text("foo")
|
||||
Text("bar")
|
||||
}
|
||||
let expected = """
|
||||
foo
|
||||
bar
|
||||
"""
|
||||
XCTAssert(group2.render() == expected)
|
||||
}
|
||||
|
||||
func testLabeledContent() {
|
||||
let node = LabeledContent("Foo") {
|
||||
Text("Bar")
|
||||
}
|
||||
.labelStyle(.green)
|
||||
.labelStyle(.bold)
|
||||
|
||||
let expected = """
|
||||
\("Foo".green.bold)
|
||||
Bar
|
||||
"""
|
||||
XCTAssert(node.render() == expected)
|
||||
}
|
||||
|
||||
func testLabeledContent2() {
|
||||
let node = LabeledContent2 {
|
||||
"Foo"
|
||||
} content: {
|
||||
Text("Bar")
|
||||
}
|
||||
// .labelStyle(.green)
|
||||
// .labelStyle(.bold)
|
||||
|
||||
let expected = """
|
||||
Foo Bar
|
||||
"""
|
||||
XCTAssert(node.render() == expected)
|
||||
print(type(of: node.body))
|
||||
XCTAssertNotNil(node.body as? _ManyNode)
|
||||
}
|
||||
|
||||
func testShellCommand() {
|
||||
let node = ShellCommand {
|
||||
"ls -lah"
|
||||
}
|
||||
let expected = " $ ls -lah"
|
||||
XCTAssert(node.render() == expected)
|
||||
}
|
||||
|
||||
func testDiscussion() {
|
||||
let node = Discussion {
|
||||
Group(separator: "\n") {
|
||||
LabeledContent(separator: " ") {
|
||||
"NOTE:".yellow.bold
|
||||
} content: {
|
||||
"Foo"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let expected = """
|
||||
\("NOTE:".yellow.bold) Foo
|
||||
"""
|
||||
|
||||
XCTAssert(node.render() == expected)
|
||||
}
|
||||
|
||||
func testFooNode() {
|
||||
let foo = Foo()
|
||||
XCTAssertNotNil(foo.body as? LabeledContent)
|
||||
}
|
||||
|
||||
func testGroup2() {
|
||||
let node = Group2 {
|
||||
Text("foo")
|
||||
Text("bar")
|
||||
}
|
||||
print(node.render())
|
||||
XCTAssertNotNil(node.body as? _ManyNode)
|
||||
// XCTAssert(false)
|
||||
}
|
||||
}
|
||||
201
Tests/ConfigurationClientTests/ConfigurationClientTests.swift
Normal file
201
Tests/ConfigurationClientTests/ConfigurationClientTests.swift
Normal file
@@ -0,0 +1,201 @@
|
||||
@_spi(Internal) import ConfigurationClient
|
||||
import Foundation
|
||||
import Testing
|
||||
import TestSupport
|
||||
|
||||
@Suite("ConfigurationClientTests")
|
||||
struct ConfigurationClientTests: TestCase {
|
||||
|
||||
@Test
|
||||
func sanity() {
|
||||
withTestLogger(key: "sanity") {
|
||||
@Dependency(\.logger) var logger
|
||||
logger.debug("Testing sanity.")
|
||||
#expect(Bool(true))
|
||||
}
|
||||
}
|
||||
|
||||
@Test(arguments: ["config.toml", "config.json"])
|
||||
func generateConfigFile(fileName: String) async throws {
|
||||
try await withTestLogger(key: "generateConfigFile") {
|
||||
$0.coders = .liveValue
|
||||
$0.fileClient = .liveValue
|
||||
} operation: {
|
||||
@Dependency(\.logger) var logger
|
||||
@Dependency(\.fileClient) var fileClient
|
||||
let configuration = ConfigurationClient.liveValue
|
||||
|
||||
try await withTemporaryDirectory { tempDir in
|
||||
let tempFile = tempDir.appending(path: fileName)
|
||||
let output = try await configuration.generate(.init(
|
||||
force: false,
|
||||
json: fileName.hasSuffix("json"),
|
||||
path: .file(File(tempFile)!)
|
||||
))
|
||||
#expect(FileManager.default.fileExists(atPath: tempFile.cleanFilePath))
|
||||
#expect(fileClient.fileExists(tempFile))
|
||||
#expect(output == tempFile.cleanFilePath)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test(arguments: ["config.toml", "config.json", nil])
|
||||
func loadConfigFile(fileName: String?) async throws {
|
||||
try await withTestLogger(key: "generateConfigFile") {
|
||||
$0.coders = .liveValue
|
||||
$0.fileClient = .liveValue
|
||||
} operation: {
|
||||
@Dependency(\.logger) var logger
|
||||
@Dependency(\.fileClient) var fileClient
|
||||
let configuration = ConfigurationClient.liveValue
|
||||
|
||||
guard let fileName else {
|
||||
let loaded = try await configuration.load(nil)
|
||||
#expect(loaded == .init())
|
||||
return
|
||||
}
|
||||
|
||||
try await withGeneratedConfigFile(named: fileName, client: configuration) { file in
|
||||
let loaded = try await configuration.load(file)
|
||||
#expect(loaded == .mock)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test(arguments: ["config.toml", "config.json", ".hparc.json", ".hparc.toml"])
|
||||
func findConfiguration(fileName: String) async throws {
|
||||
try await withTestLogger(key: "findConfiguration") {
|
||||
$0.fileClient = .liveValue
|
||||
} operation: {
|
||||
@Dependency(\.logger) var logger
|
||||
@Dependency(\.fileClient) var fileClient
|
||||
let client = ConfigurationClient.liveValue
|
||||
|
||||
try await withGeneratedConfigFile(named: fileName, client: client) { file in
|
||||
for environment in generateFindEnvironments(file: file) {
|
||||
if let home = environment["HOME"] {
|
||||
try await withDependencies {
|
||||
$0.fileClient.homeDirectory = { URL(filePath: home) }
|
||||
} operation: {
|
||||
let configuration = ConfigurationClient.live(environment: environment)
|
||||
let found = try await configuration.find()
|
||||
#expect(found == file)
|
||||
}
|
||||
} else {
|
||||
let configuration = ConfigurationClient.live(environment: environment)
|
||||
let found = try await configuration.find()
|
||||
#expect(found == file)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test(arguments: ["config.toml", "config.json", ".hparc.json", ".hparc.toml"])
|
||||
func findXdgConfiguration(fileName: String) async throws {
|
||||
try await withTestLogger(key: "findXdgConfiguration") {
|
||||
$0.fileClient = .liveValue
|
||||
} operation: {
|
||||
@Dependency(\.logger) var logger
|
||||
@Dependency(\.fileClient) var fileClient
|
||||
let client = ConfigurationClient.liveValue
|
||||
|
||||
try await withGeneratedXDGConfigFile(named: fileName, client: client) { file, xdgDir in
|
||||
let environment = ["XDG_CONFIG_HOME": xdgDir.cleanFilePath]
|
||||
let configuration = ConfigurationClient.live(environment: environment)
|
||||
let found = try await configuration.find()
|
||||
#expect(found == file)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
func testFailingFind() async {
|
||||
await withTestLogger(key: "testFailingFind") {
|
||||
$0.fileClient = .liveValue
|
||||
} operation: {
|
||||
await withTemporaryDirectory { tempDir in
|
||||
let environment = [
|
||||
"PWD": tempDir.cleanFilePath,
|
||||
"HPA_CONFIG_HOME": tempDir.cleanFilePath
|
||||
]
|
||||
let configuration = ConfigurationClient.live(environment: environment)
|
||||
do {
|
||||
_ = try await configuration.find()
|
||||
#expect(Bool(false))
|
||||
} catch {
|
||||
#expect(Bool(true))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
func writeCreatesBackupFile() async throws {
|
||||
try await withDependencies {
|
||||
$0.fileClient = .liveValue
|
||||
} operation: {
|
||||
let client = ConfigurationClient.liveValue
|
||||
|
||||
try await withGeneratedConfigFile(named: "config.toml", client: client) { configFile in
|
||||
@Dependency(\.fileClient) var fileClient
|
||||
|
||||
let backupUrl = configFile.url.appendingPathExtension("back")
|
||||
#expect(fileClient.fileExists(backupUrl) == false)
|
||||
|
||||
let config = Configuration()
|
||||
try await client.write(config, to: configFile)
|
||||
|
||||
#expect(fileClient.fileExists(backupUrl))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func generateFindEnvironments(file: File) -> [[String: String]] {
|
||||
let directory = file.url.deletingLastPathComponent().cleanFilePath
|
||||
|
||||
return [
|
||||
["PWD": directory],
|
||||
["HPA_CONFIG_HOME": directory],
|
||||
["HPA_CONFIG_FILE": file.path],
|
||||
["HOME": directory]
|
||||
]
|
||||
}
|
||||
|
||||
func withGeneratedConfigFile(
|
||||
named fileName: String,
|
||||
client: ConfigurationClient,
|
||||
_ operation: @Sendable (File) async throws -> Void
|
||||
) async rethrows {
|
||||
try await withTemporaryDirectory { tempDir in
|
||||
let file = File(tempDir.appending(path: fileName))!
|
||||
_ = try await client.generate(.init(
|
||||
force: true,
|
||||
json: fileName.hasSuffix("json"),
|
||||
path: .file(file)
|
||||
))
|
||||
try await operation(file)
|
||||
}
|
||||
}
|
||||
|
||||
func withGeneratedXDGConfigFile(
|
||||
named fileName: String,
|
||||
client: ConfigurationClient,
|
||||
_ operation: @Sendable (File, URL) async throws -> Void
|
||||
) async rethrows {
|
||||
try await withTemporaryDirectory { tempDir in
|
||||
let xdgDir = tempDir.appending(path: HPAKey.configDirName)
|
||||
try FileManager.default.createDirectory(
|
||||
atPath: xdgDir.cleanFilePath,
|
||||
withIntermediateDirectories: false
|
||||
)
|
||||
let file = File(xdgDir.appending(path: fileName))!
|
||||
_ = try await client.generate(.init(
|
||||
force: true,
|
||||
json: fileName.hasSuffix("json"),
|
||||
path: .file(file)
|
||||
))
|
||||
try await operation(file, tempDir)
|
||||
}
|
||||
}
|
||||
67
Tests/FileClientTests/FileClientTests.swift
Normal file
67
Tests/FileClientTests/FileClientTests.swift
Normal file
@@ -0,0 +1,67 @@
|
||||
import FileClient
|
||||
import Foundation
|
||||
import Testing
|
||||
import TestSupport
|
||||
|
||||
@Suite("FileClientTests")
|
||||
struct FileClientTests {
|
||||
|
||||
@Test
|
||||
func createDirectory() async throws {
|
||||
try await withTemporaryDirectory { url in
|
||||
let fileClient = FileClient.liveValue
|
||||
let tempDir = url.appending(path: "temp")
|
||||
try await fileClient.createDirectory(tempDir)
|
||||
let isDirectory = try await fileClient.isDirectory(tempDir)
|
||||
#expect(isDirectory)
|
||||
}
|
||||
}
|
||||
|
||||
@Test(arguments: ["vault.yml", "vault.yaml"])
|
||||
func findVaultFile(fileName: String) async throws {
|
||||
try await withTemporaryDirectory { url in
|
||||
let fileClient = FileClient.liveValue
|
||||
|
||||
let vaultFilePath = url.appending(path: fileName)
|
||||
FileManager.default.createFile(atPath: vaultFilePath.cleanFilePath, contents: nil)
|
||||
let output = try await fileClient.findVaultFile(url)!
|
||||
|
||||
#expect(output.cleanFilePath == vaultFilePath.cleanFilePath)
|
||||
|
||||
let nilWhenFileNotDirectory = try await fileClient.findVaultFile(vaultFilePath)
|
||||
#expect(nilWhenFileNotDirectory == nil)
|
||||
}
|
||||
}
|
||||
|
||||
@Test(arguments: ["vault.yml", "vault.yaml"])
|
||||
func findVaultFileNestedInSubfolder(fileName: String) async throws {
|
||||
try await withTemporaryDirectory { url in
|
||||
|
||||
let fileClient = FileClient.liveValue
|
||||
let subDir = url.appending(path: "sub")
|
||||
|
||||
try await fileClient.createDirectory(subDir)
|
||||
|
||||
let vaultFilePath = subDir.appending(path: fileName)
|
||||
FileManager.default.createFile(atPath: vaultFilePath.cleanFilePath, contents: nil)
|
||||
let output = try await fileClient.findVaultFile(url)!
|
||||
|
||||
#expect(output.cleanFilePath == vaultFilePath.cleanFilePath)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
func findVaultFileReturnsNil() async throws {
|
||||
try await withTemporaryDirectory { url in
|
||||
|
||||
let fileClient = FileClient.liveValue
|
||||
let subDir = url.appending(path: "sub")
|
||||
|
||||
try await fileClient.createDirectory(subDir)
|
||||
|
||||
let output = try await fileClient.findVaultFile(url)
|
||||
|
||||
#expect(output == nil)
|
||||
}
|
||||
}
|
||||
}
|
||||
333
Tests/PandocClientTests/PandocClientTests.swift
Normal file
333
Tests/PandocClientTests/PandocClientTests.swift
Normal file
@@ -0,0 +1,333 @@
|
||||
@_spi(Internal) import ConfigurationClient
|
||||
@_spi(Internal) import PandocClient
|
||||
import PlaybookClient
|
||||
import Testing
|
||||
import TestSupport
|
||||
|
||||
@Suite("PandocClientTests")
|
||||
struct PandocClientTests: TestCase {
|
||||
|
||||
static let outputDirectory = "/output"
|
||||
static let projectDirectory = "/project"
|
||||
static let defaultFileName = "Report"
|
||||
|
||||
static let expectedIncludeInHeaders = [
|
||||
"--include-in-header=/project/.build/head.tex",
|
||||
"--include-in-header=/project/.build/footer.tex"
|
||||
]
|
||||
|
||||
static let expectedFiles = [
|
||||
"/project/.build/Report.md",
|
||||
"/project/.build/Definitions.md"
|
||||
]
|
||||
|
||||
static var sharedRunOptions: PandocClient.RunOptions {
|
||||
.init(
|
||||
buildDirectory: nil,
|
||||
files: nil,
|
||||
loggingOptions: loggingOptions,
|
||||
includeInHeader: nil,
|
||||
outputDirectory: outputDirectory,
|
||||
projectDirectory: projectDirectory,
|
||||
outputFileName: nil,
|
||||
quiet: false,
|
||||
shell: nil,
|
||||
shouldBuild: true
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
func generateLatex() async throws {
|
||||
try await withCapturingCommandClient("generateLatex") {
|
||||
$0.configurationClient = .mock()
|
||||
$0.playbookClient.run.buildProject = { _ in }
|
||||
$0.pandocClient = .liveValue
|
||||
} run: {
|
||||
@Dependency(\.pandocClient) var pandocClient
|
||||
|
||||
let output = try await pandocClient.run.generateLatex(Self.sharedRunOptions)
|
||||
#expect(output == "\(Self.outputDirectory)/\(Self.defaultFileName).tex")
|
||||
|
||||
} assert: { output in
|
||||
let expected = ["pandoc"]
|
||||
+ Self.expectedIncludeInHeaders
|
||||
+ ["--output=\(Self.outputDirectory)/\(Self.defaultFileName).tex"]
|
||||
+ Self.expectedFiles
|
||||
|
||||
#expect(output.arguments == expected)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
func generateHtml() async throws {
|
||||
try await withCapturingCommandClient("generateHtml") {
|
||||
$0.configurationClient = .mock()
|
||||
$0.playbookClient.run.buildProject = { _ in }
|
||||
$0.pandocClient = .liveValue
|
||||
} run: {
|
||||
@Dependency(\.pandocClient) var pandocClient
|
||||
|
||||
let output = try await pandocClient.run.generateHtml(Self.sharedRunOptions)
|
||||
#expect(output == "\(Self.outputDirectory)/\(Self.defaultFileName).html")
|
||||
|
||||
} assert: { output in
|
||||
let expected = ["pandoc"]
|
||||
+ Self.expectedIncludeInHeaders
|
||||
+ ["--output=\(Self.outputDirectory)/\(Self.defaultFileName).html"]
|
||||
+ Self.expectedFiles
|
||||
|
||||
#expect(output.arguments == expected)
|
||||
}
|
||||
}
|
||||
|
||||
@Test(
|
||||
arguments: [
|
||||
nil,
|
||||
"lualatex"
|
||||
]
|
||||
)
|
||||
func generatePdf(pdfEngine: String?) async throws {
|
||||
try await withCapturingCommandClient("generatePdf") {
|
||||
$0.configurationClient = .mock()
|
||||
$0.playbookClient.run.buildProject = { _ in }
|
||||
$0.pandocClient = .liveValue
|
||||
} run: {
|
||||
@Dependency(\.pandocClient) var pandocClient
|
||||
|
||||
let output = try await pandocClient.run.generatePdf(Self.sharedRunOptions, pdfEngine: pdfEngine)
|
||||
#expect(output == "\(Self.outputDirectory)/\(Self.defaultFileName).pdf")
|
||||
|
||||
} assert: { output in
|
||||
let expected = ["pandoc"]
|
||||
+ Self.expectedIncludeInHeaders
|
||||
+ ["--pdf-engine=\(pdfEngine ?? "xelatex")"]
|
||||
+ ["--output=\(Self.outputDirectory)/\(Self.defaultFileName).pdf"]
|
||||
+ Self.expectedFiles
|
||||
|
||||
#expect(output.arguments == expected)
|
||||
}
|
||||
}
|
||||
|
||||
@Test(arguments: TestPdfEngine.testCases)
|
||||
func parsePdfEngine(input: TestPdfEngine) {
|
||||
#expect(input.engine == input.expectedEngine)
|
||||
}
|
||||
|
||||
@Test(arguments: TestParseFiles.testCases)
|
||||
func parseFiles(input: TestParseFiles) {
|
||||
#expect(input.parsedFiles == input.expectedFiles)
|
||||
}
|
||||
|
||||
@Test(arguments: TestParseIncludeInHeaderFiles.testCases)
|
||||
func parseInclueInHeaderFiles(input: TestParseIncludeInHeaderFiles) {
|
||||
#expect(input.parsedFiles == input.expectedHeaderFiles)
|
||||
}
|
||||
|
||||
@Test(arguments: TestParseOutputFileName.testCases)
|
||||
func parseOutputFileName(input: TestParseOutputFileName) {
|
||||
#expect(input.parsedFileName == input.expected)
|
||||
}
|
||||
|
||||
@Test(arguments: TestParseBuildDirectory.testCases)
|
||||
func parseBuildDirectory(input: TestParseBuildDirectory) {
|
||||
#expect(input.parsedBuildDirectory == input.expected)
|
||||
}
|
||||
}
|
||||
|
||||
struct TestPdfEngine: Sendable {
|
||||
let fileType: PandocClient.FileType
|
||||
let expectedEngine: String?
|
||||
let configuration: Configuration
|
||||
let defaults: Configuration.Generate
|
||||
|
||||
var engine: String? {
|
||||
fileType.parsePdfEngine(configuration.generate, defaults)
|
||||
}
|
||||
|
||||
static let testCases: [Self] = [
|
||||
.init(fileType: .html, expectedEngine: nil, configuration: .init(), defaults: .default),
|
||||
.init(fileType: .latex, expectedEngine: nil, configuration: .init(), defaults: .default),
|
||||
.init(fileType: .pdf(engine: "lualatex"), expectedEngine: "lualatex", configuration: .init(), defaults: .default),
|
||||
.init(fileType: .pdf(engine: nil), expectedEngine: "xelatex", configuration: .init(), defaults: .default),
|
||||
.init(fileType: .pdf(engine: nil), expectedEngine: "xelatex", configuration: .init(), defaults: .init()),
|
||||
.init(fileType: .pdf(engine: nil), expectedEngine: "xelatex", configuration: .init(generate: .default), defaults: .init())
|
||||
]
|
||||
}
|
||||
|
||||
struct TestParseFiles: Sendable {
|
||||
|
||||
let expectedFiles: [String]
|
||||
let configuration: Configuration
|
||||
let defaults: Configuration.Generate
|
||||
let runOptions: PandocClient.RunOptions?
|
||||
|
||||
init(
|
||||
expectedFiles: [String],
|
||||
configuration: Configuration = .init(),
|
||||
defaults: Configuration.Generate = .default,
|
||||
runOptions: PandocClient.RunOptions? = nil
|
||||
) {
|
||||
self.expectedFiles = expectedFiles
|
||||
self.configuration = configuration
|
||||
self.defaults = defaults
|
||||
self.runOptions = runOptions
|
||||
}
|
||||
|
||||
var parsedFiles: [String] {
|
||||
let runOptions = self.runOptions ?? PandocClient.RunOptions(
|
||||
loggingOptions: .init(commandName: "parseFiles", logLevel: .debug),
|
||||
projectDirectory: nil,
|
||||
quiet: true,
|
||||
shouldBuild: false
|
||||
)
|
||||
|
||||
return runOptions.parseFiles(configuration.generate, defaults)
|
||||
}
|
||||
|
||||
static let testCases: [Self] = [
|
||||
.init(expectedFiles: ["Report.md", "Definitions.md"]),
|
||||
.init(expectedFiles: ["Report.md", "Definitions.md"], configuration: .init(generate: .default), defaults: .init()),
|
||||
.init(expectedFiles: [], defaults: .init()),
|
||||
.init(
|
||||
expectedFiles: ["custom.md"],
|
||||
configuration: .init(),
|
||||
defaults: .init(),
|
||||
runOptions: .init(
|
||||
files: ["custom.md"],
|
||||
loggingOptions: .init(commandName: "parseFiles", logLevel: .debug),
|
||||
projectDirectory: nil,
|
||||
quiet: true,
|
||||
shouldBuild: false
|
||||
)
|
||||
)
|
||||
]
|
||||
}
|
||||
|
||||
struct TestParseIncludeInHeaderFiles: Sendable {
|
||||
|
||||
let expectedHeaderFiles: [String]
|
||||
let configuration: Configuration
|
||||
let defaults: Configuration.Generate
|
||||
let runOptions: PandocClient.RunOptions?
|
||||
|
||||
init(
|
||||
expectedHeaderFiles: [String],
|
||||
configuration: Configuration = .init(),
|
||||
defaults: Configuration.Generate = .default,
|
||||
runOptions: PandocClient.RunOptions? = nil
|
||||
) {
|
||||
self.expectedHeaderFiles = expectedHeaderFiles
|
||||
self.configuration = configuration
|
||||
self.defaults = defaults
|
||||
self.runOptions = runOptions
|
||||
}
|
||||
|
||||
var parsedFiles: [String] {
|
||||
let runOptions = self.runOptions ?? PandocClient.RunOptions(
|
||||
loggingOptions: .init(commandName: "parseFiles", logLevel: .debug)
|
||||
)
|
||||
|
||||
return runOptions.parseIncludeInHeader(configuration.generate, defaults)
|
||||
}
|
||||
|
||||
static let testCases: [Self] = [
|
||||
.init(expectedHeaderFiles: ["head.tex", "footer.tex"]),
|
||||
.init(expectedHeaderFiles: ["head.tex", "footer.tex"], configuration: .init(generate: .default), defaults: .init()),
|
||||
.init(expectedHeaderFiles: [], defaults: .init()),
|
||||
.init(
|
||||
expectedHeaderFiles: ["custom.tex"],
|
||||
configuration: .init(),
|
||||
defaults: .init(),
|
||||
runOptions: .init(
|
||||
loggingOptions: .init(commandName: "parseFiles", logLevel: .debug),
|
||||
includeInHeader: ["custom.tex"]
|
||||
)
|
||||
)
|
||||
]
|
||||
}
|
||||
|
||||
struct TestParseOutputFileName: Sendable {
|
||||
|
||||
let expected: String
|
||||
let configuration: Configuration
|
||||
let defaults: Configuration.Generate
|
||||
let runOptions: PandocClient.RunOptions?
|
||||
|
||||
init(
|
||||
expected: String,
|
||||
configuration: Configuration = .init(),
|
||||
defaults: Configuration.Generate = .default,
|
||||
runOptions: PandocClient.RunOptions? = nil
|
||||
) {
|
||||
self.expected = expected
|
||||
self.configuration = configuration
|
||||
self.defaults = defaults
|
||||
self.runOptions = runOptions
|
||||
}
|
||||
|
||||
var parsedFileName: String {
|
||||
let runOptions = self.runOptions ?? PandocClient.RunOptions(
|
||||
loggingOptions: .init(commandName: "parseFiles", logLevel: .debug)
|
||||
)
|
||||
|
||||
return runOptions.parseOutputFileName(configuration.generate, defaults)
|
||||
}
|
||||
|
||||
static let testCases: [Self] = [
|
||||
.init(expected: "Report"),
|
||||
.init(expected: "Report", configuration: .init(generate: .default), defaults: .init()),
|
||||
.init(expected: "Report", defaults: .init()),
|
||||
.init(
|
||||
expected: "custom",
|
||||
configuration: .init(),
|
||||
defaults: .init(),
|
||||
runOptions: .init(
|
||||
loggingOptions: .init(commandName: "parseFiles", logLevel: .debug),
|
||||
outputFileName: "custom"
|
||||
)
|
||||
)
|
||||
]
|
||||
}
|
||||
|
||||
struct TestParseBuildDirectory: Sendable {
|
||||
|
||||
let expected: String
|
||||
let configuration: Configuration
|
||||
let defaults: Configuration.Generate
|
||||
let runOptions: PandocClient.RunOptions?
|
||||
|
||||
init(
|
||||
expected: String = ".build",
|
||||
configuration: Configuration = .init(),
|
||||
defaults: Configuration.Generate = .default,
|
||||
runOptions: PandocClient.RunOptions? = nil
|
||||
) {
|
||||
self.expected = expected
|
||||
self.configuration = configuration
|
||||
self.defaults = defaults
|
||||
self.runOptions = runOptions
|
||||
}
|
||||
|
||||
var parsedBuildDirectory: String {
|
||||
let runOptions = self.runOptions ?? PandocClient.RunOptions(
|
||||
loggingOptions: .init(commandName: "parseFiles", logLevel: .debug)
|
||||
)
|
||||
|
||||
return runOptions.parseBuildDirectory(configuration.generate, defaults)
|
||||
}
|
||||
|
||||
static let testCases: [Self] = [
|
||||
.init(),
|
||||
.init(configuration: .init(generate: .default), defaults: .init()),
|
||||
.init(defaults: .init()),
|
||||
.init(
|
||||
expected: "custom",
|
||||
configuration: .init(),
|
||||
defaults: .init(),
|
||||
runOptions: .init(
|
||||
buildDirectory: "custom",
|
||||
loggingOptions: .init(commandName: "parseFiles", logLevel: .debug)
|
||||
)
|
||||
)
|
||||
]
|
||||
}
|
||||
308
Tests/PlaybookClientTests/PlaybookClientTests.swift
Normal file
308
Tests/PlaybookClientTests/PlaybookClientTests.swift
Normal file
@@ -0,0 +1,308 @@
|
||||
import CodersClient
|
||||
@_spi(Internal) import CommandClient
|
||||
@_spi(Internal) import ConfigurationClient
|
||||
import Dependencies
|
||||
import FileClient
|
||||
import Foundation
|
||||
@_spi(Internal) import PlaybookClient
|
||||
import ShellClient
|
||||
import Testing
|
||||
import TestSupport
|
||||
|
||||
@Suite("PlaybookClientTests")
|
||||
struct PlaybookClientTests: TestCase {
|
||||
|
||||
static var sharedRunOptions: PlaybookClient.RunPlaybook.SharedRunOptions {
|
||||
.init(loggingOptions: loggingOptions)
|
||||
}
|
||||
|
||||
static let defaultPlaybookPath = "~/.local/share/hpa/playbook/main.yml"
|
||||
static let defaultInventoryPath = "~/.local/share/hpa/playbook/inventory.ini"
|
||||
static let mockVaultArg = Configuration.mock.vault.args![0]
|
||||
|
||||
@Test(.tags(.repository))
|
||||
func repositoryInstallation() async throws {
|
||||
try await withTestLogger(key: "repositoryInstallation") {
|
||||
$0.fileClient = .liveValue
|
||||
$0.asyncShellClient = .liveValue
|
||||
$0.commandClient = .liveValue
|
||||
} operation: {
|
||||
try await withTemporaryDirectory { tempDirectory in
|
||||
@Dependency(\.fileClient) var fileClient
|
||||
@Dependency(\.logger) var logger
|
||||
let pathUrl = tempDirectory.appending(path: "playbook")
|
||||
let playbookClient = PlaybookClient.liveValue
|
||||
|
||||
let configuration = Configuration(playbook: .init(directory: pathUrl.cleanFilePath))
|
||||
|
||||
try? FileManager.default.removeItem(at: pathUrl)
|
||||
try await playbookClient.repository.install(configuration)
|
||||
logger.debug("Done cloning playbook")
|
||||
let exists = try await fileClient.isDirectory(pathUrl)
|
||||
#expect(exists)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test(
|
||||
.tags(.repository),
|
||||
arguments: [
|
||||
(Configuration(), PlaybookClient.Constants.defaultInstallationPath),
|
||||
(Configuration(playbook: .init(directory: "playbook")), "playbook")
|
||||
]
|
||||
)
|
||||
func repositoryDirectory(configuration: Configuration, expected: String) async throws {
|
||||
let client = PlaybookClient.liveValue
|
||||
let result = try await client.repository.directory(configuration)
|
||||
#expect(result == expected)
|
||||
}
|
||||
|
||||
@Test(.tags(.run))
|
||||
func runBuildProject() async throws {
|
||||
let captured = CommandClient.CapturingClient()
|
||||
|
||||
try await withMockConfiguration(captured, key: "runBuildProject") {
|
||||
@Dependency(\.playbookClient) var playbookClient
|
||||
|
||||
try await playbookClient.run.buildProject(.init(projectDirectory: "/foo", shared: Self.sharedRunOptions))
|
||||
|
||||
let arguments = await captured.options!.arguments
|
||||
print(arguments)
|
||||
|
||||
#expect(arguments == [
|
||||
"ansible-playbook", Self.defaultPlaybookPath,
|
||||
"--inventory", Self.defaultInventoryPath,
|
||||
Self.mockVaultArg,
|
||||
"--tags", "build-project",
|
||||
"--extra-vars", "project_dir=/foo"
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
@Test(
|
||||
.tags(.run),
|
||||
arguments: [
|
||||
(true, "\'{\"template\":{\"path\":\"\(Configuration.mock.template.directory!)\"}}\'"),
|
||||
(false, "\'{\"template\":{\"repo\":{\"url\":\"\(Configuration.mock.template.url!)\",\"version\":\"\(Configuration.mock.template.version!)\"}}}\'")
|
||||
]
|
||||
)
|
||||
func runCreateProject(useLocalTemplateDirectory: Bool, json: String) async throws {
|
||||
let captured = CommandClient.CapturingClient()
|
||||
|
||||
try await withMockConfiguration(captured, key: "runBuildProject") {
|
||||
@Dependency(\.logger) var logger
|
||||
@Dependency(\.playbookClient) var playbookClient
|
||||
|
||||
try await playbookClient.run.createProject(
|
||||
.init(
|
||||
projectDirectory: "/project",
|
||||
shared: Self.sharedRunOptions,
|
||||
useLocalTemplateDirectory: useLocalTemplateDirectory
|
||||
)
|
||||
)
|
||||
|
||||
let arguments = await captured.options!.arguments
|
||||
logger.debug("\(arguments)")
|
||||
|
||||
#expect(arguments == [
|
||||
"ansible-playbook", Self.defaultPlaybookPath,
|
||||
"--inventory", Self.defaultInventoryPath,
|
||||
Self.mockVaultArg,
|
||||
"--tags", "setup-project",
|
||||
"--extra-vars", "project_dir=/project",
|
||||
"--extra-vars", json
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
@Test(arguments: CreateJsonTestOption.testCases)
|
||||
func createJson(input: CreateJsonTestOption) {
|
||||
withTestLogger(key: "generateJson") {
|
||||
$0.coders.jsonEncoder = { jsonEncoder }
|
||||
$0.configurationClient = .mock(input.configuration)
|
||||
} operation: {
|
||||
@Dependency(\.coders) var coders
|
||||
|
||||
let jsonData = try? input.options.createJSONData(
|
||||
configuration: input.configuration,
|
||||
encoder: coders.jsonEncoder()
|
||||
)
|
||||
|
||||
switch input.expectation {
|
||||
case let .success(expected):
|
||||
let json = String(data: jsonData!, encoding: .utf8)!
|
||||
if json != expected {
|
||||
print("json:", json)
|
||||
print("expected:", expected)
|
||||
}
|
||||
#expect(json == expected)
|
||||
case .failure:
|
||||
#expect(jsonData == nil)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
func generateTemplate() async throws {
|
||||
try await withCapturingCommandClient("generateTemplate") {
|
||||
$0.configurationClient = .mock()
|
||||
$0.playbookClient = .liveValue
|
||||
} run: {
|
||||
@Dependency(\.playbookClient) var playbookClient
|
||||
|
||||
let output = try await playbookClient.run.generateTemplate(.init(
|
||||
shared: Self.sharedRunOptions,
|
||||
templateDirectory: "/template"
|
||||
))
|
||||
|
||||
#expect(output == "/template")
|
||||
|
||||
} assert: { output in
|
||||
|
||||
let expected = [
|
||||
"ansible-playbook", Self.defaultPlaybookPath,
|
||||
"--inventory", Self.defaultInventoryPath,
|
||||
Self.mockVaultArg,
|
||||
"--tags", "repo-template",
|
||||
"--extra-vars", "output_dir=/template"
|
||||
]
|
||||
|
||||
#expect(output.arguments == expected)
|
||||
}
|
||||
}
|
||||
|
||||
func withMockConfiguration(
|
||||
_ capturing: CommandClient.CapturingClient,
|
||||
configuration: Configuration = .mock,
|
||||
key: String,
|
||||
logLevel: Logger.Level = .trace,
|
||||
depednencies setupDependencies: @escaping (inout DependencyValues) -> Void = { _ in },
|
||||
operation: @Sendable @escaping () async throws -> Void
|
||||
) async rethrows {
|
||||
try await withDependencies {
|
||||
$0.configurationClient = .mock(configuration)
|
||||
$0.commandClient = .capturing(capturing)
|
||||
$0.playbookClient = .liveValue
|
||||
setupDependencies(&$0)
|
||||
} operation: {
|
||||
try await operation()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
struct CreateJsonTestOption: Sendable {
|
||||
let options: PlaybookClient.RunPlaybook.CreateOptions
|
||||
let configuration: Configuration
|
||||
let expectation: Result<String, TestError>
|
||||
|
||||
static let testCases: [Self] = [
|
||||
CreateJsonTestOption(
|
||||
options: .init(
|
||||
projectDirectory: "/project",
|
||||
shared: PlaybookClientTests.sharedRunOptions,
|
||||
template: .init(url: nil, version: nil, directory: nil),
|
||||
useLocalTemplateDirectory: true
|
||||
),
|
||||
configuration: .init(),
|
||||
expectation: .failing
|
||||
),
|
||||
CreateJsonTestOption(
|
||||
options: .init(
|
||||
projectDirectory: "/project",
|
||||
shared: PlaybookClientTests.sharedRunOptions,
|
||||
template: .init(url: nil, version: nil, directory: nil),
|
||||
useLocalTemplateDirectory: false
|
||||
),
|
||||
configuration: .init(),
|
||||
expectation: .failing
|
||||
),
|
||||
CreateJsonTestOption(
|
||||
options: .init(
|
||||
projectDirectory: "/project",
|
||||
shared: PlaybookClientTests.sharedRunOptions,
|
||||
template: .init(url: nil, version: nil, directory: "/template"),
|
||||
useLocalTemplateDirectory: true
|
||||
),
|
||||
configuration: .init(template: .init(directory: "/template")),
|
||||
expectation: .success("""
|
||||
{
|
||||
"template" : {
|
||||
"path" : "/template"
|
||||
}
|
||||
}
|
||||
""")
|
||||
),
|
||||
CreateJsonTestOption(
|
||||
options: .init(
|
||||
projectDirectory: "/project",
|
||||
shared: PlaybookClientTests.sharedRunOptions,
|
||||
template: .init(url: nil, version: nil, directory: "/template"),
|
||||
useLocalTemplateDirectory: true
|
||||
),
|
||||
configuration: .init(template: .init(directory: "/template")),
|
||||
expectation: .success("""
|
||||
{
|
||||
"template" : {
|
||||
"path" : "/template"
|
||||
}
|
||||
}
|
||||
""")
|
||||
),
|
||||
CreateJsonTestOption(
|
||||
options: .init(
|
||||
projectDirectory: "/project",
|
||||
shared: PlaybookClientTests.sharedRunOptions,
|
||||
template: .init(url: "https://git.example.com/template.git", version: "main", directory: nil),
|
||||
useLocalTemplateDirectory: false
|
||||
),
|
||||
configuration: .init(),
|
||||
expectation: .success("""
|
||||
{
|
||||
"template" : {
|
||||
"repo" : {
|
||||
"url" : "https://git.example.com/template.git",
|
||||
"version" : "main"
|
||||
}
|
||||
}
|
||||
}
|
||||
""")
|
||||
),
|
||||
CreateJsonTestOption(
|
||||
options: .init(
|
||||
projectDirectory: "/project",
|
||||
shared: PlaybookClientTests.sharedRunOptions,
|
||||
template: .init(url: "https://git.example.com/template.git", version: "v0.1.0", directory: nil),
|
||||
useLocalTemplateDirectory: false
|
||||
),
|
||||
configuration: .init(template: .init(url: "https://git.example.com/template.git", version: "v0.1.0")),
|
||||
expectation: .success("""
|
||||
{
|
||||
"template" : {
|
||||
"repo" : {
|
||||
"url" : "https://git.example.com/template.git",
|
||||
"version" : "v0.1.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
""")
|
||||
)
|
||||
]
|
||||
}
|
||||
|
||||
extension Result where Failure == TestError {
|
||||
static var failing: Self { .failure(TestError()) }
|
||||
}
|
||||
|
||||
struct TestError: Error {}
|
||||
|
||||
extension Tag {
|
||||
@Tag static var repository: Self
|
||||
@Tag static var run: Self
|
||||
}
|
||||
|
||||
let jsonEncoder: JSONEncoder = {
|
||||
let encoder = JSONEncoder()
|
||||
encoder.outputFormatting = [.prettyPrinted, .withoutEscapingSlashes, .sortedKeys]
|
||||
return encoder
|
||||
}()
|
||||
129
Tests/VaultClientTests/VaultClientTests.swift
Normal file
129
Tests/VaultClientTests/VaultClientTests.swift
Normal file
@@ -0,0 +1,129 @@
|
||||
@_spi(Internal) import ConfigurationClient
|
||||
import FileClient
|
||||
import Foundation
|
||||
import Testing
|
||||
import TestSupport
|
||||
@_spi(Internal) import VaultClient
|
||||
|
||||
@Suite("VaultClientTests")
|
||||
struct VaultClientTests: TestCase {
|
||||
|
||||
@Test(
|
||||
arguments: TestOptions.testCases
|
||||
)
|
||||
func decrypt(input: TestOptions) async throws {
|
||||
try await withCapturingCommandClient("decrypt") {
|
||||
$0.configurationClient = .mock(input.configuration)
|
||||
$0.fileClient.findVaultFile = { _ in URL(filePath: "/vault.yml") }
|
||||
$0.vaultClient = .liveValue
|
||||
} run: {
|
||||
@Dependency(\.vaultClient) var vaultClient
|
||||
|
||||
let output = try await vaultClient.run.decrypt(.init(
|
||||
extraOptions: input.extraOptions,
|
||||
loggingOptions: Self.loggingOptions,
|
||||
outputFilePath: input.outputFilePath,
|
||||
vaultFilePath: input.vaultFilePath
|
||||
))
|
||||
|
||||
if let outputFilePath = input.outputFilePath {
|
||||
#expect(output == outputFilePath)
|
||||
} else if let vaultFilePath = input.vaultFilePath {
|
||||
#expect(output == vaultFilePath)
|
||||
} else {
|
||||
#expect(output == "/vault.yml")
|
||||
}
|
||||
} assert: { options in
|
||||
|
||||
#expect(options.arguments == input.expected(.decrypt))
|
||||
}
|
||||
}
|
||||
|
||||
@Test(
|
||||
arguments: TestOptions.testCases
|
||||
)
|
||||
func encrypt(input: TestOptions) async throws {
|
||||
try await withCapturingCommandClient("decrypt") {
|
||||
$0.configurationClient = .mock(input.configuration)
|
||||
$0.fileClient.findVaultFile = { _ in URL(filePath: "/vault.yml") }
|
||||
$0.vaultClient = .liveValue
|
||||
} run: {
|
||||
@Dependency(\.vaultClient) var vaultClient
|
||||
|
||||
let output = try await vaultClient.run.encrypt(.init(
|
||||
extraOptions: input.extraOptions,
|
||||
loggingOptions: Self.loggingOptions,
|
||||
outputFilePath: input.outputFilePath,
|
||||
vaultFilePath: input.vaultFilePath
|
||||
))
|
||||
|
||||
if let outputFilePath = input.outputFilePath {
|
||||
#expect(output == outputFilePath)
|
||||
} else if let vaultFilePath = input.vaultFilePath {
|
||||
#expect(output == vaultFilePath)
|
||||
} else {
|
||||
#expect(output == "/vault.yml")
|
||||
}
|
||||
|
||||
} assert: { options in
|
||||
#expect(options.arguments == input.expected(.encrypt))
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
struct TestOptions: Sendable {
|
||||
let configuration: Configuration
|
||||
let extraOptions: [String]?
|
||||
let outputFilePath: String?
|
||||
let vaultFilePath: String?
|
||||
|
||||
init(
|
||||
configuration: Configuration = .init(),
|
||||
extraOptions: [String]? = nil,
|
||||
outputFilePath: String? = nil,
|
||||
vaultFilePath: String? = nil
|
||||
) {
|
||||
self.configuration = configuration
|
||||
self.extraOptions = extraOptions
|
||||
self.outputFilePath = outputFilePath
|
||||
self.vaultFilePath = vaultFilePath
|
||||
}
|
||||
|
||||
func expected(_ route: VaultClient.Route) -> [String] {
|
||||
var expected = [
|
||||
"ansible-vault", "\(route.verb)"
|
||||
]
|
||||
|
||||
if let outputFilePath {
|
||||
expected.append(contentsOf: ["--output", outputFilePath])
|
||||
}
|
||||
|
||||
if let extraOptions {
|
||||
expected.append(contentsOf: extraOptions)
|
||||
}
|
||||
|
||||
if let vaultArgs = configuration.vault.args {
|
||||
expected.append(contentsOf: vaultArgs)
|
||||
}
|
||||
|
||||
if route == .encrypt,
|
||||
let id = configuration.vault.encryptId
|
||||
{
|
||||
expected.append(contentsOf: ["--encrypt-vault-id", id])
|
||||
}
|
||||
|
||||
expected.append(vaultFilePath ?? "/vault.yml")
|
||||
|
||||
return expected
|
||||
}
|
||||
|
||||
static let testCases: [Self] = [
|
||||
TestOptions(vaultFilePath: "/vault.yml"),
|
||||
TestOptions(extraOptions: ["--verbose"]),
|
||||
TestOptions(configuration: .mock),
|
||||
TestOptions(outputFilePath: "/output.yml")
|
||||
]
|
||||
}
|
||||
|
||||
struct TestError: Error {}
|
||||
Reference in New Issue
Block a user