diff --git a/Package.swift b/Package.swift index a5e4032..bbdaa4f 100644 --- a/Package.swift +++ b/Package.swift @@ -17,8 +17,8 @@ let package = Package( targets: ["FeaturevisorTypes"] ), .executable( - name: "FeaturevisorSwiftTestRunner", - targets: ["FeaturevisorTestRunner"] + name: "FeaturevisorCLI", + targets: ["FeaturevisorCLI"] ), ], dependencies: [ @@ -43,7 +43,7 @@ let package = Package( ] ), .executableTarget( - name: "FeaturevisorTestRunner", + name: "FeaturevisorCLI", dependencies: [ "FeaturevisorSDK", "FeaturevisorTypes", @@ -52,7 +52,7 @@ let package = Package( .product(name: "Commands", package: "swift-commands"), .product(name: "ArgumentParser", package: "swift-argument-parser") ], - path: "Sources/FeaturevisorTestRunner" + path: "Sources/FeaturevisorCLI" ), .testTarget( name: "FeaturevisorSDKTests", diff --git a/README.md b/README.md index eaff4c7..c9403a0 100644 --- a/README.md +++ b/README.md @@ -343,7 +343,7 @@ $ cp -f FeaturevisorSwiftTestRunner /usr/local/bin/featurevisor-swift-test-runne Now you can usage like below: ``` $ cd path/to/featurevisor-project-with-yamls -$ featurevisor-swift-test-runner test . +$ featurevisor-swift-cli test . ``` ### Benchmarking @@ -355,7 +355,7 @@ The `--n` option is used to specify the number of iterations to run the benchmar To benchmark evaluating a feature itself if it is enabled or disabled via SDK's `.isEnabled()` method: ```bash - FeaturevisorTestRunner benchmark \ + featurevisor-swift-cli benchmark \ --environment staging \ --feature feature_key \ --context '{"user_id":"123"}' \ @@ -366,7 +366,7 @@ To benchmark evaluating a feature itself if it is enabled or disabled via SDK's To benchmark evaluating a feature's variation via SDKs's `.getVariation()` method: ```bash - FeaturevisorTestRunner benchmark \ + featurevisor-swift-cli benchmark \ --environment staging \ --feature feature_key \ --context '{"user_id":"123"}' \ @@ -378,7 +378,7 @@ To benchmark evaluating a feature's variation via SDKs's `.getVariation()` metho To benchmark evaluating a feature's variable via SDKs's `.getVariable()` method: ```bash - FeaturevisorTestRunner benchmark \ + featurevisor-swift-cli benchmark \ --environment staging \ --feature feature_key \ --variable variable_key \ @@ -390,7 +390,7 @@ To benchmark evaluating a feature's variable via SDKs's `.getVariable()` method: To learn why certain values (like feature and its variation or variables) are evaluated as they are against provided [context](https://featurevisor.com/docs/sdks/javascript/#context): ```bash - FeaturevisorTestRunner evaluate \ + featurevisor-swift-cli evaluate \ --environment staging \ --feature feature_key \ --context '{"user_id":"123"}' \ diff --git a/Sources/FeaturevisorTestRunner/Extensions/Evaluation+CustomStringConvertible.swift b/Sources/FeaturevisorCLI/Extensions/Evaluation+CustomStringConvertible.swift similarity index 100% rename from Sources/FeaturevisorTestRunner/Extensions/Evaluation+CustomStringConvertible.swift rename to Sources/FeaturevisorCLI/Extensions/Evaluation+CustomStringConvertible.swift diff --git a/Sources/FeaturevisorTestRunner/Extensions/TimeInterval+Init.swift b/Sources/FeaturevisorCLI/Extensions/TimeInterval+Init.swift similarity index 100% rename from Sources/FeaturevisorTestRunner/Extensions/TimeInterval+Init.swift rename to Sources/FeaturevisorCLI/Extensions/TimeInterval+Init.swift diff --git a/Sources/FeaturevisorTestRunner/Extensions/UInt64+Time.swift b/Sources/FeaturevisorCLI/Extensions/UInt64+Time.swift similarity index 100% rename from Sources/FeaturevisorTestRunner/Extensions/UInt64+Time.swift rename to Sources/FeaturevisorCLI/Extensions/UInt64+Time.swift diff --git a/Sources/FeaturevisorTestRunner/FeaturevisorTestRunner+Benchmark.swift b/Sources/FeaturevisorCLI/FeaturevisorCLI+Benchmark.swift similarity index 97% rename from Sources/FeaturevisorTestRunner/FeaturevisorTestRunner+Benchmark.swift rename to Sources/FeaturevisorCLI/FeaturevisorCLI+Benchmark.swift index dce2741..004f9e9 100644 --- a/Sources/FeaturevisorTestRunner/FeaturevisorTestRunner+Benchmark.swift +++ b/Sources/FeaturevisorCLI/FeaturevisorCLI+Benchmark.swift @@ -3,7 +3,7 @@ import FeaturevisorSDK import FeaturevisorTypes import Foundation -extension FeaturevisorTestRunner.Benchmark { +extension FeaturevisorCLI.Benchmark { func benchmarkFeature(options: Options) { @@ -76,7 +76,7 @@ extension FeaturevisorTestRunner.Benchmark { } } -extension FeaturevisorTestRunner.Benchmark { +extension FeaturevisorCLI.Benchmark { func benchmarkFeatureFlag( _ f: FeaturevisorInstance, diff --git a/Sources/FeaturevisorTestRunner/FeaturevisorTestRunner+Evaluate.swift b/Sources/FeaturevisorCLI/FeaturevisorCLI+Evaluate.swift similarity index 97% rename from Sources/FeaturevisorTestRunner/FeaturevisorTestRunner+Evaluate.swift rename to Sources/FeaturevisorCLI/FeaturevisorCLI+Evaluate.swift index a5f5b68..7a862c8 100644 --- a/Sources/FeaturevisorTestRunner/FeaturevisorTestRunner+Evaluate.swift +++ b/Sources/FeaturevisorCLI/FeaturevisorCLI+Evaluate.swift @@ -3,7 +3,7 @@ import FeaturevisorSDK import FeaturevisorTypes import Foundation -extension FeaturevisorTestRunner.Evaluate { +extension FeaturevisorCLI.Evaluate { func evaluateFeature(options: Options) { @@ -88,7 +88,7 @@ extension FeaturevisorTestRunner.Evaluate { } } -extension FeaturevisorTestRunner.Evaluate { +extension FeaturevisorCLI.Evaluate { fileprivate func printHeader(_ message: String) { print("\n\n###############") diff --git a/Sources/FeaturevisorTestRunner/FeaturevisorTestRunner.swift b/Sources/FeaturevisorCLI/FeaturevisorCLI.swift similarity index 98% rename from Sources/FeaturevisorTestRunner/FeaturevisorTestRunner.swift rename to Sources/FeaturevisorCLI/FeaturevisorCLI.swift index b215666..f9eb81a 100644 --- a/Sources/FeaturevisorTestRunner/FeaturevisorTestRunner.swift +++ b/Sources/FeaturevisorCLI/FeaturevisorCLI.swift @@ -7,15 +7,15 @@ import Foundation import Yams @main -struct FeaturevisorTestRunner: ParsableCommand { +struct FeaturevisorCLI: ParsableCommand { static let configuration = CommandConfiguration( - abstract: "Featurevisor SDK utilities.", + abstract: "Featurevisor CLI.", subcommands: [Benchmark.self, Evaluate.self, Test.self] ) } -extension FeaturevisorTestRunner { +extension FeaturevisorCLI { struct Benchmark: ParsableCommand { @@ -95,7 +95,7 @@ extension FeaturevisorTestRunner { } } -extension FeaturevisorTestRunner { +extension FeaturevisorCLI { struct Evaluate: ParsableCommand { @@ -152,7 +152,7 @@ extension FeaturevisorTestRunner { } } -extension FeaturevisorTestRunner { +extension FeaturevisorCLI { struct Test: ParsableCommand { @@ -402,7 +402,7 @@ extension FeaturevisorTestRunner { } } -extension FeaturevisorTestRunner.Test { +extension FeaturevisorCLI.Test { func loadAllFeatures(featuresTestDirectoryPath: String) throws -> [Feature] { diff --git a/Sources/FeaturevisorTestRunner/Mappers/AssertionMapper.swift b/Sources/FeaturevisorCLI/Mappers/AssertionMapper.swift similarity index 100% rename from Sources/FeaturevisorTestRunner/Mappers/AssertionMapper.swift rename to Sources/FeaturevisorCLI/Mappers/AssertionMapper.swift diff --git a/Sources/FeaturevisorTestRunner/Mappers/VariableValueMapper.swift b/Sources/FeaturevisorCLI/Mappers/VariableValueMapper.swift similarity index 100% rename from Sources/FeaturevisorTestRunner/Mappers/VariableValueMapper.swift rename to Sources/FeaturevisorCLI/Mappers/VariableValueMapper.swift diff --git a/Sources/FeaturevisorTestRunner/Models/Assertion.swift b/Sources/FeaturevisorCLI/Models/Assertion.swift similarity index 100% rename from Sources/FeaturevisorTestRunner/Models/Assertion.swift rename to Sources/FeaturevisorCLI/Models/Assertion.swift diff --git a/Sources/FeaturevisorTestRunner/Models/Environment.swift b/Sources/FeaturevisorCLI/Models/Environment.swift similarity index 100% rename from Sources/FeaturevisorTestRunner/Models/Environment.swift rename to Sources/FeaturevisorCLI/Models/Environment.swift diff --git a/Sources/FeaturevisorTestRunner/Models/ExpectedVariableValue.swift b/Sources/FeaturevisorCLI/Models/ExpectedVariableValue.swift similarity index 100% rename from Sources/FeaturevisorTestRunner/Models/ExpectedVariableValue.swift rename to Sources/FeaturevisorCLI/Models/ExpectedVariableValue.swift diff --git a/Sources/FeaturevisorTestRunner/Models/Feature.swift b/Sources/FeaturevisorCLI/Models/Feature.swift similarity index 100% rename from Sources/FeaturevisorTestRunner/Models/Feature.swift rename to Sources/FeaturevisorCLI/Models/Feature.swift diff --git a/Sources/FeaturevisorTestRunner/Models/FeatureTestAssertionFile.swift b/Sources/FeaturevisorCLI/Models/FeatureTestAssertionFile.swift similarity index 100% rename from Sources/FeaturevisorTestRunner/Models/FeatureTestAssertionFile.swift rename to Sources/FeaturevisorCLI/Models/FeatureTestAssertionFile.swift diff --git a/Sources/FeaturevisorTestRunner/Models/FeatureTestSuitFile.swift b/Sources/FeaturevisorCLI/Models/FeatureTestSuitFile.swift similarity index 100% rename from Sources/FeaturevisorTestRunner/Models/FeatureTestSuitFile.swift rename to Sources/FeaturevisorCLI/Models/FeatureTestSuitFile.swift diff --git a/Sources/FeaturevisorTestRunner/Models/SDKProvider.swift b/Sources/FeaturevisorCLI/Models/SDKProvider.swift similarity index 100% rename from Sources/FeaturevisorTestRunner/Models/SDKProvider.swift rename to Sources/FeaturevisorCLI/Models/SDKProvider.swift diff --git a/Sources/FeaturevisorTestRunner/Utils/Combinations.swift b/Sources/FeaturevisorCLI/Utils/Combinations.swift similarity index 100% rename from Sources/FeaturevisorTestRunner/Utils/Combinations.swift rename to Sources/FeaturevisorCLI/Utils/Combinations.swift diff --git a/Sources/FeaturevisorTestRunner/Utils/FeatureResultOutputBuilder.swift b/Sources/FeaturevisorCLI/Utils/FeatureResultOutputBuilder.swift similarity index 100% rename from Sources/FeaturevisorTestRunner/Utils/FeatureResultOutputBuilder.swift rename to Sources/FeaturevisorCLI/Utils/FeatureResultOutputBuilder.swift diff --git a/Sources/FeaturevisorTestRunner/Utils/ShellExecutor.swift b/Sources/FeaturevisorCLI/Utils/ShellExecutor.swift similarity index 100% rename from Sources/FeaturevisorTestRunner/Utils/ShellExecutor.swift rename to Sources/FeaturevisorCLI/Utils/ShellExecutor.swift