Skip to content

Commit

Permalink
cmd/gemini: Seed command line parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
penberg committed Jul 30, 2018
1 parent eb293a7 commit 98c814e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/gemini/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,23 @@ package main

import (
"fmt"

"github.com/scylladb/gemini"
"github.com/spf13/cobra"
"math/rand"
)

var (
testClusterHost string
oracleClusterHost string
maxTests int
seed int
dropSchema bool
verbose bool
)

func run(cmd *cobra.Command, args []string) {
rand.Seed(int64(seed))
fmt.Printf("Seed: %d\n", seed)
fmt.Printf("Test cluster: %s\n", testClusterHost)
fmt.Printf("Oracle cluster: %s\n", oracleClusterHost)

Expand Down Expand Up @@ -115,6 +118,7 @@ func init() {
rootCmd.Flags().StringVarP(&oracleClusterHost, "oracle-cluster", "o", "", "Host name of the oracle cluster that provides correct answers")
rootCmd.MarkFlagRequired("oracle-cluster")
rootCmd.Flags().IntVarP(&maxTests, "max-tests", "m", 100, "Maximum number of test iterations to run")
rootCmd.Flags().IntVarP(&seed, "seed", "s", 1, "PRNG seed value")
rootCmd.Flags().BoolVarP(&dropSchema, "drop-schema", "d", false, "Drop schema before starting tests run")
rootCmd.Flags().BoolVarP(&verbose, "verbose", "v", false, "Verbose output during test run")
}

0 comments on commit 98c814e

Please sign in to comment.