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

VAULT-17592 Extract failed Go test results across runners #21625

Merged
merged 11 commits into from
Jul 7, 2023

Conversation

kubawi
Copy link
Contributor

@kubawi kubawi commented Jul 6, 2023

No description provided.

@kubawi kubawi requested a review from a team as a code owner July 6, 2023 16:42
@kubawi kubawi force-pushed the kubawi/VAULT-12958/extract-failed-tests-across-all-jobs branch from aa9e453 to 5319b86 Compare July 6, 2023 16:52
@kubawi kubawi changed the title Extract failed Go test results across runners VAULT-17592 Extract failed Go test results across runners Jul 6, 2023
@kubawi kubawi force-pushed the kubawi/VAULT-12958/extract-failed-tests-across-all-jobs branch from 608a4ce to 8b83251 Compare July 6, 2023 17:26
@kubawi kubawi force-pushed the kubawi/VAULT-12958/extract-failed-tests-across-all-jobs branch from 86252ce to 90f55fc Compare July 6, 2023 19:17
@kubawi kubawi force-pushed the kubawi/VAULT-12958/extract-failed-tests-across-all-jobs branch from 08be826 to aa03a7b Compare July 6, 2023 19:54
@VioletHynes VioletHynes added the hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed label Jul 6, 2023
@miagilepner
Copy link
Contributor

This is awesome!!!

I have 2 things that I think we should eventually consider doing, though it doesn't need to be in this PR:

  1. Group tests by name, and list all of the jobs where that test failed so that a single failure doesn't appear 3 times in the table. I have a jq that is a starting point for that:
jq -r -n '[ inputs | select(.Action == "fail") | select(.Test != null) | {package: .Package, test: .Test, type: (input_filename | sub("failure-summary-";"") | sub(".json";"")), key: (.Package+" "+.Test)}  ] | group_by(.key) | map({ key: (.[0].key), value: [.[].type]}) | from_entries ' failure-summary-*.json
  1. If we can add the run ID into the failure summary, then we could build the URL for the logs of the run ID and link that in the table. The run ID could either be part of the filename, or appended to the file.

Because these additions would be useful and the jq is just going to get more complicated, I wonder if we should consider doing this either in python or in a separate bash script with intermediary files. That might make it easier to debug and understand what's happening.

@kubawi
Copy link
Contributor Author

kubawi commented Jul 7, 2023

This is awesome!!!

I have 2 things that I think we should eventually consider doing, though it doesn't need to be in this PR:

  1. Group tests by name, and list all of the jobs where that test failed so that a single failure doesn't appear 3 times in the table. I have a jq that is a starting point for that:
jq -r -n '[ inputs | select(.Action == "fail") | select(.Test != null) | {package: .Package, test: .Test, type: (input_filename | sub("failure-summary-";"") | sub(".json";"")), key: (.Package+" "+.Test)}  ] | group_by(.key) | map({ key: (.[0].key), value: [.[].type]}) | from_entries ' failure-summary-*.json
  1. If we can add the run ID into the failure summary, then we could build the URL for the logs of the run ID and link that in the table. The run ID could either be part of the filename, or appended to the file.

Because these additions would be useful and the jq is just going to get more complicated, I wonder if we should consider doing this either in python or in a separate bash script with intermediary files. That might make it easier to debug and understand what's happening.

Hey @miagilepner, thanks for the suggestions, I fully agree with both points. Would you mind if I merged this in first?
This PR as it is, will give us a single, simple summary and remove all of the individual ones, which are pretty useless at this point anyways. I can then raise another PR with a script that dedupes the tests and adds links to the logs.

@kubawi kubawi merged commit 5defa54 into main Jul 7, 2023
@kubawi kubawi deleted the kubawi/VAULT-12958/extract-failed-tests-across-all-jobs branch July 7, 2023 15:18
kubawi added a commit that referenced this pull request Jul 7, 2023
…21672)

Co-authored-by: Kuba Wieczorek <kuba.wieczorek@hashicorp.com>
kubawi added a commit that referenced this pull request Jul 7, 2023
…21670)

Co-authored-by: Kuba Wieczorek <kuba.wieczorek@hashicorp.com>
kubawi added a commit that referenced this pull request Jul 7, 2023
…21671)

Co-authored-by: Kuba Wieczorek <kuba.wieczorek@hashicorp.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed pr/no-changelog pr/no-milestone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants