Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 1, 2025

Implements pytest-based test infrastructure with multi-version Python CI/CD pipeline. No external coverage services.

Test Suite

tests/test_main.py (25 tests, 51% coverage on main.py):

  • Muscle group selection (numeric and text input)
  • CLI commands (list, start, next, skip, end, stats, video, help, license, quit)
  • Workout flow integration tests
  • Input validation and error handling

tests/test_gui.py (5 tests):

  • GUI component initialization
  • Percentage calculations
  • Graceful skip in headless environments

Example test pattern:

@patch('builtins.print')
@patch('builtins.input')
def test_abs_selection_by_name(mock_input, mock_print):
    mock_input.side_effect = ['abs', 'quit']
    with pytest.raises(SystemExit):
        main.workout()
    printed_output = [str(call) for call in mock_print.call_args_list]
    assert any('Ab muscle group selected' in str(call) for call in printed_output)

GitHub Actions Workflow

.github/workflows/tests.yml:

  • Matrix testing: Python 3.9-3.12
  • Coverage reports (HTML, XML, terminal) with artifacts
  • Coverage summary in Actions UI
  • Integrated pylint check
  • Triggers: push/PR to main, develop

Configuration

  • requirements.txt: pytest, pytest-cov, pytest-mock
  • setup.cfg: pytest config with coverage settings
  • tests/README.md: usage, writing guidelines, troubleshooting

Results: 25 passing tests, 5 skipped (GUI), 55% overall coverage, 0 security vulnerabilities (CodeQL).

Original prompt

Create a comprehensive test suite with a GitHub Actions integration. DO NOT use Codecov.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits November 1, 2025 03:31
Co-authored-by: willtheorangeguy <18339050+willtheorangeguy@users.noreply.github.com>
This commit fixes the style issues introduced in ad548ea according to the output
from Black.

Details: #180
@github-actions
Copy link

github-actions bot commented Nov 1, 2025

Thank you for your contribution, please read and sign our CLA. Instructions on how to do so can be found in the CONTRIBUTING.md document.


I have read the CLA Document, and I hereby sign the CLA.


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

Copilot AI and others added 3 commits November 1, 2025 03:32
Co-authored-by: willtheorangeguy <18339050+willtheorangeguy@users.noreply.github.com>
Co-authored-by: willtheorangeguy <18339050+willtheorangeguy@users.noreply.github.com>
This commit fixes the style issues introduced in 5b2c2a7 according to the output
from Black.

Details: #180
Copilot AI changed the title [WIP] Add comprehensive test suite with GitHub Actions integration Add comprehensive test suite with GitHub Actions CI/CD integration Nov 1, 2025
@willtheorangeguy willtheorangeguy marked this pull request as ready for review November 19, 2025 19:45
@willtheorangeguy willtheorangeguy merged commit f614829 into main Nov 19, 2025
6 of 13 checks passed
@willtheorangeguy willtheorangeguy deleted the copilot/create-test-suite-github-actions branch November 19, 2025 19:45
@github-actions github-actions bot locked and limited conversation to collaborators Nov 19, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants