Skip to content

Makefile: improve make help and add testing guide#28946

Merged
Honny1 merged 2 commits into
podman-container-tools:mainfrom
Honny1:help-and-testing
Jun 17, 2026
Merged

Makefile: improve make help and add testing guide#28946
Honny1 merged 2 commits into
podman-container-tools:mainfrom
Honny1:help-and-testing

Conversation

@Honny1

@Honny1 Honny1 commented Jun 16, 2026

Copy link
Copy Markdown
Contributor
  • Improve make help with descriptions for key targets, portable formatting (fixes macOS without coreutils), and usage examples for running specific tests
  • Add docs/TESTING.md as a concise, quick reference for running all test types

Checklist

Ensure you have completed the following checklist for your pull request to be reviewed:

  • Certify you wrote the patch or otherwise have the right to pass it on as an open-source patch by signing all
    commits. (git commit -s). (If needed, use git commit -s --amend). The author email must match
    the sign-off email address. See CONTRIBUTING.md
    for more information.
  • Referenced issues using Fixes: #00000 in commit message (if applicable)
  • Tests have been added/updated (or no tests are needed)
  • Documentation has been updated (or no documentation changes are needed)
  • All commits pass make validatepr (format/lint checks)
  • Release note entered in the section below (or None if no user-facing changes)

Does this PR introduce a user-facing change?

None

@Honny1 Honny1 marked this pull request as ready for review June 16, 2026 14:53
@Honny1

Honny1 commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

PTAL @podman-container-tools/podman-maintainers @podman-container-tools/podman-reviewers

Comment thread docs/TESTING.md Outdated
@@ -0,0 +1,86 @@
# Running Podman Tests On Linux

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Don't we already have a testing readme? test/README.md?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, but it's missing a few useful things. My idea was to have a single file with just commands and brief notes, but it would probably be better to extend test/README.md instead.

Comment thread docs/TESTING.md Outdated
Comment on lines +8 to +22
- See `test/README.md` for additional details on test infrastructure.

## Quick Reference

| Command | What it does |
|---------|-------------|
| `make localunit` | Unit tests with coverage |
| `make localintegration` | Integration tests (local) |
| `make remoteintegration` | Integration tests (remote) |
| `make localmachine` | Machine tests |
| `make localsystem` | System tests (BATS, local) |
| `make remotesystem` | System tests (BATS, remote) |
| `make test` | Run everything |

## Integration Tests (Ginkgo, `test/e2e/`)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this all should just go into test/README.md instead of adding yet another file with partial info

Comment thread Makefile Outdated
Comment on lines +264 to +273
@echo ""
@echo "Examples:"
@echo " make localintegration FOCUS=\"podman run\" "
@echo " Run integration tests matching \"podman run\" description"
@echo " make localintegration FOCUS_FILE=run_test.go"
@echo " Run integration tests from a specific file"
@echo " make localmachine FOCUS_FILE=basic_test.go"
@echo " Run machine tests from a specific file"
@echo " make localintegration FOCUS=\"podman run\" GINKGO_PARALLEL=n"
@echo " Run a specific test without parallelism (useful for debugging)"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I am not sure this is particular helpful to show all the time.
It is important to remember that these targets only run on linux, would it not be better to have an example on how to build podman? And for the testing just tell users to look into test/README.md

@mtrmac mtrmac left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Only a look at the Makefile.

Comment thread Makefile Outdated
Comment thread Makefile Outdated
Comment thread Makefile Outdated
@Honny1 Honny1 force-pushed the help-and-testing branch from a5995a4 to bf61f9b Compare June 16, 2026 15:44
@Honny1

Honny1 commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

@mheon @Luap99 @mtrmac Thanks for the quick review. I've addressed your comments.

Comment thread test/README.md Outdated
![PODMAN logo](https://raw.githubusercontent.com/containers/common/main/logos/podman-logo-full-vert.png)

> **WARNING: Tests are destructive to your local environment.**
> Integration and system tests wipe `~/.local/share/containers` and `~/.config/containers` before running. This removes all local containers, images, pods, volumes, and machine instances. Run tests in a dedicated environment or VM, not on a workstation with data you care about.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

integration tests should not wipe anything as they use custom dirs, only system tests do.

Though I guess the run in VM advice is solid regardless

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

oh maybe out of scope for now but regarding the VM we likely should document the new CI behavior

hack/ci/ci.sh sys remote rootless fedora-current will run tests in the same VM as CI so is perfect for reproducing issues. All the user needs is to have lima installed. I did not check if the script works on macos though I believe it should be possible.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oh, this is good to know. I will create an issue for that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Comment thread test/README.md Outdated
| `make localmachine` | Machine tests (`pkg/machine/e2e/`) |
| `make localsystem` | System tests (`test/system/`) |
| `make remotesystem` | System tests, remote client (`test/system/`) |
| `make test` | Run everything |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Did anybody ever use the run all target? That will take forever...

Overall I guess maybe as a note for new users I think for local testing we should strongly recommend the specific test path as the test suites take way to long otherwise.

@Honny1 Honny1 force-pushed the help-and-testing branch from fb62ddd to 47246ca Compare June 16, 2026 16:30
@Luap99

Luap99 commented Jun 16, 2026

Copy link
Copy Markdown
Member

@Honny1 FYI if you link logs make sure to send the GH link not the resolved CDN link, the CDN links are timestamped and get invalidated soon.

i.e. use links such as https://github.com/podman-container-tools/podman/actions/runs/27631989406/job/81709142760
or https://github.com/podman-container-tools/podman/commit/fb62ddd3f9030623030e52197d2c0f8156019e7b/checks/81709142760/logs

@mheon

mheon commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

LGTM for reference

Comment thread test/README.md Outdated
| Command | What it does |
|---------|-------------|
| `make localunit` | Unit tests with coverage |
| `make localintegration` | Integration tests (`test/e2e/`) |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

non-blocking nit: there's an expanded section on some of these later in this doc, how about:

Suggested change
| `make localintegration` | Integration tests (`test/e2e/`) |
| `make localintegration` | [Integration tests (`test/e2e/`)](#integration-tests) |

Honny1 added 2 commits June 17, 2026 10:02
Add ## descriptions to commonly used targets so they appear in make help.

Replace the `wc -L` column-width approach (unavailable on macOS without coreutils)
with awk-based alignment.

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
Add a warning that tests wipe local container state,
a quick-reference table of make targets,
and examples for running specific integration, machine,
system, and unit tests.

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
@Honny1 Honny1 force-pushed the help-and-testing branch from 47246ca to 0aa4381 Compare June 17, 2026 08:02
@Honny1

Honny1 commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

PTAL @podman-container-tools/podman-maintainers @podman-container-tools/podman-reviewers

@Honny1 Honny1 requested a review from danishprakash June 17, 2026 12:03
@ashley-cui

Copy link
Copy Markdown
Contributor

LGTM

@Honny1

Honny1 commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

Self-merging since we have two LGTMs.

@Honny1 Honny1 merged commit d84fb8b into podman-container-tools:main Jun 17, 2026
126 of 128 checks passed

@danishprakash danishprakash left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sorry about the delay, the changes look good!

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.

6 participants