8000 e2e: `test` action should accept additional parameters · Issue #4112 · cometbft/cometbft · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
e2e: test action should accept additional parameters #4112
Open
@cason

Description

@cason

One of the actions that the e2e runner can perform is to run all tests located under the test/e2e/tests/ directory, by invoking it with the test action. The test is running locally, with the test units connecting to the tested nodes.

It is possible to have more information by setting the VERBOSE=1 environment variable, but it is not possible to pass additional commands for the go test command that is run. I don't a reason why one could not pass additional parameters for it.

In more details, assume we are using the simple.toml manifest:

$ ./build/runner -f networks/simple.toml start
I[2024-09-17|15:47:26.333] Starting initial network nodes...            
I[2024-09-17|15:47:26.414] start                                        msg="Node validator00 up on http://127.0.0.1:5701"
I[2024-09-17|15:47:26.416] start                                        msg="Node validator01 up on http://127.0.0.1:5704"
I[2024-09-17|15:47:26.418] start                                        msg="Node validator02 up on http://127.0.0.1:5707"
I[2024-09-17|15:47:26.419] start                                        msg="Node validator03 up on http://127.0.0.1:5710"
I[2024-09-17|15:47:26.419] Waiting for initial height                   height=1 nodes=4 pending=0
$ ./build/runner -f networks/simple.toml test
I[2024-09-17|15:47:56.491] Running tests in ./tests/...                 
ok  	github.com/cometbft/cometbft/test/e2e/tests	16.838s
$ VERBOSE=1 ./build/runner -f networks/simple.toml test
I[2024-09-17|15:48:32.880] Running tests in ./tests/...                 
=== RUN   TestCheckABCIGrammar
=== RUN   TestCheckABCIGrammar/validator00
=== RUN   TestCheckABCIGrammar/validator01
(...)
PASS
ok  	github.com/cometbft/cometbft/test/e2e/tests	16.704s

One my want to run a single specific test unit or to pass additional parameters to the test. For this, at the moment, one have to run:

$ cd tests                                                                                                                                                                                                           
$ INFRASTRUCTURE_TYPE=docker E2E_MANIFEST=networks/simple.toml E2E_TESTNET_DIR=networks/simple/ go test -v -run TestApp_Tx
=== RUN   TestApp_Tx
=== RUN   TestApp_Tx/validator00
=== RUN   TestApp_Tx/validator01
=== RUN   TestApp_Tx/validator02
=== RUN   TestApp_Tx/validator03
--- PASS: TestApp_Tx (5.04s)
    --- PASS: TestApp_Tx/validator00 (1.01s)
    --- PASS: TestApp_Tx/validator01 (1.01s)
    --- PASS: TestApp_Tx/validator02 (2.01s)
    --- PASS: TestApp_Tx/validator03 (1.01s)
PASS
ok  	github.com/cometbft/cometbft/test/e2e/tests	5.379s

I wonder if it would not be better to instead just run:

$ ./build/runner -f networks/simple.toml test -v -run TestApp_Tx

to get the same output.

Metadata

Metadata

Assignees

No one assigned

    Labels

    e2eRelated to our end-to-end testsenhancementNew feature or requesttestingrelated to unit testing in general

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0