Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI:DOCS] Tests for xref-helpmsgs-manpages #21055

Merged
merged 1 commit into from
Dec 19, 2023

Conversation

edsantiago
Copy link
Member

In the process of adding new functionality to the xref script,
I realized it is much too fragile. It's too easy to make some
minor change that could break the crossrefs, giving us the
illusion of testing.

Solution: add a test suite for the script. Still incomplete,
but an important step toward building confidence.

Requires minor surgery to the script itself

(Note: this test suite is something for me to run. It can't run in CI due to missing dependencies)

Signed-off-by: Ed Santiago [email protected]

None

In the process of adding new functionality to the xref script,
I realized it is much too fragile. It's too easy to make some
minor change that could break the crossrefs, giving us the
illusion of testing.

Solution: add a test suite for the script. Still incomplete,
but an important step toward building confidence.

Requires minor surgery to the script itself

Signed-off-by: Ed Santiago <[email protected]>
@openshift-ci openshift-ci bot added release-note-none approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Dec 18, 2023
Copy link
Member Author

@edsantiago edsantiago left a comment

Choose a reason for hiding this comment

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

Annotations to help reviewers (assuming there are any such present this week)

my $PODMAN = $ENV{PODMAN} || $Default_Podman;

# Path to all doc files, including .rst and (down one level) markdown
my $Docs_Path = 'docs/source';
our $Docs_Path = 'docs/source';
Copy link
Member Author

Choose a reason for hiding this comment

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

my -> our makes it a scoped named variable that we can then use from the .t file.

Comment on lines +219 to +220
# "podman inspect" tries to autodetect if it's being run
# on an image or container. It cannot sanely be documented.
Copy link
Member Author

Choose a reason for hiding this comment

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

This warning has been present for a few months. I left it in because maybe I could find a way to document podman inspect --format? But nope, I don't think it's practical. Here I simply remove the warning.

@@ -460,12 +463,11 @@ sub podman_help {
sub podman_man {
my $command = shift;
my $subpath = "$Markdown_Path/$command.1.md";
my $manpath = "$FindBin::Bin/../$subpath";
Copy link
Member Author

Choose a reason for hiding this comment

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

Pointless variable. The cd near top guarantees us being in the right dir to use relative paths.

Copy link
Member

@giuseppe giuseppe left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

openshift-ci bot commented Dec 19, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: edsantiago, giuseppe

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [edsantiago,giuseppe]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@rhatdan
Copy link
Member

rhatdan commented Dec 19, 2023

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Dec 19, 2023
@openshift-merge-bot openshift-merge-bot bot merged commit 65266a3 into containers:main Dec 19, 2023
40 checks passed
@edsantiago edsantiago deleted the xref_tests branch December 19, 2023 12:33
edsantiago added a commit to edsantiago/libpod that referenced this pull request Jan 4, 2024
Followup to containers#21055: regression tests for the code that
reads man pages. These are not xref-related at all, just
simple consistency checks on the man page content.

In the process of writing these tests, I also fixed a
longstanding bug where warning messages could be emitted
multiple times, once for each time we read a man page file
(as happens with command aliases).

Signed-off-by: Ed Santiago <[email protected]>
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Mar 19, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. release-note-none
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants