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

Update registrar unit tests to match them of cri-o #2841

Merged
merged 1 commit into from
Apr 8, 2019

Conversation

saschagrunert
Copy link
Member

Hey, I basically copied the registrar tests from cri-o over here including their dependencies:

  • Add the test framework abstraction
  • Update the unit tests to run with ginkgo

As a follow-up I would remove the registrar completely from cri-o and use libpods' one.

Another general improvement could be to utilize the already vendored ginkgo sources for running the tests, like we do in cri-o:

${BUILD_BIN_PATH}/ginkgo:
	$(GO) build -o ${BUILD_BIN_PATH}/ginkgo ./vendor/github.com/onsi/ginkgo/ginkgo

testunit: mockgen ${BUILD_BIN_PATH}/ginkgo
	${BUILD_BIN_PATH}/ginkgo \
		${TESTFLAGS} \
		-r \
		...

This would make the test results more reliable.

@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 3, 2019
@openshift-ci-robot
Copy link
Collaborator

Hi @saschagrunert. Thanks for your PR.

I'm waiting for a containers or openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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/test-infra repository.

@openshift-ci-robot openshift-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Apr 3, 2019
@saschagrunert
Copy link
Member Author

Hm, the issue with the CI looks like a bug in ginkgo: onsi/ginkgo#427 🤔

@saschagrunert
Copy link
Member Author

/hold

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 3, 2019
@baude
Copy link
Member

baude commented Apr 3, 2019

why do we need this?

@saschagrunert
Copy link
Member Author

why do we need this?

The unit tests for this package have been upgraded within cri-o to use ginkgo/gomega (higher test coverage and bdd style). I thought it would be nice to have them here as well, since cri-o could rely completely on the package within libpod and remove its own copy of the code.

@rhatdan
Copy link
Member

rhatdan commented Apr 3, 2019

Tests are not working...

- Add the test framework abstraction
- Update the unit tests to run with ginkgo

Signed-off-by: Sascha Grunert <[email protected]>
@saschagrunert
Copy link
Member Author

I had to exclude the pkg/apparmor tests until onsi/ginkgo#570 is not merged yet. This makes me not happy at all, WDYT? If you tend to not go this way here I would also be fine in closing this PR.

@saschagrunert saschagrunert changed the title WIP: Update registrar unit tests to match them of cri-o Update registrar unit tests to match them of cri-o Apr 4, 2019
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 4, 2019
@saschagrunert
Copy link
Member Author

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 4, 2019
@vrothberg
Copy link
Member

I had to exclude the pkg/apparmor tests until onsi/ginkgo#570 is not merged yet. This makes me not happy at all, WDYT? If you tend to not go this way here I would also be fine in closing this PR.

Personally, I find the standard testing package to be much easier to brain-parse, read and maintain but I don't have much experience in the other packages and usually copy-pasted my way through. But the decision is entirely up to @baude and @mheon.

@mheon
Copy link
Member

mheon commented Apr 8, 2019

LGTM
@baude @vrothberg @rhatdan PTAL

@mheon
Copy link
Member

mheon commented Apr 8, 2019

/ok-to-test
/approve

@openshift-ci-robot openshift-ci-robot added ok-to-test and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 8, 2019
@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mheon, saschagrunert

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

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 8, 2019
@rhatdan
Copy link
Member

rhatdan commented Apr 8, 2019

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 8, 2019
@openshift-merge-robot openshift-merge-robot merged commit 60e5492 into containers:master Apr 8, 2019
@saschagrunert saschagrunert deleted the ginkgo-unit branch April 9, 2019 08:13
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 26, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. ok-to-test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants