-
Notifications
You must be signed in to change notification settings - Fork 71
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
RHOAIENG-17695: chore(ci): create a test for calling oc version
in the test, which can be run with ci testing
#829
RHOAIENG-17695: chore(ci): create a test for calling oc version
in the test, which can be run with ci testing
#829
Conversation
…the test, which can be run with ci testing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Design issues
- suite should support local run
- github run
- and on openshift run
Suite should handle reporting of failing tests
- junit, or markdown table, something that's clear at a glanc
Makefile tests should be rewritten into this
- the source of truth should be the manifest files
- need to figure out which manifest applies for which image
env: | ||
DOCKER_HOST: "unix:///var/run/podman/podman.sock" | ||
TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE: "/var/run/podman/podman.sock" | ||
RYUK_CONTAINER_IMAGE: "testcontainers/ryuk:0.8.1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jstourac suggested disabling ryuk for gha runs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"""Tests that are applicable for all images we have in this repository.""" | ||
|
||
def test_oc_command_runs(self, image: str): | ||
container = testcontainers.core.container.DockerContainer(image=image, user=123456, group_add=[0]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jstourac suggested abstracting this object away, so the same test can run against local docker as well as remote kubernetes, depending on some cli switch or some other configuration mechanism
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logging.debug(output.decode()) | ||
assert ecode == 0 | ||
|
||
def test_oc_command_runs_fake_fips(self, image: str, subtests: pytest_subtests.SubTests): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jstourac suggested skipping this test when running suite on openshift, openshift will test real configurations, not these fake ones
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
metafunc.parametrize(image.__name__, metafunc.config.getoption("--image")) | ||
|
||
|
||
# https://docs.pytest.org/en/stable/how-to/fixtures.html#parametrizing-fixtures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jstourac was discouraged by this long doc page and left the office for today shortly after opening it
import pytest_subtests | ||
|
||
|
||
class TestBaseImage: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jstourac wondered how to structure the tests when more are to be added, like when the version tests are rewritten from makefile to here
/lgtm Reviewed code and was able to run locally to observe intended behavior. @jstourac 's insights all certainly good/valid - but current form of this PR seems like a great starting point to enhance in the future. |
/override ci/prow/images |
@jiridanek: Overrode contexts on behalf of jiridanek: ci/prow/images In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jiridanek 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 |
https://issues.redhat.com/browse/RHOAIENG-17695
Description
Pytest! Yay!
How Has This Been Tested?
This should fail one test, because one of the images is the one that was seen failing on FIPS systems.
Merge criteria: