Skip to content

Commit

Permalink
Added ability to pass config file to grpc plugin in integration tests (
Browse files Browse the repository at this point in the history
…#3253)

* Added ability to pass config file to grpc plugin in integration tests

If PLUGIN_CONFIG_PATH env var is set, its value is passed to --grpc-storage-plugin.configuration-file flag.

Signed-off-by: Yury Frolov <[email protected]>

* Reverted jaeger-ui changes

Signed-off-by: Yury Frolov <[email protected]>
  • Loading branch information
EinKrebs authored Sep 9, 2021
1 parent f5bb954 commit b5d340d
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions plugin/storage/integration/grpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,27 @@ type GRPCStorageIntegrationTestSuite struct {
StorageIntegration
logger *zap.Logger
pluginBinaryPath string
pluginConfigPath string
}

func (s *GRPCStorageIntegrationTestSuite) initialize() error {
s.logger, _ = testutils.NewLogger()

f := grpc.NewFactory()
v, command := config.Viperize(f.AddFlags)
err := command.ParseFlags([]string{
flags := []string{
"--grpc-storage-plugin.binary",
s.pluginBinaryPath,
"--grpc-storage-plugin.log-level",
"debug",
})
}
if s.pluginConfigPath != "" {
flags = append(flags,
"--grpc-storage-plugin.configuration-file",
s.pluginConfigPath,
)
}
err := command.ParseFlags(flags)
if err != nil {
return err
}
Expand Down Expand Up @@ -81,13 +89,18 @@ func TestGRPCStorage(t *testing.T) {
if os.Getenv("STORAGE") != "grpc-plugin" {
t.Skip("Integration test against grpc skipped; set STORAGE env var to grpc-plugin to run this")
}
path := os.Getenv("PLUGIN_BINARY_PATH")
if path == "" {
binaryPath := os.Getenv("PLUGIN_BINARY_PATH")
if binaryPath == "" {
t.Logf("PLUGIN_BINARY_PATH env var not set, using %s", defaultPluginBinaryPath)
path = defaultPluginBinaryPath
binaryPath = defaultPluginBinaryPath
}
configPath := os.Getenv("PLUGIN_CONFIG_PATH")
if configPath == "" {
t.Log("PLUGIN_CONFIG_PATH env var not set")
}
s := &GRPCStorageIntegrationTestSuite{
pluginBinaryPath: path,
pluginBinaryPath: binaryPath,
pluginConfigPath: configPath,
}
require.NoError(t, s.initialize())
s.IntegrationTestAll(t)
Expand Down

0 comments on commit b5d340d

Please sign in to comment.