Skip to content

Commit

Permalink
refactor: Rename FeaturevisorTestRunner to FeaturevisorCLI (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
polok authored Jul 10, 2024
1 parent b01775d commit 1888530
Show file tree
Hide file tree
Showing 20 changed files with 19 additions and 19 deletions.
8 changes: 4 additions & 4 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ let package = Package(
targets: ["FeaturevisorTypes"]
),
.executable(
name: "FeaturevisorSwiftTestRunner",
targets: ["FeaturevisorTestRunner"]
name: "FeaturevisorCLI",
targets: ["FeaturevisorCLI"]
),
],
dependencies: [
Expand All @@ -43,7 +43,7 @@ let package = Package(
]
),
.executableTarget(
name: "FeaturevisorTestRunner",
name: "FeaturevisorCLI",
dependencies: [
"FeaturevisorSDK",
"FeaturevisorTypes",
Expand All @@ -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",
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"}' \
Expand All @@ -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"}' \
Expand All @@ -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 \
Expand All @@ -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"}' \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import FeaturevisorSDK
import FeaturevisorTypes
import Foundation

extension FeaturevisorTestRunner.Benchmark {
extension FeaturevisorCLI.Benchmark {

func benchmarkFeature(options: Options) {

Expand Down Expand Up @@ -76,7 +76,7 @@ extension FeaturevisorTestRunner.Benchmark {
}
}

extension FeaturevisorTestRunner.Benchmark {
extension FeaturevisorCLI.Benchmark {

func benchmarkFeatureFlag(
_ f: FeaturevisorInstance,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import FeaturevisorSDK
import FeaturevisorTypes
import Foundation

extension FeaturevisorTestRunner.Evaluate {
extension FeaturevisorCLI.Evaluate {

func evaluateFeature(options: Options) {

Expand Down Expand Up @@ -88,7 +88,7 @@ extension FeaturevisorTestRunner.Evaluate {
}
}

extension FeaturevisorTestRunner.Evaluate {
extension FeaturevisorCLI.Evaluate {

fileprivate func printHeader(_ message: String) {
print("\n\n###############")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -95,7 +95,7 @@ extension FeaturevisorTestRunner {
}
}

extension FeaturevisorTestRunner {
extension FeaturevisorCLI {

struct Evaluate: ParsableCommand {

Expand Down Expand Up @@ -152,7 +152,7 @@ extension FeaturevisorTestRunner {
}
}

extension FeaturevisorTestRunner {
extension FeaturevisorCLI {

struct Test: ParsableCommand {

Expand Down Expand Up @@ -402,7 +402,7 @@ extension FeaturevisorTestRunner {
}
}

extension FeaturevisorTestRunner.Test {
extension FeaturevisorCLI.Test {

func loadAllFeatures(featuresTestDirectoryPath: String) throws -> [Feature] {

Expand Down

0 comments on commit 1888530

Please sign in to comment.