fix: adjust test counting logic to handle skipped tests in android_tl…#963
fix: adjust test counting logic to handle skipped tests in android_tl…#963
Conversation
…s_e2e_test.sh Signed-off-by: CFC4N <cfc4n.cs@gmail.com>
There was a problem hiding this comment.
Pull request overview
Refines Android TLS E2E test reporting so that a skipped PID-filter test doesn’t inflate the total test count, and adjusts the end-of-run summary output logic.
Changes:
- Move
TESTS_TOTALincrement for the PID-filter test to occur only when the test actually runs (i.e., after a client PID is found). - Add explicit “SKIPPED” logging when the PID-filter test can’t run due to missing client PID.
- Update
main()summary logic to include aTESTS_TOTAL==0case and simplify pass/fail summary output.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if [ "$TESTS_TOTAL" -eq 0 ]; then | ||
| log_warn "No tests were run (all skipped)" | ||
| exit 0 | ||
| elif [ "$TESTS_PASSED" -eq "$TESTS_TOTAL" ]; then |
There was a problem hiding this comment.
The new TESTS_TOTAL==0 summary branch looks unreachable in the current script because Test 1 and Test 2 always increment TESTS_TOTAL unconditionally before any early return. If the intent is to support an "all tests skipped" scenario, the earlier tests would need a real skip path (and avoid incrementing totals), and the cleanup_handler summary should be aligned so it doesn’t still print "All tests PASSED" for 0/0.
| if [ "$TESTS_TOTAL" -eq 0 ]; then | |
| log_warn "No tests were run (all skipped)" | |
| exit 0 | |
| elif [ "$TESTS_PASSED" -eq "$TESTS_TOTAL" ]; then | |
| if [ "$TESTS_PASSED" -eq "$TESTS_TOTAL" ] && [ "$TESTS_TOTAL" -gt 0 ]; then |
| exit 1 | ||
| else | ||
| log_error "All tests FAILED" | ||
| log_warn "$TESTS_PASSED / $TESTS_TOTAL tests passed" |
There was a problem hiding this comment.
This summary logic removed the explicit "All tests FAILED"/log_error case. Other Android e2e scripts still use log_error when TESTS_PASSED==0 (e.g. test/e2e/android/android_gotls_e2e_test.sh:370-378, android_bash_e2e_test.sh:339-347). Consider restoring an all-failed branch (log_error + clearer message) to keep failure signaling consistent across scripts.
| log_warn "$TESTS_PASSED / $TESTS_TOTAL tests passed" | |
| if [ "$TESTS_PASSED" -eq 0 ]; then | |
| log_error "All $TESTS_TOTAL tests FAILED" | |
| else | |
| log_warn "$TESTS_PASSED / $TESTS_TOTAL tests passed" | |
| fi |
|
🔧 Debug Build Complete (PR #963) 📦 Download Links: ⏰ Files will be retained for 7 days, please download and test promptly. This build includes debug binaries for: android/linux (arm64/amd64) |
✅ E2E Test Results: PASSEDTest Run: #23403379971 Tests Executed:
✅ All e2e tests passed successfully! The TLS capture functionality is working correctly. Automated e2e test results for commit c6948f6 |
This pull request improves the accuracy of test result reporting in the
android_tls_e2e_test.shscript by refining how skipped tests are handled and enhancing the summary output. The main changes ensure that skipped tests (specifically when a client PID is unavailable) are clearly reported and not counted toward the total test count, resulting in more accurate success/failure metrics.Test counting and reporting improvements:
TESTS_TOTALintest_pid_filter()to occur only when the test is actually run, preventing skipped tests from being counted in the total. [1] [2]Summary output enhancements:
main()to handle cases where all tests are skipped, providing a clear warning and exiting with success, and to simplify the reporting of passed/failed tests.