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

system tests: safer install_kube_template() #24515

Merged
merged 1 commit into from
Nov 11, 2024

Conversation

edsantiago
Copy link
Member

(Import from #23275, where it has been working for weeks. More importantly, I tested it on 1mt)

Previous version was badly broken: it relied on 'make' rebuilding a file under cwd, which is a no-no; and, in the case where we don't have a source directory, just blindly hoped that there'd be a system-installed .service file with the correct path to podman.

Solution:
. if running in source directory, run sed directly into
destination service file in $UNIT_DIR. This is ugly
duplication of a line in Makefile.

. if NOT running in a source directory, check $PODMAN:
. if it's /usr/bin/podman, continue
. otherwise skip, because we don't know what we're testing

None

@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 Nov 9, 2024
Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

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

Technically that would cause a regression for distros not installing podman to /usr/bin/podman and running these tests outside of our source dir as they are no longer covered. I doubt that will be an issue and we are skipping not failing so it seems good enough to me

LGTM (I am fine without the elif comment addressed)

Comment on lines 73 to 76
else
if [[ "$PODMAN" != "/usr/bin/podman" ]]; then
skip "No $unit_file_in, and PODMAN=$PODMAN"
fi
Copy link
Member

Choose a reason for hiding this comment

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

I guess this could use an elif to avoid one level of nesting.

Previous version was badly broken: it relied on 'make'
rebuilding a file under cwd, which is a no-no; and, in
the case where we don't have a source directory, just
blindly hoped that there'd be a system-installed .service
file with the correct path to podman.

Solution:
  . if running in source directory, run sed directly into
    destination service file in $UNIT_DIR. This is ugly
    duplication of a line in Makefile.

  . if NOT running in a source directory, check $PODMAN:
    . if it's /usr/bin/podman, continue. Include a warning
      that will be shown only on test failure.
    . otherwise skip, because we don't know what we're testing

Signed-off-by: Ed Santiago <[email protected]>
Copy link
Member

@Luap99 Luap99 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 Nov 11, 2024

[APPROVALNOTIFIER] This PR is APPROVED

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

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:

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 Nov 11, 2024

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 11, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit 7a3e8da into containers:main Nov 11, 2024
56 checks passed
@edsantiago edsantiago deleted the kube-template branch November 11, 2024 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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. release-note-none
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants