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

Add Test Results Summary for compatibility tests #53

Merged
merged 4 commits into from
Apr 20, 2023

Conversation

mpanchajanya
Copy link
Contributor

@mpanchajanya mpanchajanya commented Apr 12, 2023

What this PR does / why we need it

  • Filter the compatibility test logs
  • Add Test Results summary for github workflow for Compatibility tests.
  • Update ginkgo to ginkgo/v2

Which issue(s) this PR fixes

Fixes #

Describe testing done for PR

  • Filtered logs in Github workflow
    Screenshot 2023-04-14 at 11 06 57

  • New Test Results Summary section in the bottom section of the workflow

  • When a user clicks on the badge displayed in the root README, they will be directed to the workflow runs on the main branch. By selecting the most recent run, they can view the Test Results Summary.

Screenshot 2023-04-18 at 23 17 59

Screenshot 2023-04-18 at 23 16 42

Tested make run-compatibility-tests and exit code with '0' representing success and non-zero values indicating test failures

Ginkgo ran 3 suites in 40.44465325s
Test Suite Passed
mpanchajanya@mpanchajanF09MK tanzu-plugin-runtime % echo $?                     
0

Ginkgo ran 3 suites in 49.492652209s

There were failures detected in the following suites:
  context ./test/compatibility/framework/compatibilitytests/context

Test Suite Failed
make: *** [run-compatibility-tests] Error 1
mpanchajanya@mpanchajanF09MK tanzu-plugin-runtime % echo $?
2

mpanchajanya@mpanchajanF09MK tanzu-plugin-runtime % make help

Usage:
  make <target>
  help                          Display this help (default)
  all                           Run all major targets (lint, test, modules)
  test                          Run Tests
  fmt                           Run goimports
  lint                          Run linting and misspell checks
  go-lint                       Run linting of go source
  doc-lint                      Run linting checks for docs
  modules                       Runs go mod to ensure modules are up to date.
  tools                         Build tooling binaries
  clean                         Remove all generated binaries
  compatibility-tests           Build and Run Compatibility tests
  build-compatibility-test-plugins  Builds all runtime compatibility test plugins
  run-compatibility-tests       Run Compatibility tests

Release note


Additional information

Special notes for your reviewer

@mpanchajanya mpanchajanya changed the title WIP Present test results (WIP) (DRAFT) Present test results Apr 12, 2023
@mpanchajanya mpanchajanya force-pushed the present_test_results branch 2 times, most recently from f6853db to d677beb Compare April 13, 2023 18:17
@mpanchajanya mpanchajanya force-pushed the present_test_results branch 2 times, most recently from d692e1a to 14cb17c Compare April 13, 2023 20:36
@mpanchajanya mpanchajanya changed the title (WIP) (DRAFT) Present test results (DRAFT) Present test results Apr 13, 2023
@mpanchajanya mpanchajanya changed the title (DRAFT) Present test results Add Test Results Summary for compatibility tests Apr 14, 2023
@mpanchajanya mpanchajanya marked this pull request as ready for review April 14, 2023 16:08
@mpanchajanya mpanchajanya requested a review from a team as a code owner April 14, 2023 16:08
Copy link
Contributor

@anujc25 anujc25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great to me. Thanks for improving the test result summary.
I wait for @vuil to take a look at this PR before we merge this pr to get his opinion as well.

Copy link
Contributor

@marckhouzam marckhouzam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool! Very nice look.
A couple of comments:

  1. if you run make modules one of the go.sum file is not up-to-date
  2. Would it be possible to work the output to avoid putting the big red X when there are 0 failures?


- name: Build Runtime Test Plugins
run: make build-compatibility-test-plugins

- name: Run Compatibility Tests
run: make run-compatibility-tests
run: cd ./test/compatibility/framework/compatibilitytests && ginkgo --keep-going --race -r -v --randomize-all --trace --output-dir ./../../../../testresults --json-report=compatibility-tests.json > /tmp/out && { cat /tmp/out | grep -Ev 'STEP:|seconds|.go:'; rm /tmp/out; } || { exit_code=$?; cat /tmp/out | grep -Ev 'STEP:|seconds|.go:'; rm /tmp/out; exit $exit_code; }

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a bit of duplication here and with the make run-compatibility-tests target. Was replacing the make target here just for testing, or is it the final iteration because it needs to do different things than the make target?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed the duplication using the same target

- name: Tests Results Summary
if: always()
run: |
chmod +x ./hack/scripts/process-ginkgo-test-results.sh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this? Isn't the script checked-in as executable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No longer needed. Updated the script

echo "| $suite_description | $suite_tests | :white_check_mark: $suite_passed | :x: $suite_failed |"
else
echo "| $suite_description | $suite_tests | :white_check_mark: $suite_passed | :x: $suite_failed |"
fi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see you were planning on having a different behaviour when there was no suite_failed, but the echo is the same for both cases. Was that intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initial thought was to show slight different on failed. maybe be we could exclude the X icon if no failures. Updated accordingly

echo "| **Total** | $total_tests | :white_check_mark: $total_passed | :x: $total_failed |"
else
echo "| **Total** | $total_tests | :white_check_mark: $total_passed | :x: $total_failed |"
fi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here too the echo's are both the same, was that intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initial thought was to show slight different on failed. maybe be we could exclude the X icon if no failures. Updated accordingly

@mpanchajanya mpanchajanya force-pushed the present_test_results branch 2 times, most recently from 54d5a11 to d9e9149 Compare April 17, 2023 18:47
Copy link
Contributor

@chandrareddyp chandrareddyp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!! LGTM!
Couple of comments added.


# Print the suite row with color and icon depending on the result
if [ "$suite_failed" -eq 0 ]; then
echo "| $suite_description | $suite_tests | :white_check_mark: $suite_passed | $suite_failed |"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks you are not add X (red color) if no failures in the suite, but in the output attached in the PR description has X (red color) even there are no failures.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the images to reflect the results with changes

json=$(cat "$1")

# Print the table header
echo "| :memo: Test Suite Description | Total Tests | :white_check_mark: Passed | :x: Failed |"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion, how about not adding X (red color) on the header next to Failed, add X (red color) to the results which has some failures!

Copy link
Contributor

@vuil vuil Apr 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So were the changes updated? If so, might be good to update the screenshots in the description with the latest output.

Nit: my similar comment is I don't find the emoticons add much to aid comprehending the results; I would even say they are rather distracting tbh. It might be sufficient to highlight when some tests fail, and leave the rest of the tabular data rather plain.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. Updated the images to reflect the results with changes. I have remove the green check and kept red X only if there are any failures

@mpanchajanya mpanchajanya force-pushed the present_test_results branch 3 times, most recently from 16c0098 to 26a5af9 Compare April 19, 2023 04:21
@mpanchajanya mpanchajanya requested a review from vuil April 19, 2023 14:13
Makefile Outdated Show resolved Hide resolved
@mpanchajanya mpanchajanya force-pushed the present_test_results branch 3 times, most recently from bad9c9a to b010eb6 Compare April 19, 2023 20:32
Makefile Outdated
@@ -136,9 +139,7 @@ build-compatibility-test-plugins: ## Builds all runtime compatibility test plugi
cd ./test/compatibility/testplugins/runtime-test-plugin-v0_28_0 && ${GO} mod tidy && GOOS=$(OS) GOARCH=$(ARCH) ${GO} build -o ../bin
cd ./test/compatibility/testplugins/runtime-test-plugin-latest && ${GO} mod tidy && GOOS=$(OS) GOARCH=$(ARCH) ${GO} build -o ../bin

## The below command runs the compatibility tests using ginkgo and filter the logs as per regex and exit code with '0' representing success and non-zero values indicating test failures
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

single # is sufficient. ## is convention for the make help, not relevant here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vuil Made the changes

@mpanchajanya mpanchajanya requested a review from vuil April 20, 2023 02:40
Copy link
Contributor

@vuil vuil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mpanchajanya mpanchajanya merged commit 68c4941 into vmware-tanzu:main Apr 20, 2023
4 checks passed
vuil pushed a commit that referenced this pull request May 2, 2023
* Add GitHub Summary to present compatibility test results and filter the test script logs

* Bump ginkgo and gomega versions

* Remove icons to table data

* Update the compatibility test command and description
@marckhouzam marckhouzam added this to the v0.90.0 milestone Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants