Skip to content

[SET-2465] Scaffold COS CLI package and test integration - #1110

Open
wilkmar wants to merge 1 commit into
canonical:mainfrom
wilkmar:add_cos_module
Open

[SET-2465] Scaffold COS CLI package and test integration#1110
wilkmar wants to merge 1 commit into
canonical:mainfrom
wilkmar:add_cos_module

Conversation

@wilkmar

@wilkmar wilkmar commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Depends on #1109

Add a new cos package scaffold with module entry points (main, cli.main), basic argparse wiring, and placeholder CLI output.

Include initial COS docs and unit tests for CLI success and help behavior, and wire the package into project packaging, script entry points, coverage settings, and tox test paths.

Copilot AI left a comment

Copy link
Copy Markdown

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 scaffolds a new top-level cos Python package inside the existing hotsos distribution, adding an initial CLI entry point and integrating basic unit testing + coverage/tox wiring.

Changes:

  • Add cos package scaffold with python -m cos and cos console script entry points.
  • Add initial unit tests verifying CLI success and --help behavior.
  • Extend tox and coverage configuration to include cos sources and COS unit test discovery.

Reviewed changes

Copilot reviewed 7 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tox.ini Adds COS unit test path, runs COS unit tests in tox, and includes cos in coverage sources and lint/pylint paths.
pyproject.toml Includes cos* packages and adds a cos console script entry point.
cos/cli.py Implements initial argparse scaffold and placeholder output for the COS CLI.
cos/main.py Enables python3 -m cos execution by delegating to cos.cli.main.
cos/init.py Adds module docstring and exports.
cos/tests/init.py Marks COS tests as a package.
cos/tests/unit/init.py Marks COS unit tests as a package.
cos/tests/unit/test_cli.py Adds initial unittest-based CLI scaffold tests.
cos/doc/README.md Adds initial COS documentation placeholder.

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

Comment thread pyproject.toml Outdated
Comment thread cos/__init__.py

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 9 changed files in this pull request and generated no new comments.

Suppressed comments (2)

cos/init.py:6

  • __all__ lists "cli" but the module doesn’t define/import cli, so from cos import * will raise AttributeError. Either remove __all__ or import the submodule before defining it.

__all__ = ["cli"]

cos/tests/unit/test_cli.py:23

  • The --help test currently only asserts SystemExit and allows argparse help text to be printed during the test run. Capture stdout and assert the exit code and key help content so the test validates the intended behavior without noisy output.
    def test_help_is_available(self):
        with self.assertRaises(SystemExit):
            cli.main(["--help"])

Add a new cos package scaffold with module entry points (__main__, cli.main),
basic argparse wiring, and placeholder CLI output.

Include initial COS docs and unit tests for CLI success and help behavior,
and wire the package into project packaging, script entry points,
coverage settings, and tox test paths.

Signed-off-by: Marcin Wilk <marcin.wilk@canonical.com>
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.

2 participants