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

e2e: Add scenario for microshift preset #3779

Merged
merged 6 commits into from
Aug 2, 2023

Conversation

praveenkumar
Copy link
Member

With this we can able to test out the microshift preset functionality.

$ BUNDLE_LOCATION='--bundle-location=/home/prkumar/.crc/cache/crc_microshift_libvirt_4.13.3_amd64.crcbundle' PULL_SECRET_FILE='--pull-secret-file=/home/prkumar/pull-secret' CRC_BINARY='--crc-binary=/home/prkumar/work/github/crc/out/linux-amd64/' make e2e-story-microshift

  Background:
    Given setting config property "preset" to value "microshift" succeeds                                                                                      # testsuite.go:860 -> github.com/crc-org/crc/test/e2e/testsuite.SetConfigPropertyToValueSucceedsOrFails
[sudo] password for prkumar: 
    And executing single crc setup command succeeds        

[...]

@gbraad gbraad requested review from jsliacan and anjannath and removed request for evidolob August 1, 2023 08:58
@jsliacan jsliacan changed the title Integration: Add scenario for microshift preset e2e: Add scenario for microshift preset Aug 1, 2023
@praveenkumar
Copy link
Member Author

/hold

Need to verify the actual microshift test runs or not.

@praveenkumar
Copy link
Member Author

/test e2e-microshift-crc

@praveenkumar praveenkumar force-pushed the microshift_test branch 2 times, most recently from 9362d12 to 39121ad Compare August 1, 2023 16:06
It should fix following error in case of microshift preset and warning
in case of openshift preset.

```
Error creating: pods "httpd-example-6ddffbfb58-r6z7d" is forbidden: violates PodSecurity "restricted:latest": seccompProfile (pod or container "httpd-24" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")
```
82ca273 refactored the code and because of that
`usingPreexistingCluster` function broken since `GodogTags` is not
assigned. This PR make sure `GodogTags` contain the provided tags.
With this we can run `make e2e-story-microshift` and test only the
microshift functionaility.
The defaults doesn't make sense and also it block the correct execution
of test. If I run the integration test without these parameter then it
should use the default from the binary for bundle and $GOPATH/bin for
the binary. This PR fix it.
Currently, it is part of different block which print it out during
testing of default bundle instead user provided one.
@openshift-ci openshift-ci bot added the lgtm label Aug 2, 2023
@openshift-ci
Copy link

openshift-ci bot commented Aug 2, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gbraad

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
Copy link

openshift-ci bot commented Aug 2, 2023

@praveenkumar: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-crc 9a0748a link true /test e2e-crc

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/test-infra repository. I understand the commands that are listed here.

@praveenkumar
Copy link
Member Author

/unhold

@praveenkumar praveenkumar merged commit 29be5ec into crc-org:main Aug 2, 2023
13 checks passed
@cfergeau
Copy link
Contributor

Unclear to me why this seems to be a wholly different test from the other ones we have? Could we share the same "httpd" test for both microshift and openshift?

@praveenkumar
Copy link
Member Author

Unclear to me why this seems to be a wholly different test from the other ones we have? Could we share the same "httpd" test for both microshift and openshift?

@cfergeau httpd scenario is part of story_openshift feature where it expect the cluster of openshift running (as part of background). if a scenario can be abstracted which can consumed for different features then we didn't have to duplicate this test and consumed for both the scenarios but I didn't find a way.

@adrianriobo
Copy link
Contributor

adrianriobo commented Aug 21, 2023

I would suggest add a config flag to inform on which preset we want to run the tests (Default value to openshift).

That flag can be used within the background steps (making them dynamic based on the flag). With that approach you can avoid the duplication.

@cfergeau
Copy link
Contributor

cfergeau commented Aug 21, 2023

Took another look at this, and for some reason I had missed

@darwin @linux @windows @testdata @story_health @needs_namespace
Scenario: Overall cluster health
Given executing "oc new-project testproj" succeeds
When executing "oc apply -f httpd-example.yaml" succeeds
And executing "oc rollout status deployment httpd-example" succeeds
Then stdout should contain "successfully rolled out"
When executing "oc create configmap www-content --from-file=index.html=httpd-example-index.html" succeeds
Then stdout should contain "configmap/www-content created"
When executing "oc set volume deployment/httpd-example --add --type configmap --configmap-name www-content --name www --mount-path /var/www/html" succeeds
Then stdout should contain "deployment.apps/httpd-example volume updated"
When executing "oc expose deployment httpd-example --port 8080" succeeds
Then stdout should contain "httpd-example exposed"
When executing "oc expose svc httpd-example" succeeds
Then stdout should contain "httpd-example exposed"
When with up to "20" retries with wait period of "5s" http response from "http://httpd-example-testproj.apps-crc.testing" has status code "200"
Then executing "curl -s http://httpd-example-testproj.apps-crc.testing" succeeds
And stdout should contain "Hello CRC!"
When executing "crc stop" succeeds
And starting CRC with default bundle succeeds
And checking that CRC is running
And with up to "4" retries with wait period of "1m" http response from "http://httpd-example-testproj.apps-crc.testing" has status code "200"
Then executing "curl -s http://httpd-example-testproj.apps-crc.testing" succeeds
And stdout should contain "Hello CRC!"
Then with up to "4" retries with wait period of "1m" http response from "http://httpd-example-testproj.apps-crc.testing" has status code "200"
In my previous comments, I thought story_microshift.feature was totally different from the http OpenShift tests.
This is not the case, it's the same code, which answers my initial question :)

Imo it's really useful to add a comment before duplicated code to remind people when touching one of the code blocks, the other one needs to be updated. And documentingin the commit log why this was duplicated is also useful if one wants to try to improve things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants