Skip to content

Add comprehensive test suite and CI GitHub Action#8

Merged
nikfot merged 3 commits into
mainfrom
feature/comprehensive-test-suite
May 16, 2026
Merged

Add comprehensive test suite and CI GitHub Action#8
nikfot merged 3 commits into
mainfrom
feature/comprehensive-test-suite

Conversation

@nikfot

@nikfot nikfot commented May 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add 44 pytest tests guardrailing all existing behavior: Timeseries, Parser, PlotMetrics, check_vmstat_columns, and CLI commands (visualize, compare)
  • Add 6 fixture files covering active (vmstat -a), standard (vmstat), headerless, empty, and header-only vmstat log formats
  • Add GitHub Actions CI workflow (.github/workflows/ci.yml) that runs the full test suite on push/PR to main using Poetry
  • Add pytest dev dependency group and configuration to pyproject.toml
  • All vmstat subprocess calls are mocked so tests run without system vmstat

Test Coverage

Module Tests What's Covered
test_timeseries.py 8 Init, add_data_point, commit_raw_data mapping, repr
test_parser.py 14 Parse (example, active, no-header, edge cases), PlotMetrics
test_check.py 5 check_vmstat_columns with mocked subprocess (success, errors)
test_plot.py 6 Plot output (5 PNG files, SVG, comparison, invalid metric)
test_cli.py 11 CLI help, visualize, compare, column filter, missing file

Test plan

  • All 44 tests pass locally with PYTHONPATH=src pytest -v
  • CI workflow runs on this PR

nikfot added 3 commits May 16, 2026 09:58
44 tests covering Timeseries, Parser, PlotMetrics, check_vmstat_columns,
and CLI commands (visualize, compare) with pytest fixtures for active,
standard, headerless, empty, and header-only vmstat log formats.
All subprocess calls are mocked to avoid vmstat dependency in CI.
@nikfot nikfot merged commit f84f694 into main May 16, 2026
1 check passed
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