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

tests/e2e: dump extra checker info #315

Merged
merged 6 commits into from
Aug 16, 2022

Conversation

willfindlay
Copy link
Contributor

@willfindlay willfindlay commented Aug 11, 2022

This PR makes two critical additions to the e2e test export. In particular, we will now dump a list of all events encountered by the checker in order as well as all unmatched checks from the event checker in JSON format. Combined, these two additions will help us debug failing tests by enabling us to match events 1:1 with the checker logs. See individual commits.

@willfindlay willfindlay requested a review from jrfastab August 11, 2022 19:07
@willfindlay willfindlay requested a review from a team as a code owner August 11, 2022 19:07
@willfindlay willfindlay marked this pull request as draft August 12, 2022 14:04
@willfindlay
Copy link
Contributor Author

found a bug, converting to draft for now

@willfindlay willfindlay changed the title tests/e2e: dump json event stream per event checker in export info tests/e2e: dump extra checker info Aug 12, 2022
@willfindlay willfindlay force-pushed the pr/willfindlay/e2e-framework-dump-improvements branch from 278cb18 to a4cb9a0 Compare August 12, 2022 14:25
@willfindlay willfindlay marked this pull request as ready for review August 12, 2022 14:25
@willfindlay
Copy link
Contributor Author

Should be gucci now.

Sometimes we might only want to compile a subset of tests during local development. This
flag lets us do that. Defaults to ./... to keep the old behaviour.

Signed-off-by: William Findlay <[email protected]>
Rather than creating the export dir after tests when dumping info, created it before-hand.
This will enable us to also dump information during tests, which I'll be using in
a subsequent commit in this series. As a bonus, keeping context in this way will prevent
us from erroneously creating multiple export dirs (one for each testenv.Test).

Signed-off-by: William Findlay <[email protected]>
It's extremely helpful to have a per-checker dump of json events, since this can be
matched up 1:1 with the event sequence number in the event checker logs. That way we can
compare an individual json event with the checker logs to look for matches and/or events
that we expected to match but did not.

Signed-off-by: William Findlay <[email protected]>
These functions enable grabbing the remaining unmatched event checks for a given checker
before a call to .Finalize(). We can use this to print unmatched checks at the end of
tests.

Signed-off-by: William Findlay <[email protected]>
This commit causes the rpcchecker to dump its unmatched checks at the end as a JSON file.
This should help us better debug which checks are actually unmatched and cross check them
against the sequence of seen events.

Signed-off-by: William Findlay <[email protected]>
Mixing klog and logrus here was causing problems since we weren't writing per-step info to
the checker logs buffer and thus were missing info in checker dumps. Switch to the logrus
logger here for now so that we can dump all the info we need to debug failures.

Signed-off-by: William Findlay <[email protected]>
@willfindlay willfindlay force-pushed the pr/willfindlay/e2e-framework-dump-improvements branch from d978cb3 to bde8d8e Compare August 15, 2022 18:51
@jrfastab jrfastab merged commit b8ad0ac into main Aug 16, 2022
@jrfastab jrfastab deleted the pr/willfindlay/e2e-framework-dump-improvements branch August 16, 2022 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants