Skip to content

Check that CLI examples run the command they describe - #10827

Open
luigi617 wants to merge 1 commit into
code-example-ci-10from
code-example-ci-11
Open

luigi617 wants to merge 1 commit into
code-example-ci-10from
code-example-ci-11

Conversation

@luigi617

Copy link
Copy Markdown
Contributor

Issue #, if available:

Description of changes:
Check that CLI examples run the command they describe and fix existing violations

The description check requires each example to name the file's command, e.g. The following stop-stream-encryption example, but nothing checked that the example actually runs it. kinesis/stop-stream-encryption.rst ran start-stream-encryption and passed.

  • Added test_example_command_name to tests/functional/docs/test_examples.py: each example must run the command of its file, such as aws ec2 wait instance-running for ec2/wait/instance-running.rst. Other commands, such as a setup step, are allowed alongside it
  • Fixed examples that ran the wrong command: kinesis/stop-stream-encryption.rst, gamelift/stop-fleet-actions.rst, transcribe/delete-medical-vocabulary.rst, greengrassv2/untag-resource.rst, iot/add-thing-to-billing-group.rst, waf-regional/update-ip-set.rst
  • Rewrote iot/update-job.rst and iot/describe-audit-suppression.rst, which showed describe-job and describe-audit-task examples
  • Removed Example 2 of proton/list-service-instances.rst, which duplicated proton/get-service-instance.rst
  • Restructured RDS examples that split a walkthrough into numbered examples of other commands:
    • Moved the cluster and writer instance steps of create-db-shard-group.rst into create-db-cluster.rst and create-db-instance.rst
    • Combined the steps of delete-db-cluster.rst and purchase-reserved-db-instances-offering.rst into one example each
    • Removed the describe-db-shard-groups steps from modify-db-shard-group.rst and reboot-db-shard-group.rst

Testing

  • Run pytest tests/functional/docs/test_examples.py -n auto
=== 70149 passed in 32.31s =====

@luigi617
luigi617 added this pull request to stack #10828 October 30, 2026 17:09
@luigi617
luigi617 requested a review from a team as a code owner October 30, 2026 17:09

This branch has not been deployed

No deployments
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