forked from elastic/elastic-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcmd_test.go
32 lines (28 loc) · 1018 Bytes
/
cmd_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
// or more contributor license agreements. Licensed under the Elastic License 2.0;
// you may not use this file except in compliance with the Elastic License 2.0.
package cmd
import (
"testing"
)
func TestAgent(t *testing.T) {
// t.Run("test agent with subcommand", func(t *testing.T) {
// streams, _, _, _ := cli.NewTestingIOStreams()
// cmd := NewCommandWithArgs([]string{}, streams)
// cmd.SetOutput(streams.Out)
// cmd.Execute()
// })
// t.Run("test run subcommand", func(t *testing.T) {
// streams, _, out, _ := cli.NewTestingIOStreams()
// cmd := newRunCommandWithArgs(globalFlags{
// PathConfigFile: filepath.Join("build", "elastic-agent.yml"),
// }, []string{}, streams)
// cmd.SetOutput(streams.Out)
// cmd.Execute()
// contents, err := ioutil.ReadAll(out)
// if !assert.NoError(t, err) {
// return
// }
// assert.True(t, strings.Contains(string(contents), "Hello I am running"))
// })
}