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 Local Test Automation Workflow with Detailed Reporting and Error Logging #75

Open
wants to merge 5 commits into
base: 09132024_upstream_main
Choose a base branch
from

Conversation

l-soaresguimaraes
Copy link

This PR implements an automated testing and reporting solution designed to streamline our Python test suite execution, log results, and generate comprehensive reports. The PR adds two core scripts that automate test execution and reporting processes, along with improving error tracking for more efficient debugging and insights into test results.

Key Components

  • run_local_tests.sh: A shell script that automates the discovery and execution of Python test suites.

    • Behavior: Mimics the functionality of the GitHub Actions workflow by identifying and running _test.py files within the specified folder.
    • Logging: Captures results in test_results.log and saves individual error logs for each failing test case in the error_logs directory.
    • Report Generation: Automatically invokes generate_excel_report.py upon completion to produce an Excel summary.
  • generate_excel_report.py: A Python script that reads test logs and generates an Excel report (test_report.xlsx).

    • Report Contents: Includes a high-level summary of test suites and cases, detailed case results, pie charts visualizing pass/fail statuses, and formatted error logs.
    • Error Handling: Ensures error logs are saved as plain text in Excel to prevent formula conflicts.

Summary of Changes

  1. Automated Execution and Logging: Ensures that all tests in the target folder are executed and logged with run_local_tests.sh, creating consistent log output across local environments and CI pipelines.
  2. Enhanced Reporting: Generates a detailed, color-coded Excel report summarizing test outcomes, including suite- and case-level metrics, error breakdowns, and visual summaries.
  3. Improved Debugging: Logs for failed tests are saved in a separate folder to facilitate easy access and streamlined troubleshooting.

Usage

  • Run Tests and Generate Report:

    chmod +x run_local_tests.sh
    ./run_local_tests.sh
  • Dependencies:

    • Python packages: pandas, openpyxl, and pytest.

Impact

This enhancement will support local and CI-based testing workflows by:

  • Providing clear, actionable test insights with a structured log format.
  • Reducing time spent on manual test execution and reporting.
  • Creating a report format suitable for review and analysis.

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.

1 participant