Skip to content

Conversation

@the-david-oy
Copy link
Contributor

@the-david-oy the-david-oy commented Jul 30, 2025

Run automated unit testing on pull requests. This PR fixes currently failing unit tests.

@the-david-oy the-david-oy self-assigned this Jul 30, 2025
@the-david-oy the-david-oy changed the title [DRAFT] Add unit testing pre-commit hook ci: automate unit testing for pull requests Jul 30, 2025
Update file dir

Active virtual env

Fix dir name

Add ls for debugging

Change dir navigation

Update pythonpath

Use make test

Fix some of unit test failures

Add yield to mock

Fix two more tests

Fix two more tests

Fix last test
@the-david-oy the-david-oy requested a review from Copilot July 30, 2025 19:26
Copy link

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

This PR implements automated unit testing for pull requests and fixes multiple failing unit tests to enable the CI workflow.

Key changes include:

  • Added GitHub Actions workflow for automated unit testing on PRs
  • Fixed test data structure mismatches (attribute name corrections)
  • Updated test mocking strategies to properly handle async operations
  • Added missing imports and adjusted test fixtures

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
.github/workflows/run-unit-tests.yml New GitHub Actions workflow to run unit tests on pull requests
tests/test_background_task.py Added event loop yields after task stop to ensure proper test timing
tests/services/test_inference_result_parser.py Fixed attribute names from text/content to texts/contents
tests/services/records_manager/test_streaming_post_processor.py Updated test setup with proper factory registration and async task handling
tests/services/records_manager/test_processing_stats_streamer.py Added async mocking for pub_client to prevent test failures
tests/logging/test_logging_mixins.py Fixed logger level setting for proper lazy evaluation testing
tests/data_exporters/test_json_exporter.py Updated test to match expected JSON structure with records wrapper
tests/data_exporters/test_exporter_manager.py Enhanced mocking to handle multiple exporters with proper async assertions
tests/config/test_base_config.py Changed import from Pydantic BaseModel to AIPerfBaseModel
aiperf/common/config/user_config.py Fixed syntax error in field annotation

Copy link
Contributor

@lkomali lkomali left a comment

Choose a reason for hiding this comment

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

LGTM

@the-david-oy the-david-oy merged commit 68ca387 into main Jul 30, 2025
2 checks passed
@the-david-oy the-david-oy deleted the dyas-unit-tests branch July 30, 2025 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants