Nothing Special   »   [go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

e2e: run-multiple.sh script should save the dump of failed tests #4115

Open
cason opened this issue Sep 18, 2024 · 6 comments
Open

e2e: run-multiple.sh script should save the dump of failed tests #4115

cason opened this issue Sep 18, 2024 · 6 comments
Labels
e2e Related to our end-to-end tests enhancement New feature or request testing related to unit testing in general

Comments

@cason
Copy link
Collaborator
cason commented Sep 18, 2024

This is a helper script to run multiple executions, one per manifest.

If an execution fails, it dumps some data to the standard output and then cleans the directory with the actual execution data:

if ! ./build/runner -f "$MANIFEST"; then
echo "==> Testnet $MANIFEST failed, dumping manifest..."
cat "$MANIFEST"
echo "==> Dumping container logs for $MANIFEST..."
./build/runner -f "$MANIFEST" logs
echo "==> Cleaning up failed testnet $MANIFEST..."
./build/runner -f "$MANIFEST" cleanup
FAILED+=("$MANIFEST")
fi

It should instead create a temporary directory with the information of the failed execution, containing:

@cason cason added enhancement New feature or request e2e Related to our end-to-end tests testing related to unit testing in general labels Sep 18, 2024
@andynog andynog added this to CometBFT Sep 20, 2024
@github-project-automation github-project-automation bot moved this to Todo in CometBFT Sep 20, 2024
@andynog
Copy link
Contributor
andynog commented Sep 20, 2024

@cason I've already implemented this logic, it's the concept of runner executions and I was using it to better test the e2e nightly failures.

https://github.com/cometbft/cometbft/tree/andy/e2e-preserve-logs

you can run with "executions" enabled

./build/runner -f networks/nightly/gen-group01-0004.toml --execution

I[2024-09-20|13:53:42.069] Starting initial network nodes...            
I[2024-09-20|13:53:42.070] load                                         msg="Starting transaction load (16 workers)..."
....
I[2024-09-20|13:55:17.123] wait until                                   msg="Waiting for all nodes to reach height 51..."
I[2024-09-20|13:55:26.540] Running all tests in ./tests/...             
ok      github.com/cometbft/cometbft/test/e2e/tests     46.244s
I[2024-09-20|13:56:15.085] saving execution                             msg="saving e2e network execution information"

and it will save all the logs and manifest used in each run (could add logic to save the node data/config too), the nice thing you can run the same manifest multiple times, maybe modifying a parameter, and still keep the old results because it saves each run within a time date folder

./networks_executions/gen-group01-0004
└── 20240920_095615
    ├── manifest.toml
    └── nodes
        ├── validator01
        │   ├── docker-errors.log
        │   └── docker.log
        ├── validator02
        │   ├── docker-errors.log
        │   └── docker.log
        ├── validator03
        │   ├── docker-errors.log
        │   └── docker.log
        └── validator04
            ├── docker-errors.log
            └── docker.log

This logic can be expanded on many fronts, like some ideas parse the results and generate automated reports in order to improve the time it currently takes to comb through the results or eventually do diffs of results based on tweaks between runs 😉

I just didn't have time to port this to main because I was busy investigation the nightly failures but if you think this is the right direction and should be prioritized I'd be happy to work on it.

@cason
Copy link
Collaborator Author
cason commented Sep 23, 2024

@andynog , this is great, should we open a PR on this?

(could add logic to save the node data/config too)

Yes, I would keep everything.

@andynog
Copy link
Contributor
andynog commented Sep 23, 2024

@cason, I'll try to find time this week to push a PR with this logic 👍

@andynog andynog self-assigned this Sep 23, 2024
@andynog andynog moved this from Todo to In Progress in CometBFT Sep 23, 2024
@cason
Copy link
Collaborator Author
cason commented Sep 24, 2024

Thank you for this code, @andynog, great work.

I was wondering, however, whether we should add a command to the runner to dump all this information. So we can run the multiple actions, one by one, and after stopping the network but before cleaning-up the execution, we could also "manually" dump and the relevant data.

Ok, it is true that the Comet's home directories for every node are under networks/<manifest> and they won't change once we invoke the stop command. But this is not true for the logs, isn't it?

@cason
Copy link
Collaborator Author
cason commented Nov 8, 2024

This issue can be associated with #4113.

@andynog
Copy link
Contributor
andynog commented Dec 12, 2024

PR #4165 was closed since the solution to this problem needs additional design considerations that needs to be addressed/defined before a logic can be implemented.

@andynog andynog removed their assignment Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e2e Related to our end-to-end tests enhancement New feature or request testing related to unit testing in general
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

2 participants