Skip to content

fix: adjust test counting logic to handle skipped tests in android_tl…#963

Merged
cfc4n merged 1 commit intomasterfrom
bugfix/android-e2e-count
Mar 22, 2026
Merged

fix: adjust test counting logic to handle skipped tests in android_tl…#963
cfc4n merged 1 commit intomasterfrom
bugfix/android-e2e-count

Conversation

@cfc4n
Copy link
Copy Markdown
Member

@cfc4n cfc4n commented Mar 22, 2026

This pull request improves the accuracy of test result reporting in the android_tls_e2e_test.sh script 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:

  • Moved the increment of TESTS_TOTAL in test_pid_filter() to occur only when the test is actually run, preventing skipped tests from being counted in the total. [1] [2]
  • Added explicit log messages to indicate when the PID filter test is skipped due to the absence of a client PID, clarifying the test outcome.

Summary output enhancements:

  • Updated the summary logic in 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.

…s_e2e_test.sh

Signed-off-by: CFC4N <cfc4n.cs@gmail.com>
Copilot AI review requested due to automatic review settings March 22, 2026 12:47
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. fix bug fix PR test Tests and some Magic labels Mar 22, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_TOTAL increment 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 a TESTS_TOTAL==0 case and simplify pass/fail summary output.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +361 to +364
if [ "$TESTS_TOTAL" -eq 0 ]; then
log_warn "No tests were run (all skipped)"
exit 0
elif [ "$TESTS_PASSED" -eq "$TESTS_TOTAL" ]; then
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
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

Copilot uses AI. Check for mistakes.
exit 1
else
log_error "All tests FAILED"
log_warn "$TESTS_PASSED / $TESTS_TOTAL tests passed"
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
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

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Copy Markdown

🔧 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)

@github-actions
Copy link
Copy Markdown

✅ E2E Test Results: PASSED

Test Run: #23403379971

Tests Executed:

  • TLS/OpenSSL Module (curl → github.com)
  • GnuTLS Module (wget/curl → github.com)
  • GoTLS Module (Go client → github.com)

✅ All e2e tests passed successfully! The TLS capture functionality is working correctly.


Automated e2e test results for commit c6948f6

@cfc4n cfc4n merged commit d41de38 into master Mar 22, 2026
16 checks passed
@cfc4n cfc4n deleted the bugfix/android-e2e-count branch March 22, 2026 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix bug fix PR size:S This PR changes 10-29 lines, ignoring generated files. test Tests and some Magic

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants