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

OCP4: Add workflow to test ocp content #11615

Merged
merged 1 commit into from
May 15, 2024

Conversation

Vincent056
Copy link
Contributor

Add this workflow so we can test ocp4 content can be parsed on each PR

@Vincent056
Copy link
Contributor Author

ComplianceAsCode/compliance-operator#493 needs to merge before this can work

Copy link

Start a new ephemeral environment with changes proposed in this pull request:

Fedora Environment
Open in Gitpod

Oracle Linux 8 Environment
Open in Gitpod

Copy link

github-actions bot commented Feb 22, 2024

🤖 A k8s content image for this PR is available at:
ghcr.io/complianceascode/k8scontent:11615
This image was built from commit: 894dfa9

Click here to see how to deploy it

If you alread have Compliance Operator deployed:
utils/build_ds_container.py -i ghcr.io/complianceascode/k8scontent:11615

Otherwise deploy the content and operator together by checking out ComplianceAsCode/compliance-operator and:
CONTENT_IMAGE=ghcr.io/complianceascode/k8scontent:11615 make deploy-local

@yuumasato
Copy link
Member

Checking whether the compliance-operator can parse the data stream is important, but the test in https://github.com/ComplianceAsCode/compliance-operator/pull/493/files# seem too specific and contained.

I wonder if we could have a more thorough "smoke" integration test, something that runs CO and consumes the data stream.

@Vincent056
Copy link
Contributor Author

Checking whether the compliance-operator can parse the data stream is important, but the test in https://github.com/ComplianceAsCode/compliance-operator/pull/493/files# seem too specific and contained.

I wonder if we could have a more thorough "smoke" integration test, something that runs CO and consumes the data stream.

the reason for this one I think is to have some gating on if CO can parse the datastream, but not to run a full on CI e2e job, however I think we can improve the test here

Copy link
Collaborator

@rhmdnd rhmdnd left a comment

Choose a reason for hiding this comment

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

Looks like this is on the right track. Just some feedback on isolating the test implementation details to the compliance-operator code base, so that the content repository doesn't need to understand how the test is implemented to call it.

.github/workflows/k8s-content-pr-test.yaml Outdated Show resolved Hide resolved
.github/workflows/k8s-content-pr-test.yaml Outdated Show resolved Hide resolved
git clone https://github.com/ComplianceAsCode/compliance-operator.git
- uses: actions/setup-go@v5
with:
go-version: '>=1.19.0'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are we going to have to bump this go version separately each time we bump it in the compliance-operator?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it will use the latest go,

Run go version
go version go1.22.0 linux/amd6[4](https://github.com/ComplianceAsCode/content/actions/runs/8007294791/job/21871061364?pr=11615#step:5:5)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh - this is just enforcing a lower bound. Thanks.

Copy link
Collaborator

Choose a reason for hiding this comment

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

We will be testing with a version of golang (1.22) that's potentially different from the version of golang we build the operator with, correct?

So there would be a chance that the tests we invoke using https://github.com/ComplianceAsCode/compliance-operator/pull/493/files#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52R589 would break against the latest version of golang we're using here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that's a good point, I changed this part to fetching the go version from the CO go.mod file

@Vincent056
Copy link
Contributor Author

Looks like this is on the right track. Just some feedback on isolating the test implementation details to the compliance-operator code base, so that the content repository doesn't need to understand how the test is implemented to call it.

thanks for the review, just had those tests changed to use the make target instead.

@marcusburghardt marcusburghardt added Test Suite Update in Test Suite. OpenShift OpenShift product related. labels Mar 6, 2024
Add this workflow so we can test ocp4 content can be parsed on each PR
Copy link

codeclimate bot commented Mar 18, 2024

Code Climate has analyzed commit 894dfa9 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 58.1% (-1.1% change).

View more on Code Climate.

@Vincent056
Copy link
Contributor Author

/retest

Copy link
Collaborator

@rhmdnd rhmdnd left a comment

Choose a reason for hiding this comment

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

My comments have been addressed, and I think we can start with this approach and iterate on it as needed.

Leave it open for @yuumasato to ensure his comments are addressed.

@yuumasato yuumasato added this to the 0.1.74 milestone May 15, 2024
@yuumasato
Copy link
Member

This PR is adding a new GH workflow, there is no need to rebase to trigger hardening tests.

@yuumasato yuumasato merged commit 9dd22d1 into ComplianceAsCode:master May 15, 2024
52 of 54 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OpenShift OpenShift product related. Test Suite Update in Test Suite.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants