-
Notifications
You must be signed in to change notification settings - Fork 70
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
base: main
Are you sure you want to change the base?
Conversation
…the test, which can be run with ci testing
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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
"""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
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
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
@jiridanek: The following test failed, say
Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
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: