You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am investigating the golang issue: golang/go#48362, where testable examples are causing false positives when the output comment block is not the last comment block example.
The comment blocks should be combined into one comment block like so:
func ExampleRun() {
t := &testing.T{}
tc := cltest.NewTestGeneralConfig(t)
tc.Overrides.Dev = null.BoolFrom(false)
testClient := &cmd.Client{
Renderer: cmd.RendererTable{Writer: ioutil.Discard},
Config: tc,
AppFactory: cmd.ChainlinkAppFactory{},
FallbackAPIInitializer: &cltest.MockAPIInitializer{},
Runner: cmd.ChainlinkRunner{},
HTTP: cltest.NewMockAuthenticatedHTTPClient(tc, "session"),
ChangePasswordPrompter: cltest.MockChangePasswordPrompter{},
}
Run(testClient, "core.test", "--help")
Run(testClient, "core.test", "--version")
// Output:
// NAME:
// core.test - CLI for Chainlink
//
// USAGE:
// core.test [global options] command [command options] [arguments...]
//
// VERSION:
// unset@unset
//
// COMMANDS:
// admin Commands for remotely taking admin related actions
// attempts, txas Commands for managing Ethereum Transaction Attempts
// bridges Commands for Bridges communicating with External Adapters
// config Commands for the node's configuration
// jobs Commands for managing Jobs
// keys Commands for managing various types of keys used by the Chainlink node
// node, local Commands for admin actions that must be run locally
// runs Commands for managing Runs
// txs Commands for handling Ethereum transactions
// help, h Shows a list of commands or help for one command
//
// GLOBAL OPTIONS:
// --json, -j json output as opposed to table
// --help, -h show help
// --version, -v print the version
// core.test version unset@unset
}
When I fixed it so that it would check the output I got the following test failure:
$ DATABASE_URL="meow_test" go test .
--- FAIL: ExampleRun (0.00s)
got:
NAME:
core.test - CLI for Chainlink
USAGE:
core.test [global options] command [command options] [arguments...]
VERSION:
unset@unset
COMMANDS:
admin Commands for remotely taking admin related actions
attempts, txas Commands for managing Ethereum Transaction Attempts
blocks Commands for managing blocks
bridges Commands for Bridges communicating with External Adapters
config Commands for the node's configuration
jobs Commands for managing Jobs (V2)
keys Commands for managing various types of keys used by the Chainlink node
node, local Commands for admin actions that must be run locally
txs Commands for handling Ethereum transactions
chains Commands for handling chain configuration
nodes Commands for handling node configuration
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--json, -j json output as opposed to table
--help, -h show help
--version, -v print the version
core.test version unset@unset
want:
NAME:
core.test - CLI for Chainlink
USAGE:
core.test [global options] command [command options] [arguments...]
VERSION:
unset@unset
COMMANDS:
admin Commands for remotely taking admin related actions
attempts, txas Commands for managing Ethereum Transaction Attempts
bridges Commands for Bridges communicating with External Adapters
config Commands for the node's configuration
jobs Commands for managing Jobs
keys Commands for managing various types of keys used by the Chainlink node
node, local Commands for admin actions that must be run locally
runs Commands for managing Runs
txs Commands for handling Ethereum transactions
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--json, -j json output as opposed to table
--help, -h show help
--version, -v print the version
core.test version unset@unset
FAIL
FAIL github.com/smartcontractkit/chainlink/core 0.226s
FAIL
The text was updated successfully, but these errors were encountered:
馃憢 Hello,
I am investigating the golang issue: golang/go#48362, where testable examples are causing false positives when the output comment block is not the last comment block example.
I ran a parser against the top golang repos, including this repo, and I found this bug with the ExampleRun testable example.
The comment blocks should be combined into one comment block like so:
When I fixed it so that it would check the output I got the following test failure:
The text was updated successfully, but these errors were encountered: