mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
* Store version-check file in the configured data-directory This also fixes what I think is a bug. It also un-exports everything. I have questions. * Version checking: clean up code, add server flags FB-1975 Cleaned up version checking, removed a race condition, and added error checking. Added server flags for check-in endpoint and UUID storage file. Incorporates Travis's changes to store UUID file in data directory and unexport most of verchk.go. --------- Co-authored-by: Travis Turner <travis@molecula.com> Co-authored-by: seebs <seebs@molecula.com>
29 lines
718 B
Go
29 lines
718 B
Go
// Copyright 2022 Molecula Corp. (DBA FeatureBase).
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
package ctl
|
|
|
|
import (
|
|
"os"
|
|
"testing"
|
|
|
|
"github.com/featurebasedb/featurebase/v3/server"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
func TestBuildServerFlags(t *testing.T) {
|
|
cm := &cobra.Command{}
|
|
Server := server.NewCommand(os.Stderr)
|
|
BuildServerFlags(cm, Server)
|
|
if cm.Flags().Lookup("data-dir").Name == "" {
|
|
t.Fatal("data-dir flag is required")
|
|
}
|
|
if cm.Flags().Lookup("log-path").Name == "" {
|
|
t.Fatal("log-path flag is required")
|
|
}
|
|
if cm.Flags().Lookup("verchk-address").Name == "" {
|
|
t.Fatal("verchk-address flag is required")
|
|
}
|
|
if cm.Flags().Lookup("uuid-file").Name == "" {
|
|
t.Fatal("uuid-file flag is required")
|
|
}
|
|
}
|