Skip to content

Makefile: build ginkgo before running localunit - #29357

Open
Animesh-Parashar wants to merge 1 commit into
podman-container-tools:mainfrom
Animesh-Parashar:fix/localunit-ginkgo-prereq
Open

Makefile: build ginkgo before running localunit#29357
Animesh-Parashar wants to merge 1 commit into
podman-container-tools:mainfrom
Animesh-Parashar:fix/localunit-ginkgo-prereq

Conversation

@Animesh-Parashar

Copy link
Copy Markdown

Checklist

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

  • I have read and understood our contributing guidelines and will not have more than two open PRs as a new contributor.
  • PR description, commit message, and GitHub comments are human-written, per LLM Policy
  • 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

On a fresh clone make localunit fails on clean checkout

/usr/bin/bash: line 1: ./bin/ginkgo: No such file or directory
make: *** [Makefile:675: localunit] Error 127

The current recipe runs $(GINKGO) which is ./bin/ginkgo but the target only declares test/goecho/goecho and test/version/version as prereq. Nothing builds ginkgo, so on a fresh clone the binary is missing. /bin/ is gitignored, so it is never checked in.

The other three targets that use ginkgo all declare .install.ginkgo: ginkgo-run (line 695), testbindings (715) and system.test-binary (766). localunit is the only one that does not.

But
hack/ci/runner.sh already works around this:

function run_unit() {
    make .install.ginkgo
    $SUDO make localunit
}

This makes that first line unnecessary.
I used a file target rather than adding .install.ginkgo to the prerequisite list, because .install.ginkgo is .PHONY and would rebuild on every invocation. That matters here: run_unit runs localunit under sudo, so an unconditional rebuild would produce a root-owned bin/ginkgo. With a file target, make skips the build when the binary is present, which I checked with
make -n on a warm tree (no rebuild commands emitted).

With the fix, ginkgo builds and 64 suites run. 63 pass. The one failure is pkg/machine/provider TestBadInstalledProviders, which needs qemu-system-x86_64 that I do not have installed locally, and is unrelated to this change.
make validatepr passes.

Signed-off-by: Animesh Parashar <animeshparashar3439@gmail.com>
@TomSweeneyRedHat

Copy link
Copy Markdown
Contributor

LGTM
assuming happy tests

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